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
Justin Tobler <jltobler@gmail.com>
Date
Nov 6, 2025, 21:52 UTC
Message-ID
<id5zny6t4cr5eaow4ttvdmaksywazvgraq56m2x3wviw3rij7v@fhjfhva5favl>
In-Reply-To
<D80AE9D4-EE8D-4CAE-9212-2A592F45AB90@gmail.com>
On 25/11/05 07:14AM, Ben Knoble wrote:
Show 12 quoted lines
> 
> > Le 4 nov. 2025 à 19:17, Justin Tobler <jltobler@gmail.com> a écrit :
> > Also, maybe this info could be on a newline following each raw diff
> > entry? Something like:
> > 
> >  :100644 100644 a1961526 e231acb1 M    foo
> >  binary=yy
> >  :100644 100644 31eedd5c 402a70d7 M    bar
> >  binary=nn
> > 
> 
> Whether combined or separate, self-documenting output is nice. Separate might be easier for line-oriented tools? Having to split on commas and loop looking for keywords seems like more work than just processing a line at a time. Idk.

Ya, I'm also a bit torn on whether a single line or multiple lines would be best. I'm currently leaning back towards using just a single line as I do think it is somewhat nice that each diff entry itself is on its own line. Ultimately from the perspective of the parser, I don't think it should matter too much whether its splits raw-extended output on a command or newline.

In the next version, I'm thinking the output will look something like:
  $ git diff-tree --raw-extended=binary,crlf ...
  :100644 100644 a1961526 e231acb1 binary=yy,crlf=nn M  foo
  :100644 100644 31eedd5c 402a70d7 binary=nn,crlf=yy M  bar

Thanks, -Justin

Previous: Ben Knoble
Message 12 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.