git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 29, 2018, 07:22 UTC
Message-ID
<xmqq5zwgny9d.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqa7lsnyu5.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
>> +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 piece.

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.

Previous: Junio C HamanoNext: Thomas Braun
Message 9 of 30 in “Teach log -G to ignore binary files”
  1. 0/2 Teach log -G to ignore binary filesThomas Braun, Nov 21, 2018
  2. 1/2 log -G: Ignore binary filesThomas Braun, Nov 21, 2018
  3. 2/2 log -S: Add test which searches in binary filesThomas Braun, Nov 21, 2018
  4. 0/2 Teach log -G to ignore binary filesThomas Braun, Nov 21, 2018
  5. log -G: Ignore binary filesThomas Braun, Nov 28, 2018
  6. Ævar Arnfjörð BjarmasonNov 28, 2018
  7. Thomas BraunDec 14, 2018
  8. Junio C HamanoNov 29, 2018
  9. Junio C HamanoNov 29, 2018
  10. Thomas BraunDec 14, 2018
  11. Thomas BraunDec 14, 2018
  12. log -G: ignore binary filesThomas Braun, Dec 14, 2018
  13. Junio C HamanoDec 26, 2018
  14. Junio C HamanoNov 22, 2018
  15. Thomas BraunNov 28, 2018
  16. Ævar Arnfjörð BjarmasonNov 22, 2018
  17. Junio C HamanoNov 24, 2018
  18. Thomas BraunNov 28, 2018
  19. Junio C HamanoNov 22, 2018
  20. Thomas BraunNov 28, 2018
  21. Ævar Arnfjörð BjarmasonNov 22, 2018
  22. Jeff KingNov 22, 2018
  23. Thomas BraunNov 28, 2018
  24. Thomas BraunNov 28, 2018
  25. Jeff KingNov 22, 2018
  26. Junio C HamanoNov 24, 2018
  27. Thomas BraunNov 28, 2018
  28. Stefan BellerNov 26, 2018
  29. Junio C HamanoNov 27, 2018
  30. Thomas BraunNov 28, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.