unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Rupert Swarbrick <ruperts@broadcom.com>
Cc: 19944@debbugs.gnu.org
Subject: bug#19944: 25.0.50; vc-git-grep doesn't use grep-read-files correctly
Date: Thu, 03 Dec 2020 12:50:14 +0100	[thread overview]
Message-ID: <87y2ifqfbd.fsf@gnus.org> (raw)
In-Reply-To: <889lhjmb4pg.fsf@broadcom.com> (Rupert Swarbrick's message of "Wed, 25 Feb 2015 11:39:23 +0000")

Rupert Swarbrick <ruperts@broadcom.com> writes:

> The vc-git-grep function uses grep-read-files to figure out the list of
> files to check. This gets glued to the end of the git grep command
> line. With the default value of grep-files-aliases, if the user enters
> "all" for their files, grep-read-files returns the string "* .*".
>
> If you do the following:
>
>    cd /path/to/my/git/repo
>    git grep foo -- * .*
>
> then you get something like:
>
>   /path/to/my/git/repo> git grep foo -- * .*
>   fatal: ..: '..' is outside repository
>
> because .* expands to a list including "..".

(This bug report unfortunately got no response at the time.)

Looks like this has been fixed in more recent versions of Emacs.  Trying
this, I get:

git --no-pager grep -n --color -i -e emacs -- \* .\[\!.\]\* ..\?\*

and everything works are it should, I think.

> We're also doing the wrong thing when the user gives a pattern. For
> example, if I go into the top-level Emacs directory and run
>
>   M-x vc-git-grep
>
> enter vc-git-grep as the string to search for and enter *g* for the
> files to search, then I get:
>
>   Grep started at Wed Feb 25 11:17:28
>
>   git --no-pager grep -n -e vc-git-grep -- *g*

This, too -- I get:

git --no-pager grep -n --color -i -e emacs -- \*g\*

So I'm guessing this has been fixed, and I'm closing this bug report.
If there's still a problem here, please respond to the debbugs address,
and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2020-12-03 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 11:39 bug#19944: 25.0.50; vc-git-grep doesn't use grep-read-files correctly Rupert Swarbrick
2020-12-03 11:50 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2ifqfbd.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=19944@debbugs.gnu.org \
    --cc=ruperts@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).