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

Re: [RFC PATCH] diff: add option to report binary files in raw diffs

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 4, 2025, 02:26 UTC
Message-ID
<xmqqa512sfcj.fsf@gitster.g>
In-Reply-To
<20251104021455.379807-1-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 6 quoted lines
> I have a usecase where I would like to know exactly which files in a
> diff pair are considered binary by Git when computing diffs. When
> computing patch diff output, Git already omits filepair diffs where at
> least one side is considered binary and prints a "binary files differ"
> message instead. From this message we cannot discern exactly which files
> were considered binary by Git though.

I have a usecase where I would like to know exactly which side of a diff filepair ends in an incomplete line in a concise format.

Should we add yet another column to the raw output to indicate who is complete and who is incomplete?

Where does it lead us and when will it stop?
IOW, yuck ;-).
Show 12 quoted lines
> In this patch, the raw diff format is extended with a
> `--report-binary-files` option to explicitly specify which files in the
> diff pair were considered binary. The output in this form looks
> something like this:
>
>         $ git diff-tree --abbrev=8 --report-binary-files HEAD~ HEAD
>         :100644 100644 a1961526 e231acb1 bt M	foo
>         :100644 100644 31eedd5c 402a70d7 bb M	bar
>
> With this format, there is a new column before the status that specifies
> the binary status for each file. 'b' indicates binary and 't' is used
> otherwise.

How will would this extend beyond 2-way diffs, I wonder. Should

    $ git show -c --report-binary <a merge>
show [bt]{3} instead of [bt]{2} before the change status letter?
Previous: Justin ToblerNext: Junio C Hamano
Message 2 of 12 in “diff: add option to report binary files in raw diffs”
  1. diff: add option to report binary files in raw diffsJustin Tobler, Nov 4, 2025
  2. Junio C HamanoNov 4, 2025
  3. Junio C HamanoNov 4, 2025
  4. Justin ToblerNov 5, 2025
  5. Junio C HamanoNov 5, 2025
  6. Justin ToblerNov 6, 2025
  7. Torsten BögershausenNov 7, 2025
  8. Junio C HamanoNov 7, 2025
  9. Justin ToblerNov 7, 2025
  10. Junio C HamanoNov 7, 2025
  11. Ben KnobleNov 5, 2025
  12. Justin ToblerNov 6, 2025

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.