git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug report: git grep seems to use the wrong .gitattributes when invoked in a subdirectory
@ 2013-05-23 12:44 Joel Kaasinen
  2013-05-23 15:49 ` René Scharfe
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Kaasinen @ 2013-05-23 12:44 UTC (permalink / raw)
  To: git

Greetings,

I bumped into a problem where git grep thinks files in repo/a/data are
binary files when it is invoked from repo/a and
repo/data/.gitattributes contains "* binary".

I can reproduce this on 1.7.9.5 and 1.7.10.4. Unfortunately I don't
have a newer version at hand.

How to reproduce:

[pseudo:~/tmp]% git --version
git version 1.7.10.4
[pseudo:~/tmp]% git init git-test
Initialized empty Git repository in /home/opqdonut/tmp/git-test/.git/
[pseudo:~/tmp]% cd git-test
[pseudo:~/tmp/git-test:master()]% mkdir -p a/data
[pseudo:~/tmp/git-test:master()]% mkdir data
[pseudo:~/tmp/git-test:master()]% echo '* binary' > data/.gitattributes
[pseudo:~/tmp/git-test:master()]% echo foo > a/data/foo
[pseudo:~/tmp/git-test:master()]% git add -A
[pseudo:~/tmp/git-test:master()]% git commit -m "foo"
[master (root-commit) 20fafbb] foo
 2 files changed, 1 insertion(+)
 create mode 100644 a/data/foo
 create mode 100644 data/.gitattributes
[pseudo:~/tmp/git-test:master()]% git grep foo
a/data/foo:foo
[pseudo:~/tmp/git-test:master()]% cd a
[pseudo:~/tmp/git-test/a:master()]% git grep foo
Binary file data/foo matches

(Please CC me on replies, I'm not subscribed to the list.)

--
Joel Kaasinen
joel.kaasinen@gmail.com

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

* Re: Bug report: git grep seems to use the wrong .gitattributes when invoked in a subdirectory
  2013-05-23 12:44 Bug report: git grep seems to use the wrong .gitattributes when invoked in a subdirectory Joel Kaasinen
@ 2013-05-23 15:49 ` René Scharfe
  0 siblings, 0 replies; 2+ messages in thread
From: René Scharfe @ 2013-05-23 15:49 UTC (permalink / raw)
  To: Joel Kaasinen; +Cc: git, Nguyễn Thái Ngọc Duy

Am 23.05.2013 14:44, schrieb Joel Kaasinen:
> [pseudo:~/tmp]% git --version
> git version 1.7.10.4
> [pseudo:~/tmp]% git init git-test
> Initialized empty Git repository in/home/opqdonut/tmp/git-test/.git/
> [pseudo:~/tmp]% cd git-test
> [pseudo:~/tmp/git-test:master()]% mkdir -p a/data
> [pseudo:~/tmp/git-test:master()]% mkdir data
> [pseudo:~/tmp/git-test:master()]% echo '* binary' > data/.gitattributes
> [pseudo:~/tmp/git-test:master()]% echo foo > a/data/foo
> [pseudo:~/tmp/git-test:master()]% git add -A
> [pseudo:~/tmp/git-test:master()]% git commit -m "foo"
> [master (root-commit) 20fafbb] foo
>   2 files changed, 1 insertion(+)
>   create mode 100644 a/data/foo
>   create mode 100644 data/.gitattributes
> [pseudo:~/tmp/git-test:master()]% git grep foo
> a/data/foo:foo
> [pseudo:~/tmp/git-test:master()]% cd a
> [pseudo:~/tmp/git-test/a:master()]% git grep foo
> Binary file data/foo matches

Just checked, with git 1.8.2.3 the last command shows a matching line.

The issue has probably been fixed by 55c6168 (grep: stop looking at 
random places for .gitattributes).  The lowest release with that patch 
is git 1.8.0.1.

René

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

end of thread, other threads:[~2013-05-23 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 12:44 Bug report: git grep seems to use the wrong .gitattributes when invoked in a subdirectory Joel Kaasinen
2013-05-23 15:49 ` René Scharfe

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).