git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: Git grep -f reads the filename relative to the repository root
@ 2023-10-12 12:38 Erik Cervin Edin
  2023-10-12 17:28 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Cervin Edin @ 2023-10-12 12:38 UTC (permalink / raw)
  To: Git Mailing List

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)

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.

What happened instead? (Actual behavior)

Git grep -f reads the filename, relative to the Git root and searches
for lines matching `tig` in the xdiff directory.

What's different between what you expected and what actually happened?

The file that Git grep uses for patterns is read relative to the root
of the Git repository, and not the current directory.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.42.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27
02:56:13 UTC 2023 x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-31  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 12:38 Bug: Git grep -f reads the filename relative to the repository root Erik Cervin Edin
2023-10-12 17:28 ` Junio C Hamano
2023-10-30 21:58   ` Taylor Blau
2023-10-31  0:49     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).