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

Re: [PATCH v3] log -G: ignore binary files

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 26, 2018, 23:24 UTC
Message-ID
<xmqqlg49mmus.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<f7cb34c6268f556772fa4ee374e2541ba518e2b8.1544811828.git.thomas.braun@virtuell-zuhause.de>
Thomas Braun <thomas.braun@virtuell-zuhause.de> writes:
Show 11 quoted lines
> - The internally used algorithm for generating patch text is based on
>   xdiff and its states in [1]
>
>   > The output format of the binary patch file is proprietary
>   > (and binary) and it is basically a collection of copy and insert
>   > commands [..]
>
>   which means that the current format could change once the internal
>   algorithm is changed as the format is not standardized. In addition
>   the git binary patch format used for preparing patches for git apply
>   is *different* from the xdiff format as can be seen by comparing

This particular argument sounds like a red herring. After all, when the --text option is given

Show 18 quoted lines
>
>   git log -p -a
>
>     commit 6e95bf4bafccf14650d02ab57f3affe669be10cf
>     Author: A U Thor <author@example.com>
>     Date:   Thu Apr 7 15:14:13 2005 -0700
>
>         modify binary file
>
>     diff --git a/data.bin b/data.bin
>     index f414c84..edfeb6f 100644
>     --- a/data.bin
>     +++ b/data.bin
>     @@ -1,2 +1,4 @@
>      a
>      a^@a
>     +a
>     +a^@a

we will see 'a' in the output no matter how xdiff internally works; there is no way to express the above change textually without showing "+a" somewhere in the patch output.

The rest of the log message looks good, and ...
Show 7 quoted lines
> Changes since v2:
>  - Introduce a setup step for the new tests 
>  - Really start with a clean history in the tests
>  - Added more complex commit history for the tests
>  - Use test_when_finished for cleanup instead of doing nothing
>  - Enhanced commit message to motivate the change better
>  - Added some more documentation
... the tests are certainly a lot easier to follow.
Thanks.
Previous: Thomas BraunNext: Junio C Hamano
Message 13 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.