From: Michael J Gruber <git@drmicha•warpmail.net>
To: Junio C Hamano <gitster@pobox•com>
Cc: "Nathan W. Panike" <nathan.panike@gmail•com>, git@vger•kernel.org
Subject: Re: Looking for a way to turn off/modify ref disambiguation
Date: Wed, 24 Aug 2011 11:25:07 +0200 [thread overview]
Message-ID: <4E54C373.1070702@drmicha.warpmail.net> (raw)
In-Reply-To: <7vei0brdiq.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 24.08.2011 00:03:
> "Nathan W. Panike" <nathan.panike@gmail•com> writes:
>
>> 1. If $GIT_DIR/<name> exists, that is what you mean
>> (this is usually useful only for HEAD, FETCH_HEAD, ORIG_HEAD,
>> MERGE_HEAD and CHERRY_PICK_HEAD);
>> 2. otherwise, refs/<name> if it exists;
>> 3. otherwise, refs/tags/<refname> if it exists;
>> 4. otherwise, refs/heads/<name> if it exists;
>> 5. otherwise, refs/remotes/<name> if it exists;
>> 6. otherwise, refs/remotes/<name>/HEAD if it exists.
>> ...
>>
>> Is there any way to change this behavior, e.g., so that rule 6 becomes
>> an error?
>
> You will force people to say "git log origin/master..master" to measure
> their progress if you did so, when "git log origin..master" has been the
> way described in many git books and documentation pages floating on the
> web.
I haven't come across advice like that. In our own documentation, we
don't explain it, and in our user-manual "origin" is used as the name of
a branch.
I consider that advice very bad indeed:
If "origin..master" is resolved to "master ^origin/master", then
obviously "origin..next" is resolved to "next ^origin/next" - but it is
not, of course, and the fact that "origin" is resolved to
"origin/master" depends on the content of "origin/HEAD", which the
upstream repo owner controls (in the sense that upstream's HEAD
determines it), not downstream.
Thus, teaching "origin..master" as a way of measuring your progress is
grossly misleading. "@{u}.." does that when you're on the branch in
question, and we have no notation for "@{u(master)}..master".
Side note:
In fact, who groks symbolic refs anyway? I mean, git-reset sets HEAD and
git-checkout does so, right? ;)
(I'm afraid I need to clean up after myself in git-reset(1)...)
> I think it is _very_ unlikely that such a change is going to happen.
If messing with the origin..master notation is the only fall-out I'm all
for it.
But note that the OP only asked for a way to turn off disambiguation,
not for a change of defaults..
Michael
next prev parent reply other threads:[~2011-08-24 9:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-23 19:26 Looking for a way to turn off/modify ref disambiguation Nathan W. Panike
2011-08-23 21:15 ` Jeff King
2011-08-23 22:03 ` Junio C Hamano
2011-08-24 9:25 ` Michael J Gruber [this message]
2011-08-24 16:37 ` Jonathan Nieder
2011-08-24 17:48 ` Junio C Hamano
2011-08-24 6:54 ` Clemens Buchacher
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=4E54C373.1070702@drmicha.warpmail.net \
--to=git@drmicha$(echo .)warpmail.net \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=nathan.panike@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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