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

From: Junio C Hamano <[email-masked]>
Date: Wed, 05 Nov 2025 00:04:00 -0800

Justin Tobler <[email-masked]> writes:

> Maybe the output should be something like:
>
>   binary=tt,incomplete=ic,crlf=cl
>
> or something along those lines. That way we could freely extend in the
> future without having to worry about a specific order. If we think all
> of the raw diff extension modes would only report with yes/no for each
> file we could just do:
>
>   binary=yn,incomplete=yy,crlf=nn
>
> but maybe we should be more flexible and leave it up to the mode to
> decide what its values can be?
>
> 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

I know these are parse-able, but quite honestly, both sounds
somewhat backwards, if you meant to make this easier to parse by
simple scripts.  Scripts do not mind their input line wider than 80
columns, but it is cumbersome if they have to take each pair of
lines and combine them to process.  And repeated keywords like
binary= etc., do not look like it is less error prone for scripts to
parse them out, either.  So, I dunno.