all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* PATCH: vc-git-grep: force git-grep to disable color and pager
@ 2013-09-25  6:30 Mitchel Humpherys
  2013-09-25 17:08 ` Davis Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Mitchel Humpherys @ 2013-09-25  6:30 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

This commit adds some command line options to the invocation of `git'
in `vc-git-grep' so that git disables all coloring and paging. Without
this, I get a warning about my "terminal" not being fully functional
and git-grep attempts to use a pager (which means the git-grep process
never finishes):

    git grep -n -e stuff -- *
    WARNING: terminal is not fully functional
     CREDITS:14:D: Alpha systems hacking, IPv6 and other network related stuff
    <snip>
    :  <-- pager waiting for me to do something



-- 
"if i had more time i would have written a shorter letter."
--Pascal

[-- Attachment #2: vc-git-grep.txt --]
[-- Type: text/plain, Size: 2174 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: mitch.special@gmail.com-20130925062033-p8461043wmcctznz
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: 288f9778d7a38f15b67ce5fcf41241cbf691f767
# timestamp: 2013-09-24 23:21:00 -0700
# base_revision_id: eggert@cs.ucla.edu-20130925034434-wbwf8chwg0tj5w40
# 
# Begin patch
=== modified file 'lisp/vc/vc-git.el'
--- lisp/vc/vc-git.el	2013-09-12 05:45:42 +0000
+++ lisp/vc/vc-git.el	2013-09-25 06:20:33 +0000
@@ -1082,7 +1082,7 @@
 	      (setq command nil))
 	(setq dir (file-name-as-directory (expand-file-name dir)))
 	(setq command
-	      (grep-expand-template "git grep -n -e <R> -- <F>"
+	      (grep-expand-template "git --no-pager grep --no-color -n -e <R> -- <F>"
                                     regexp files))
 	(when command
 	  (if (equal current-prefix-arg '(4))

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRQNG34AAZLfgBAwUGP/91NC
EAC////wUAN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ixdEGku3RKEySHYtkydsn6FogRfa/gbR4OnHMlzgPAYZPrBVFkF4KsKrPKXV
/MYx48TgWIEhYULFeK+gnGR3Z1DRatZDoObmKMrvUXckU4UJAUDRt+A=

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: vc-git-grep: force git-grep to disable color and pager
  2013-09-25  6:30 PATCH: vc-git-grep: force git-grep to disable color and pager Mitchel Humpherys
@ 2013-09-25 17:08 ` Davis Herring
  2013-09-26  5:17   ` Mitchel Humpherys
  0 siblings, 1 reply; 5+ messages in thread
From: Davis Herring @ 2013-09-25 17:08 UTC (permalink / raw)
  To: Mitchel Humpherys; +Cc: emacs-devel

> This commit adds some command line options to the invocation of `git'
> in `vc-git-grep' so that git disables all coloring and paging. Without
> this, I get a warning about my "terminal" not being fully functional
> and git-grep attempts to use a pager (which means the git-grep process
> never finishes):
> 
>     git grep -n -e stuff -- *
>     WARNING: terminal is not fully functional
>      CREDITS:14:D: Alpha systems hacking, IPv6 and other network related stuff
>     <snip>
>     :  <-- pager waiting for me to do something

All this (including the warning) is the use of less, not the coloring
(although git might in theory complain if you try to use coloring with
no TERM variable or so).  I'd recommend using --no-pager but trying to
interpret the color rather than suppressing it.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: vc-git-grep: force git-grep to disable color and pager
  2013-09-25 17:08 ` Davis Herring
@ 2013-09-26  5:17   ` Mitchel Humpherys
  2013-10-01  3:51     ` Mitchel Humpherys
  2013-10-01 15:34     ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Mitchel Humpherys @ 2013-09-26  5:17 UTC (permalink / raw)
  To: Davis Herring; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]

On Wed, Sep 25, 2013 at 10:08 AM, Davis Herring <herring@lanl.gov> wrote:
>> This commit adds some command line options to the invocation of `git'
>> in `vc-git-grep' so that git disables all coloring and paging. Without
>> this, I get a warning about my "terminal" not being fully functional
>> and git-grep attempts to use a pager (which means the git-grep process
>> never finishes):
>>
>>     git grep -n -e stuff -- *
>>     WARNING: terminal is not fully functional
>>      CREDITS:14:D: Alpha systems hacking, IPv6 and other network related stuff
>>     <snip>
>>     :  <-- pager waiting for me to do something
>
> All this (including the warning) is the use of less, not the coloring
> (although git might in theory complain if you try to use coloring with
> no TERM variable or so).  I'd recommend using --no-pager but trying to
> interpret the color rather than suppressing it.
>
> Davis
>

You're absolutely right. I've removed the --no-color flag in this
version and confirmed that highlighting works in the *grep* results
buffer.

Thanks,
Mitch


-- 
"if i had more time i would have written a shorter letter."
--Pascal

[-- Attachment #2: vc-git-grep-V2.txt --]
[-- Type: text/plain, Size: 2309 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: mitch.special@gmail.com-20130926051315-t1szt102wbdakjwb
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: d5a1d14cfa74d5c777fdca663051b7acbde0815d
# timestamp: 2013-09-25 22:15:32 -0700
# base_revision_id: eggert@cs.ucla.edu-20130925034434-wbwf8chwg0tj5w40
# 
# Begin patch
=== modified file 'lisp/vc/vc-git.el'
--- lisp/vc/vc-git.el	2013-09-12 05:45:42 +0000
+++ lisp/vc/vc-git.el	2013-09-26 05:13:15 +0000
@@ -1082,7 +1082,7 @@
 	      (setq command nil))
 	(setq dir (file-name-as-directory (expand-file-name dir)))
 	(setq command
-	      (grep-expand-template "git grep -n -e <R> -- <F>"
+	      (grep-expand-template "git --no-pager grep -n -e <R> -- <F>"
                                     regexp files))
 	(when command
 	  (if (equal current-prefix-arg '(4))

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRVSxGQAAZDfgBAwUGf/91dC
EIC////wUAPOnnRedxR0AGSEmUe0aJ6psm0T1E9RkxNA009QAaRTE9TxNTTwpp6gaAAAAAGiKeno
o9J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MoGvmlKcIsasq3y1D4VmTKwOcIIyCPK4k+vtenbH3vCANTZvpCvCCdF8Ca2W1A0V570oSUkdRPx
vc7Y69lmLUKrNVcDCQFQ+NDnuO5glLVbQft+ydI1BeG+tyqnuXMh2P3rH89pT5dfjzb7GvHLwbBc
giuHkj4E2tbV4pjcc+Ewzmxng51RVtFKf/i7kinChICqliMg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: vc-git-grep: force git-grep to disable color and pager
  2013-09-26  5:17   ` Mitchel Humpherys
@ 2013-10-01  3:51     ` Mitchel Humpherys
  2013-10-01 15:34     ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Mitchel Humpherys @ 2013-10-01  3:51 UTC (permalink / raw)
  To: Davis Herring; +Cc: emacs-devel

On Wed, Sep 25, 2013 at 10:17 PM, Mitchel Humpherys
<mitch.special@gmail.com> wrote:
> On Wed, Sep 25, 2013 at 10:08 AM, Davis Herring <herring@lanl.gov> wrote:
>>> This commit adds some command line options to the invocation of `git'
>>> in `vc-git-grep' so that git disables all coloring and paging. Without
>>> this, I get a warning about my "terminal" not being fully functional
>>> and git-grep attempts to use a pager (which means the git-grep process
>>> never finishes):
>>>
>>>     git grep -n -e stuff -- *
>>>     WARNING: terminal is not fully functional
>>>      CREDITS:14:D: Alpha systems hacking, IPv6 and other network related stuff
>>>     <snip>
>>>     :  <-- pager waiting for me to do something
>>
>> All this (including the warning) is the use of less, not the coloring
>> (although git might in theory complain if you try to use coloring with
>> no TERM variable or so).  I'd recommend using --no-pager but trying to
>> interpret the color rather than suppressing it.
>>
>> Davis
>>
>
> You're absolutely right. I've removed the --no-color flag in this
> version and confirmed that highlighting works in the *grep* results
> buffer.

Any other comments on this? What's the next step towards merging? It's
quite a trivial patch but without it `vc-git-grep' is pretty much
unusable...


-- 
"if i had more time i would have written a shorter letter."
--Pascal



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: vc-git-grep: force git-grep to disable color and pager
  2013-09-26  5:17   ` Mitchel Humpherys
  2013-10-01  3:51     ` Mitchel Humpherys
@ 2013-10-01 15:34     ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2013-10-01 15:34 UTC (permalink / raw)
  To: Mitchel Humpherys; +Cc: emacs-devel

> You're absolutely right. I've removed the --no-color flag in this
> version and confirmed that highlighting works in the *grep* results
> buffer.

Thanks, installed,


        Stefan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-01 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25  6:30 PATCH: vc-git-grep: force git-grep to disable color and pager Mitchel Humpherys
2013-09-25 17:08 ` Davis Herring
2013-09-26  5:17   ` Mitchel Humpherys
2013-10-01  3:51     ` Mitchel Humpherys
2013-10-01 15:34     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.