{"thread":{"id":"61633","subject":"git grep bug replacing - with :","startedAt":"2024-06-14T19:22:17Z","lastAt":"2024-06-15T16:36:45Z","messageCount":5,"participants":["Rickard Andersson","Eric Sunshine","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"497189","messageId":"CALyzih__9sZD31SVMECcxk55+MAMjkfgpLzecoHo0xUoauerqA@mail.gmail.com","threadId":"61633","inReplyTo":null,"subject":"git grep bug replacing - with :","fromName":"Rickard Andersson","fromEmail":"rickard.a1992@gmail.com","sentAt":"2024-06-14T19:21:40Z","receivedAt":"2024-06-14T19:22:17Z","isPatch":false,"sender":{"key":"rickard.a1992@gmail.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   Added 2 files to my repo with words in them\n   text-file.txt\n   text-file-file.txt\n\n   I did a git grep for said words that exists in both, and used\nargument `-l` to only\n   show matching filename\n   ```\n   git grep -l ExtremelyInterestingWord\n   ```\n\nWhat did you expect to happen? (Expected behavior)\n   I expected to get the following output\n   ```\n   text-file.txt\n   text-file-file.txt\n   ```\n\nWhat happened instead? (Actual behavior)\n   I get\n   ```\n   text:file.txt\n   text:file-file.txt\n   ```\n\n\nWhat's different between what you expected and what actually happened?\n   It seems that when using the argument `-l` the first `-` in a filename is\n   replaced with a `:`. It also seems that it is just the first one as the\n   second file keeps it's second occurence of `-`.\n\nAnything else you want to add:\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n[System Info]\ngit version:\ngit version 2.34.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC\nTue May  7 09:00:52 UTC 2 x86_64\ncompiler info: gnuc: 11.4\nlibc info: glibc: 2.35\n$SHELL (typically, interactive shell): /usr/bin/zsh\n"},{"id":"497195","messageId":"CAPig+cRGnAcfpr4JWp9WWC0b4yvjKx-_0up_S2iaXCBxgcSLjQ@mail.gmail.com","threadId":"61633","inReplyTo":"CALyzih__9sZD31SVMECcxk55+MAMjkfgpLzecoHo0xUoauerqA@mail.gmail.com","subject":"Re: git grep bug replacing - with :","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-06-14T19:36:58Z","receivedAt":"2024-06-14T19:37:10Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 14, 2024 at 3:22 PM Rickard Andersson\n<rickard.a1992@gmail.com> wrote:\n> What did you do before the bug happened? (Steps to reproduce your issue)\n>    Added 2 files to my repo with words in them\n>    text-file.txt\n>    text-file-file.txt\n>    ```\n>    git grep -l ExtremelyInterestingWord\n>    ```\n>\n> What happened instead? (Actual behavior)\n>    I get\n>    ```\n>    text:file.txt\n>    text:file-file.txt\n>    ```\n\nI am unable to reproduce this problem:\n\n    $ git version\n    git version 2.45.2\n    $ git init foo\n    Initialized empty Git repository in .../foo/.git/\n    $ cd foo\n    $ echo ExtremelyInterestingWord >text-file.txt\n    $ echo ExtremelyInterestingWord >text-file-file.txt\n    $ git add text-file.txt text-file-file.txt\n    $ git commit -m msg\n    [main (root-commit) 765269f] msg\n     2 files changed, 2 insertions(+)\n     create mode 100644 text-file-file.txt\n     create mode 100644 text-file.txt\n    $ git grep -l ExtremelyInterestingWord\n    text-file-file.txt\n    text-file.txt\n"},{"id":"497198","messageId":"xmqqbk43dyln.fsf@gitster.g","threadId":"61633","inReplyTo":"CAPig+cRGnAcfpr4JWp9WWC0b4yvjKx-_0up_S2iaXCBxgcSLjQ@mail.gmail.com","subject":"Re: git grep bug replacing - with :","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-06-14T21:05:24Z","receivedAt":"2024-06-14T21:05:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Fri, Jun 14, 2024 at 3:22 PM Rickard Andersson\n> <rickard.a1992@gmail.com> wrote:\n>> What did you do before the bug happened? (Steps to reproduce your issue)\n>>    Added 2 files to my repo with words in them\n>>    text-file.txt\n>>    text-file-file.txt\n>>    ```\n>>    git grep -l ExtremelyInterestingWord\n>>    ```\n>>\n>> What happened instead? (Actual behavior)\n>>    I get\n>>    ```\n>>    text:file.txt\n>>    text:file-file.txt\n>>    ```\n\nIf the command line were \"git grep -l <pattern> text\", and there is\na branch whose name is \"text\", and in the top level tree of that\n\"text\" branch's commit there are file.txt and file-file.txt both of\nwhich have the pattern, the symptom observed may appear.\n\nBut ...\n\n> I am unable to reproduce this problem:\n>\n>     $ git version\n>     git version 2.45.2\n>     $ git init foo\n>     Initialized empty Git repository in .../foo/.git/\n>     $ cd foo\n>     $ echo ExtremelyInterestingWord >text-file.txt\n>     $ echo ExtremelyInterestingWord >text-file-file.txt\n>     $ git add text-file.txt text-file-file.txt\n>     $ git commit -m msg\n>     [main (root-commit) 765269f] msg\n>      2 files changed, 2 insertions(+)\n>      create mode 100644 text-file-file.txt\n>      create mode 100644 text-file.txt\n>     $ git grep -l ExtremelyInterestingWord\n>     text-file-file.txt\n>     text-file.txt\n\n... with your (i.e. Eric's) reproduction setup, which agrees with\nthe way how I interpreted the problem description in the original\nreport, I do not see there is any other possible output from it.\n\nThanks.\n"},{"id":"497207","messageId":"CALyzih-5qtezCnizj07Gi0MyoeweXU1Kw5-gnv7YwSg0DC965w@mail.gmail.com","threadId":"61633","inReplyTo":"xmqqbk43dyln.fsf@gitster.g","subject":"Re: git grep bug replacing - with :","fromName":"Rickard Andersson","fromEmail":"rickard.a1992@gmail.com","sentAt":"2024-06-15T10:21:30Z","receivedAt":"2024-06-15T10:22:07Z","isPatch":false,"sender":{"key":"rickard.a1992@gmail.com","avatar":null},"body":"Hello,\n\nKudos for the very quick response times, nice!\n\nI tried to reproduce this in a more isolated way and did Eric's setup\nwhere the issue was reproduced again. However, I realized I should\ntest this without my gitconfig and could then isolate the issue to the\npager delta. I then noticed the issue is reported there already:\nhttps://github.com/dandavison/delta/issues/1674.\n\nSo this is clearly not an issue in git, I should have tried without my\ngitconfig before even sending this bugreport so I hope I didn't\ntake too much of your time.\n\nBest regards,\nRickard\n\nOn Fri, 14 Jun 2024 at 23:05, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n>\n> > On Fri, Jun 14, 2024 at 3:22 PM Rickard Andersson\n> > <rickard.a1992@gmail.com> wrote:\n> >> What did you do before the bug happened? (Steps to reproduce your issue)\n> >>    Added 2 files to my repo with words in them\n> >>    text-file.txt\n> >>    text-file-file.txt\n> >>    ```\n> >>    git grep -l ExtremelyInterestingWord\n> >>    ```\n> >>\n> >> What happened instead? (Actual behavior)\n> >>    I get\n> >>    ```\n> >>    text:file.txt\n> >>    text:file-file.txt\n> >>    ```\n>\n> If the command line were \"git grep -l <pattern> text\", and there is\n> a branch whose name is \"text\", and in the top level tree of that\n> \"text\" branch's commit there are file.txt and file-file.txt both of\n> which have the pattern, the symptom observed may appear.\n>\n> But ...\n>\n> > I am unable to reproduce this problem:\n> >\n> >     $ git version\n> >     git version 2.45.2\n> >     $ git init foo\n> >     Initialized empty Git repository in .../foo/.git/\n> >     $ cd foo\n> >     $ echo ExtremelyInterestingWord >text-file.txt\n> >     $ echo ExtremelyInterestingWord >text-file-file.txt\n> >     $ git add text-file.txt text-file-file.txt\n> >     $ git commit -m msg\n> >     [main (root-commit) 765269f] msg\n> >      2 files changed, 2 insertions(+)\n> >      create mode 100644 text-file-file.txt\n> >      create mode 100644 text-file.txt\n> >     $ git grep -l ExtremelyInterestingWord\n> >     text-file-file.txt\n> >     text-file.txt\n>\n> ... with your (i.e. Eric's) reproduction setup, which agrees with\n> the way how I interpreted the problem description in the original\n> report, I do not see there is any other possible output from it.\n>\n> Thanks.\n"},{"id":"497215","messageId":"CAPig+cS0LhojBYtc9rEDo0Twb+1yjLy5fodCPOF6++1gmx2MWQ@mail.gmail.com","threadId":"61633","inReplyTo":"CALyzih-5qtezCnizj07Gi0MyoeweXU1Kw5-gnv7YwSg0DC965w@mail.gmail.com","subject":"Re: git grep bug replacing - with :","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-06-15T16:36:33Z","receivedAt":"2024-06-15T16:36:45Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jun 15, 2024 at 6:22 AM Rickard Andersson\n<rickard.a1992@gmail.com> wrote:\n> I tried to reproduce this in a more isolated way and did Eric's setup\n> where the issue was reproduced again. However, I realized I should\n> test this without my gitconfig and could then isolate the issue to the\n> pager delta. I then noticed the issue is reported there already:\n> https://github.com/dandavison/delta/issues/1674.\n>\n> So this is clearly not an issue in git, I should have tried without my\n> gitconfig before even sending this bugreport so I hope I didn't\n> take too much of your time.\n\nThe benefit of having posted here is that there is now a record of it\nin the Git mail archive, which may benefit the next person who\nencounters the issue (if that person searches the archive). Moreover,\nthose who followed this thread are now better equipped to point future\nreporters at the Delta bug report you cited.\n"}]}