{"thread":{"id":"60433","subject":"git grep --no-index fails when given an absolute path","startedAt":"2023-10-26T10:46:51Z","lastAt":"2023-10-26T12:29:06Z","messageCount":2,"participants":["triallax@tutanota.com","Kristoffer Haugsbakk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483913","messageId":"Nhfa-Qv--F-9@tutanota.com","threadId":"60433","inReplyTo":null,"subject":"git grep --no-index fails when given an absolute path","fromName":"","fromEmail":"triallax@tutanota.com","sentAt":"2023-10-26T10:46:47Z","receivedAt":"2023-10-26T10:46:51Z","isPatch":false,"sender":{"key":"triallax@tutanota.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n- Run `git grep --no-index -r -- -- /usr/share/fish/completions/`\n\nWhat did you expect to happen? (Expected behavior)\n\nThe command executes the search successfully.\n\nWhat happened instead? (Actual behavior)\n\nThis happens:\n\ntriallax@satoru ~> git grep --no-index -r -- -- /usr/share/fish/completions/\nBUG: environment.c:213: git environment hasn't been setup\nfish: Job 1, 'git grep --no-index -r -- -- /u…' terminated by signal SIGABRT (Abort)\n\nWhat's different between what you expected and what actually happened?\n\nOne of them is an error, and the other is a successful execution.\n\nAnything else you want to add:\n\nInterestingly enough, this seems to be happening only with absolute paths from\nmy testing, and it happens even when the directory that's passed is a Git repo.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.42.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.5.8_1 #1 SMP PREEMPT_DYNAMIC Fri Oct 20 13:35:41 UTC 2023 x86_64\ncompiler info: gnuc: 12.2\nlibc info: glibc: 2.36\n$SHELL (typically, interactive shell): /bin/dash\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n\n"},{"id":"483915","messageId":"3136992f-15f7-4927-83d0-7b7f985244b5@app.fastmail.com","threadId":"60433","inReplyTo":"Nhfa-Qv--F-9@tutanota.com","subject":"Re: git grep --no-index fails when given an absolute path","fromName":"Kristoffer Haugsbakk","fromEmail":"code@khaugsbakk.name","sentAt":"2023-10-26T12:28:17Z","receivedAt":"2023-10-26T12:29:06Z","isPatch":false,"sender":{"key":"code@khaugsbakk.name","avatar":"https://avatars.githubusercontent.com/u/2229597?v=4"},"body":"Hi\n\nOn Thu, Oct 26, 2023, at 12:46, triallax@tutanota.com wrote:\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> - Run `git grep --no-index -r -- -- /usr/share/fish/completions/`\n\nSee this thread: https://lore.kernel.org/git/CAKFQ_Q_P4HvCMHsg4=6ycb8r44qprhRCGSmLQf7B3_-zy28_oQ@mail.gmail.com/\n\n> What did you expect to happen? (Expected behavior)\n>\n> The command executes the search successfully.\n>\n> What happened instead? (Actual behavior)\n>\n> This happens:\n>\n> triallax@satoru ~> git grep --no-index -r -- -- \n> /usr/share/fish/completions/\n> BUG: environment.c:213: git environment hasn't been setup\n> fish: Job 1, 'git grep --no-index -r -- -- /u…' terminated by signal \n> SIGABRT (Abort)\n>\n> What's different between what you expected and what actually happened?\n>\n> One of them is an error, and the other is a successful execution.\n>\n> Anything else you want to add:\n>\n> Interestingly enough, this seems to be happening only with absolute paths from\n> my testing, and it happens even when the directory that's passed is a Git repo.\n\nWhat is the working directory that you are in? I’m guessing somewhere in\nyour home directory?\n\nI’ll try to reproduce your command later with the proposed fix.\n\nKristoffer\n"}]}