All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Justin Tobler <jltobler@gmail.com>,
	 git@vger.kernel.org, karthik.188@gmail.com
Subject: Re: [RFC PATCH] diff: add option to report binary files in raw diffs
Date: Fri, 07 Nov 2025 08:07:52 -0800	[thread overview]
Message-ID: <xmqq7bw1hllz.fsf@gitster.g> (raw)
In-Reply-To: <20251107083015.GA18670@tb-raspi4> ("Torsten Bögershausen"'s message of "Fri, 7 Nov 2025 09:30:15 +0100")

Torsten Bögershausen <tboegi@web.de> writes:

> git ls-files --eol option someone (Junio ?) convinced my to
> use a TAB as a seperator.
> In this case just before the filename:
>
> git ls-file --eol | xxd 
> 00000000: 692f 6c66 2020 2020 772f 6c66 2020 2020  i/lf    w/lf    
> 00000010: 6174 7472 2f20 2020 2020 2020 2020 2020  attr/           
> 00000020: 2020 2020 2020 092e 6369 7272 7573 2e79        ..cirrus.y
>                          ^^
> 00000030: 6d6c 0a                                   ml.
>
> This makes the output both human readable and machine parsable:
> All info is before the TAB here. (And may be parsed again in a second
> round, if needed).
> Thoughts ?

This brings up another interesting question: which command should
learn these new classifications.

The original desire "when I diff A and B, I cannot tell which one of
A or B had binary when I see 'binary file differs'" almost suggests
to me that 'diff' is a wrong place and rather they wanted to know "I
have A; now who is binary in there?"  Or "when I diff A and B with
pathspec P, I cannot tell..." is probably a wrong question to ask,
and the question may be "I have A; now who is binary in that tree
within pathspec P?"

IOW, "git show" or "git log", when showing a commit C in the
history, would give "that one is a binary" information as if it is
an attribute of the change between commit C and its parents, if you
tuck this new logic into the "diff" machinery.  I am not sure if
that is what we really want.  If we do so in "ls-tree" and allow
"git log" to show characteristics of each tree it encounters while
traversing the history, on the other hand, "that one is a binary"
would truly become an attribute of an entry in a tree, and it is not
affected by what is in the trees of the commits that are adjacent to
the commit in the history.

  reply	other threads:[~2025-11-07 16:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  2:14 [RFC PATCH] diff: add option to report binary files in raw diffs Justin Tobler
2025-11-04  2:26 ` Junio C Hamano
2025-11-04  4:44   ` Junio C Hamano
2025-11-05  0:17     ` Justin Tobler
2025-11-05  8:04       ` Junio C Hamano
2025-11-06 21:42         ` Justin Tobler
2025-11-07  8:30           ` Torsten Bögershausen
2025-11-07 16:07             ` Junio C Hamano [this message]
2025-11-07 17:16             ` Justin Tobler
2025-11-07 17:26               ` Junio C Hamano
2025-11-05 12:14       ` Ben Knoble
2025-11-06 21:52         ` Justin Tobler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7bw1hllz.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.