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

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Nov 2025 09:26:53 -0800

Justin Tobler <[email-masked]> writes:

> or we could maybe move the extended info towards the start of the line
> and leave the remaining bits the same:
>
>   :binary=yy crlf=nn    100644 100644 a1961526 e231acb1 M    foo
>   :binary=nn crlf=yy    100644 100644 31eedd5c 402a70d7 M    bar
>
> With either of these formats, the expectation would be parsers continue
> reading space delimited "key=value" pairs until they encounter a tab. I
> do think this latter format looks a bit nicer and I don't think it would
> meaningfully impact the complexity of the parser. Ultimately, I don't
> feel super strongly one way or the other though. I may go with this last
> format in the next version since it does look a little nicer IMO. I'm
> still very much interested in folks thoughts here though. :)

With this are your parsers/readers still using the output fields
that appear in the --raw output?  Do they still want the mode bits,
or object names in preimage and postimage?  Do they need to even
look at "M" anymore, as a new file or a removed file would certainly
have only a single sign for these additional traits like binary as
such a filepair has only one side by definition?

IOW, I am not sure if it is wise to shoehorn the new pieces of
information into the --raw format.  Existing parsers would not be
able to grok the above at all (they do not even see the fields they
recognise at the beginning of lines which is where they recognise
them as such), so I do not see any good reason to even pretend this
to be some extension to an existing --raw format.