Re: Bug: Git grep -f reads the filename relative to the repository root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 12, 2023 at 10:28:16AM -0700, Junio C Hamano wrote:
> Erik Cervin Edin <erik@xxxxxxxxxxx> writes:
>
> > In the Git repository, I ran
> >
> >     echo tig > pattern-file &&
> >         echo git > xdiff/pattern-file &&
> >         cd xdfiff &&
> >         git grep -f pattern-file
> >
> > What did you expect to happen? (Expected behavior)
> >
> > Git grep -f to read the pattern-file, in the xdiff directory and
> > search for lines matching `git` in the xdiff directory.
>
> That does sound like a bug.  It should use the original directory as
> the base of the relative path computation, similar to the way how
> OPT_FILENAME() options are handled.
>
> Perhaps something along this line, but this is not even compile
> tested yet.

Just going through old mail that I didn't have a chance to respond to,
the proposed patch that you included here does compile and pass t7810
for me, and the fix looks reasonable as-is. I don't think I see this
patch on master, but would have no objections to you merging it down.

Thanks,
Taylor




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux