From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 0/2] Slightly prettier reflog message from checkout
Date: Sun, 16 Jun 2013 14:51:52 +0530 [thread overview]
Message-ID: <CALkWK0ki9C9OL36b3j14C-mVMPy07Uj5FXcrfMZJs_g3zBRC9A@mail.gmail.com> (raw)
In-Reply-To: <7vmwqqkftv.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> I view the two codepaths touched by these patches the other way
> around.
I see. Thanks for the early feedback. I have some doubts.
> An abbreviated unique SHA-1 you have today may not be unique
> tomorrow. There is no reason to deliberately lose information
> (e.g. by using "Then, instead of the absolute minimum, let's record
> a bit more bytes" heuristics) when we record. The reflog recording
> code in checkout writes full 40-characters on purpose and there is
> no reason not to do so (i.e. the codepath that is the topic of 2/2).
When did we guarantee that the messages written by the reflog are invariant?
$ git checkout @^
$ git reflog | head -n 1
b1d94f2 HEAD@{2 seconds ago}: checkout: moving from checkout-dash to HEAD^
What does HEAD^ even mean? What guarantees that checkout-dash will
not be something else tomorrow? If you want invariance, isn't that
what the first field is for (b1d94f2)? As I understand it, the
messages are purely to convey end-user information about the
breadcrumb trail: they were later made semi-semantic (like the @{-N}
parser using them).
> Once we accept that design principle of not losing information when
> we do not have to, it naturally follows that the writing side should
> write full 40-hex, and also the reading side (i.e. the codepath that
> is the topic of 1/2) should make sure that it reads 40-hex and
> nothing else. This also reduces the risk of a funny branch name
> that consists only of [0-9a-f] getting mistaken as an object name,
> but that is not the primary point.
As I already explained, I don't know what information loss you're
talking about. And yes, I noticed advice.object_name_warning.
> So I am fairly strongly negative on both changes.
Okay, but please explain it for me.
next prev parent reply other threads:[~2013-06-16 9:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-15 17:38 [PATCH 0/2] Slightly prettier reflog message from checkout Ramkumar Ramachandra
2013-06-15 17:38 ` [PATCH 1/2] sha1_name: stop hard-coding 40-character hex checks Ramkumar Ramachandra
2013-06-16 13:28 ` Phil Hord
2013-06-18 7:03 ` Ramkumar Ramachandra
2013-06-18 14:27 ` Junio C Hamano
2013-06-15 17:38 ` [PATCH 2/2] checkout: do not write full sha1 to reflog Ramkumar Ramachandra
2013-06-15 17:42 ` [PATCH 0/2] Slightly prettier reflog message from checkout Ramkumar Ramachandra
2013-06-16 1:24 ` Junio C Hamano
2013-06-16 9:21 ` Ramkumar Ramachandra [this message]
2013-06-17 2:59 ` Junio C Hamano
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=CALkWK0ki9C9OL36b3j14C-mVMPy07Uj5FXcrfMZJs_g3zBRC9A@mail.gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).