git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git grep --no-index fails when given an absolute path

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Oct 26, 2023, 12:28 UTC
Message-ID
<3136992f-15f7-4927-83d0-7b7f985244b5@app.fastmail.com>
In-Reply-To
<Nhfa-Qv--F-9@tutanota.com>
Hi
On Thu, Oct 26, 2023, at 12:46, triallax@tutanota.com wrote:
Show 5 quoted lines
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> - Run `git grep --no-index -r -- -- /usr/share/fish/completions/`
See this thread: https://lore.kernel.org/git/CAKFQ_Q_P4HvCMHsg4=6ycb8r44qprhRCGSmLQf7B3_-zy28_oQ@mail.gmail.com/
Show 22 quoted lines
> What did you expect to happen? (Expected behavior)
>
> The command executes the search successfully.
>
> What happened instead? (Actual behavior)
>
> This happens:
>
> triallax@satoru ~> git grep --no-index -r -- -- 
> /usr/share/fish/completions/
> BUG: environment.c:213: git environment hasn't been setup
> fish: Job 1, 'git grep --no-index -r -- -- /u…' terminated by signal 
> SIGABRT (Abort)
>
> What's different between what you expected and what actually happened?
>
> One of them is an error, and the other is a successful execution.
>
> Anything else you want to add:
>
> Interestingly enough, this seems to be happening only with absolute paths from
> my testing, and it happens even when the directory that's passed is a Git repo.

What is the working directory that you are in? I’m guessing somewhere in your home directory?

I’ll try to reproduce your command later with the proposed fix.
Kristoffer
Previous: triallax@tutanota.com
Message 2 of 2 in “git grep --no-index fails when given an absolute path”
  1. triallax@tutanota.comOct 26, 2023
  2. Kristoffer HaugsbakkOct 26, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.