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