GNU bug report logs - #64140
29.0.91; C-u M-x grep doesn't work correctly after M-x vc-git-grep

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Sun, 18 Jun 2023 00:33:02 UTC

Severity: normal

Found in version 29.0.91

Full log


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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64140 <at> debbugs.gnu.org
Subject: Re: bug#64140: 29.0.91; C-u M-x grep doesn't work correctly after
 M-x vc-git-grep
Date: Sun, 18 Jun 2023 15:20:45 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sun, 18 Jun 2023 02:32:28 +0200
>> From:  Daniel Martín via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Steps to reproduce:
>> 
>> emacs -Q
>> C-x C-f emacs/src/xdisp.c RET
>> M-x vc-git-grep RET
>> Perform any search.
>> Place the point over any symbol, for example, char_can_wrap_before.
>> C-u M-x grep
>> 
>> The suggested grep command to confirm is
>> 
>> git --no-pager char_can_wrap_before *.c
>> 
>> which is incorrect, it should be
>> 
>> grep --color=auto -nH --null -e char_can_wrap_before *.c
>
> You are saying that vc-git-grep should use a separate history
> variable?

Yes, that's one possible solution, but it's probably too late to change
that.  Perhaps there should be a configuration option in the vc package
so users can choose to have a separate history variable for git grep.

grep-default-command already tries to extract different parts of the
command using regular expressions.  We could adapt grep-default-command
so that it handles git grep well, but I don't think that'd be a very
clean or future-proof solution.




This bug report was last modified 93 days ago.

Previous Next


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