Subject: Re: bug#64140: 29.0.91; C-u M-x grep doesn't work correctly after M-x vc-git-grep

From: Eli Zaretskii <[email-masked]>
Date: Fri, 14 Mar 2025 10:42:35 +0200

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 14 Mar 2025 12:14:57 +0800
> 
> Hello,
> 
> "git --no-pager char_can_wrap_before *.c" doesn't make any sense at all
> -- it's not a valid git command, it's not sensible arguments to 'git
> grep', it's not valid arguments to grep (obviously).

But it could be processed in trivial ways to yield valid "git grep"
arguments, no?  Like this:

  git --no-pager grep char_can_wrap_before -- *.c

> I think that vc-git-grep should use a separate history variable, and I
> don't think it's too late to change it, because it fixes saving this
> nonsensical thing.
> 
> So I'd like to go ahead and do that, if there are no objections.

That could be okay, but is not the most useful way of using Grep
history in git grep commands.  A more useful way would be to allow the
user to reuse Grep history in git grep commands by modifying them to
become valid command lines.  Because I think it would be extremely
useful to be able to run a "git grep" command that searches for the
same pattern as a previous Grep command, and vice versa.