From: Junio C Hamano <gitster@pobox•com>
To: Eric Sunshine <sunshine@sunshineco•com>
Cc: Rickard Andersson <rickard.a1992@gmail•com>, git@vger•kernel.org
Subject: Re: git grep bug replacing - with :
Date: Fri, 14 Jun 2024 14:05:24 -0700 [thread overview]
Message-ID: <xmqqbk43dyln.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cRGnAcfpr4JWp9WWC0b4yvjKx-_0up_S2iaXCBxgcSLjQ@mail.gmail.com> (Eric Sunshine's message of "Fri, 14 Jun 2024 15:36:58 -0400")
Eric Sunshine <sunshine@sunshineco•com> writes:
> On Fri, Jun 14, 2024 at 3:22 PM Rickard Andersson
> <rickard.a1992@gmail•com> wrote:
>> What did you do before the bug happened? (Steps to reproduce your issue)
>> Added 2 files to my repo with words in them
>> text-file.txt
>> text-file-file.txt
>> ```
>> git grep -l ExtremelyInterestingWord
>> ```
>>
>> What happened instead? (Actual behavior)
>> I get
>> ```
>> text:file.txt
>> text:file-file.txt
>> ```
If the command line were "git grep -l <pattern> text", and there is
a branch whose name is "text", and in the top level tree of that
"text" branch's commit there are file.txt and file-file.txt both of
which have the pattern, the symptom observed may appear.
But ...
> I am unable to reproduce this problem:
>
> $ git version
> git version 2.45.2
> $ git init foo
> Initialized empty Git repository in .../foo/.git/
> $ cd foo
> $ echo ExtremelyInterestingWord >text-file.txt
> $ echo ExtremelyInterestingWord >text-file-file.txt
> $ git add text-file.txt text-file-file.txt
> $ git commit -m msg
> [main (root-commit) 765269f] msg
> 2 files changed, 2 insertions(+)
> create mode 100644 text-file-file.txt
> create mode 100644 text-file.txt
> $ git grep -l ExtremelyInterestingWord
> text-file-file.txt
> text-file.txt
... with your (i.e. Eric's) reproduction setup, which agrees with
the way how I interpreted the problem description in the original
report, I do not see there is any other possible output from it.
Thanks.
next prev parent reply other threads:[~2024-06-14 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 19:21 git grep bug replacing - with : Rickard Andersson
2024-06-14 19:36 ` Eric Sunshine
2024-06-14 21:05 ` Junio C Hamano [this message]
2024-06-15 10:21 ` Rickard Andersson
2024-06-15 16:36 ` Eric Sunshine
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqbk43dyln.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=rickard.a1992@gmail$(echo .)com \
--cc=sunshine@sunshineco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox