From: Junio C Hamano <gitster@pobox.com>
To: "Ping Yin" <pkufranky@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/3] fix "diff --raw" on the work tree side
Date: Sun, 02 Mar 2008 09:48:02 -0800 [thread overview]
Message-ID: <7vlk51nhkd.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <46dff0320803020915u565ce50eraa663f9e5a795b81@mail.gmail.com> (Ping Yin's message of "Mon, 3 Mar 2008 01:15:55 +0800")
"Ping Yin" <pkufranky@gmail.com> writes:
> On 3/3/08, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> I do not think re-introducing the inconsistency like the third one does is
>> a palatable option.
>>
>> Wouldn't grabbing (cd $submodule && git rev-parse HEAD) yourself be more
>> portable across git before and after the bugfix of "git diff --raw"?
>
> OK, i will parse it myself
Just to clarify, I am somewhat torn on [3/3].
We can certainly re-introduce the special casing for submodule across diff
family consistently, but the rationale for doing that would be "The real
object name is very cheaply available in that case so why not show it."
That line of thinking would lead to re-hashing of symbolic link blobs as I
hinted in the message, but then it would also mean we would show
inconsistent output between a symlink that points at foo.c and a regular
file whose content is foo.c (without the trailing LF), the latter of which
would still show 0{40}, and we will eventually end up saying "Let's
re-hash small regular file blobs."
That would lead to inconsistencies between smaller and larger regular file
blobs, and the line between them is drawn at an arbitrary size limit. The
logical conclusion of this would be to re-hash everything when showing
"diff --raw" (and "diff-anything --raw").
Which may turn out not to be such a bad thing after all, and we might even
end up doing exactly that in future releases, although I highly doubt it.
In any case, such a huge semantics change takes time to get right.
People's scripts in the wild know 0{40} with non 0 mode in the raw format
means it refers to an entity in the work tree (which is a correct thing to
assume), but the convention has been used for the entire lifetime of git
and they can (arguably incorrectly) be assuming that the inverse is also
true (i.e. work tree entity is represented as 0{40} with non 0 mode).
And the point is that "submodule summary" can be useful without waiting
for the conclusion of the above confusion caused by the can of worms [3/3]
opens. If we decide to always show the real object name for work tree
entities in the future, we might want to update the implementation of
"submodule summary" to _take advantage of it_, but by starting the new
feature not to depend on the current misbehaviour, we can try it out much
earlier.
prev parent reply other threads:[~2008-03-02 17:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-02 9:43 [PATCH 0/3] fix "diff --raw" on the work tree side Junio C Hamano
2008-03-02 9:43 ` [PATCH 1/3] diff-lib.c: constness strengthening Junio C Hamano
2008-03-02 9:43 ` [PATCH 2/3] diff: make sure work tree side is shown as 0{40} when different Junio C Hamano
2008-03-02 9:43 ` [PATCH 3/3] diff: show submodule object name when available even on the work tree side Junio C Hamano
2008-03-02 10:41 ` [PATCH 0/3] fix "diff --raw" " Ping Yin
2008-03-02 17:11 ` Junio C Hamano
2008-03-02 17:15 ` Ping Yin
2008-03-02 17:48 ` Junio C Hamano [this message]
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=7vlk51nhkd.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pkufranky@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).