GNU bug report logs - #9408
23.3; vc-git-grep doesn't link to files when git grep uses colour

Previous Next

Package: emacs;

Reported by: Wilfred Hughes <wilfred <at> potatolondon.com>

Date: Tue, 30 Aug 2011 16:08:01 UTC

Severity: normal

Found in version 23.3

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9408 in the body.
You can then email your comments to 9408 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 30 Aug 2011 16:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wilfred Hughes <wilfred <at> potatolondon.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 30 Aug 2011 16:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wilfred Hughes <wilfred <at> potatolondon.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Tue, 30 Aug 2011 11:55:13 +0100
1. disable colour for git by doing the following in a shell: $ git
config --global color.ui never

2. open a file that is in a git repository: (in my case: C-x C-f
~/gxbo/cron.yaml)

3. search for something that exists using vc-git-grep: (in my case: M-x
vc-git-grep RET backend RET * RET ~/gxbo RET)

4. results are returned that links to the files where the results were
found

5. enable colour for git: $ git config --global color.ui always

6. repeat the search with vc-git grep

7. results are just plain text and hitting RET on them gives "no git hit
here".

Compared with using grep, I note that my search term 'backend' is not
highlighted. I don't know if that's related.

Thanks.

In GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.5)
 of 2011-08-21 on ovide
Windowing system distributor `The X.Org Foundation', version 11.0.11003901
configured using `configure  '--prefix=/usr' '--sysconfdir=/etc'
'--libexecdir=/usr/lib' '--localstatedir=/var' '--without-sound'
'--with-x-toolkit=gtk' '--with-xft' 'CFLAGS=-march=x86-64
-mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4
-D_FORTIFY_SOURCE=2'
'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
C-x C-f c r o n . y <tab> <return> M-x v c - g i <tab>
g r e <tab> <return> b a c k e n d <return> * <return>
C-f <return> <down-mouse-1> <mouse-1> M-x v c - g i
<tab> g <tab> <return> b a c k e n d <return> * <return>
<return> C-x o M-> M-< C-x o M-x r e p o r <tab> <
return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
call-interactively: End of buffer
Grep finished (matches found) [2 times]
Mark set [2 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message idna sendmail regexp-opt ecomplete rfc822
mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode
mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev
nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit
mailheader canlock sha1 hex-util hashcash mail-utils emacsbug grep
compile comint ring vc-git tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 30 Aug 2011 16:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Wilfred Hughes <wilfred <at> potatolondon.com>
To: 9408 <at> debbugs.gnu.org
Subject: A simple patch
Date: Tue, 30 Aug 2011 17:42:42 +0100
[Message part 1 (text/plain, inline)]
Fixing this should be just a matter of changing line 890 of vc-git.el:

(grep-expand-template "git grep -n -e <R> -- <F>" regexp files))

To:

(grep-expand-template "git grep --no-color -n -e <R> -- <F>" regexp files))

Generally --no-color is used, so I can't see any similar issues elsewhere.
[Message part 2 (text/html, inline)]

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 01 Sep 2011 07:34:02 GMT) Full text and rfc822 format available.

Notification sent to Wilfred Hughes <wilfred <at> potatolondon.com>:
bug acknowledged by developer. (Thu, 01 Sep 2011 07:34:02 GMT) Full text and rfc822 format available.

Message #13 received at 9408-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9408-done <at> debbugs.gnu.org
Subject: Re: bug#9408: A simple patch
Date: Thu, 01 Sep 2011 03:30:18 -0400
Version: 24.1

Thanks; applied.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Mon, 05 Sep 2011 08:55:03 GMT) Full text and rfc822 format available.

Message #16 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Wilfred Hughes <wilfred <at> potatolondon.com>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Mon, 05 Sep 2011 11:28:17 +0300
> Compared with using grep, I note that my search term 'backend' is not
> highlighted. I don't know if that's related.

git-grep emits "\033[1;31m" escape sequences unlike expected "\033[01;31m"
as GNU Grep does.  I fixed this in the Bzr repo, so now search terms can be
highlighted by `vc-git-grep'.  Could you please try the fixed version now?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Mon, 05 Sep 2011 12:48:01 GMT) Full text and rfc822 format available.

Message #19 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Wilfred Hughes <wilfred <at> potatolondon.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Mon, 5 Sep 2011 13:43:17 +0100
[Message part 1 (text/plain, inline)]
I built revision 105661, then ran $ src/emacs -Q but I did not get search
highlighting with vc-git-grep. File name highlighting works fine. My git
version is:

$ git --version
git version 1.7.6.1

On 5 September 2011 09:28, Juri Linkov <juri <at> jurta.org> wrote:

> > Compared with using grep, I note that my search term 'backend' is not
> > highlighted. I don't know if that's related.
>
> git-grep emits "\033[1;31m" escape sequences unlike expected "\033[01;31m"
> as GNU Grep does.  I fixed this in the Bzr repo, so now search terms can be
> highlighted by `vc-git-grep'.  Could you please try the fixed version now?
>
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 06 Sep 2011 09:40:02 GMT) Full text and rfc822 format available.

Message #22 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Wilfred Hughes <wilfred <at> potatolondon.com>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Tue, 06 Sep 2011 12:32:54 +0300
> I built revision 105661, then ran $ src/emacs -Q but I did not get search
> highlighting with vc-git-grep. File name highlighting works fine. My git
> version is:
>
> $ git --version
> git version 1.7.6.1

My git version is 1.7.1 and I get search highlighting when I enable
colour for git with: $ git config --global color.ui auto
and when `git grep' runs without "--no-color".




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 06 Sep 2011 13:32:01 GMT) Full text and rfc822 format available.

Message #25 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Wilfred Hughes <wilfred <at> potatolondon.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Tue, 6 Sep 2011 14:27:31 +0100
[Message part 1 (text/plain, inline)]
Yes, using git grep without --no-color gets exactly the colour codes you
describe. But as of revision 105630 (the commit mentioned in message 13),
vc-git-grep uses the command "git grep --no-color -n -e <R> -- <F>" which
suppresses search term highlighting. Have I missed something?

On 6 September 2011 10:32, Juri Linkov <juri <at> jurta.org> wrote:

> > I built revision 105661, then ran $ src/emacs -Q but I did not get search
> > highlighting with vc-git-grep. File name highlighting works fine. My git
> > version is:
> >
> > $ git --version
> > git version 1.7.6.1
>
> My git version is 1.7.1 and I get search highlighting when I enable
> colour for git with: $ git config --global color.ui auto
> and when `git grep' runs without "--no-color".
>
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 06 Sep 2011 13:46:01 GMT) Full text and rfc822 format available.

Message #28 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Wilfred Hughes <wilfred <at> potatolondon.com>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Tue, 06 Sep 2011 16:40:10 +0300
> Yes, using git grep without --no-color gets exactly the colour codes you
> describe. But as of revision 105630 (the commit mentioned in message 13),
> vc-git-grep uses the command "git grep --no-color -n -e <R> -- <F>" which
> suppresses search term highlighting. Have I missed something?

You earlier suggested to add "--no-color" to `grep-expand-template'.
Do you think it now can be removed because now search terms are
highlighted correctly and you have no more problems with
hitting RET on them?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9408; Package emacs. (Tue, 06 Sep 2011 14:12:01 GMT) Full text and rfc822 format available.

Message #31 received at 9408 <at> debbugs.gnu.org (full text, mbox):

From: Wilfred Hughes <wilfred <at> potatolondon.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9408 <at> debbugs.gnu.org
Subject: Re: 23.3; vc-git-grep doesn't link to files when git grep uses colour
Date: Tue, 6 Sep 2011 15:06:45 +0100
[Message part 1 (text/plain, inline)]
Oh, sorry. Yes, it can be removed and works perfectly. Many thanks.

On 6 September 2011 14:40, Juri Linkov <juri <at> jurta.org> wrote:

> > Yes, using git grep without --no-color gets exactly the colour codes you
> > describe. But as of revision 105630 (the commit mentioned in message 13),
> > vc-git-grep uses the command "git grep --no-color -n -e <R> -- <F>" which
> > suppresses search term highlighting. Have I missed something?
>
> You earlier suggested to add "--no-color" to `grep-expand-template'.
> Do you think it now can be removed because now search terms are
> highlighted correctly and you have no more problems with
> hitting RET on them?
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Oct 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.