Web lists-archives.com

Re: [PATCH v2] log -G: Ignore binary files

Junio C Hamano <gitster@xxxxxxxxx> writes:

>> +test_expect_success 'log -G ignores binary files' '
>> +	git checkout --orphan orphan1 &&
>> +	printf "a\0a" >data.bin &&
>> +	git add data.bin &&
>> +	git commit -m "message" &&
>> +	git log -Ga >result &&
>> +	test_must_be_empty result
>> +'
> As this is the first mention of data.bin, this is adding a new file
> data.bin that has two 'a' but is a binary file.  And that is the
> only commit in the history leading to orphan1.
> The fact that "log -Ga" won't find any means it missed the creation
> event, because the blob is binary.  Good.

By the way, this root commit records another file whose path is
"file" and has "Picked<LF>" in it.  If the file had 'a' in it, it
would have been included in "git log" output, but that is too subtle
a point to be noticed by the readers who are only reading this patch
without seeing what has been done to the index before this test

If you are going to restructure these tests to create a three-commit
history in a single expect_success that is inspected with various
"log -Ga" invocations in subsequent tests, it is worth removing that
other file (or rather, starting with "read-tree --empty" immediately
after checking out the orphan branch, to clarify to the readers that
there is nothing but what you add in the set-up step in the index)
to make the test more robust.