git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bert Wesarg" <bert.wesarg@googlemail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, szeder@ira.uka.de,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH v2] for-each-ref: `:short` format for `refname`
Date: Wed, 3 Sep 2008 10:33:48 +0200	[thread overview]
Message-ID: <36ca99e90809030133r43fc5a3agad1aa38339a758a3@mail.gmail.com> (raw)
In-Reply-To: <7v63pei1pz.fsf@gitster.siamese.dyndns.org>

On Wed, Sep 3, 2008 at 01:10, Junio C Hamano <gitster@pobox.com> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> Tries to shorten the refname to a non-ambiguous name.
>> I.e. the full and the short refname points to the same object.
>
> The definition of "ambiguity" here is wrong (see below).
>
>> +              * by checking all rules in forward direction
>> +              */
>
> I think this part of the code is wrong, in that it talks about what object
> the ref points at.  That is not what ref ambiguity is about.
>
> Given a tag that points at a version 1.0.0 commit, this sequence will
> create:
>
>        $ git tag foo v1.0.0^0
>        $ git branch foo v1.0.0^0
>
> ambiguous branch and tag whose names are both 'foo', even though they
> point at the same thing.  The right API to use would be resolve_ref(), I
> think.
I use resolve_ref():

int read_ref(const char *ref, unsigned char *sha1)
{
	if (resolve_ref(ref, sha1, 1, NULL))
		return 0;
	return -1;
}

Ok, I think I get your point: it doesn't matter if the full and short
point to different objects, it's enough for ambiguity that the short
name resolves to more than one ref.

New patch in reply.

>
> Other than that, it is well done.
>
> Although I was initially a bit surprised by the size of the patch to
> implement something so (conceptually) simple, the code was easy and
> straightforward to follow.
>
> Thanks.
Your welcome.

Bert
>

  reply	other threads:[~2008-09-03  8:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7vprnpbqmo.fsf@gitster.siamese.dyndns.org>
2008-08-31 12:41 ` [PATCH] for-each-ref: `:short` format for `refname` Bert Wesarg
2008-09-01 13:15   ` SZEDER Gábor
2008-09-01 14:13     ` Bert Wesarg
2008-09-01 17:52       ` Bert Wesarg
2008-09-01 19:10         ` Shawn O. Pearce
2008-09-01 21:10           ` Bert Wesarg
2008-09-01 21:28             ` Junio C Hamano
2008-09-01 21:44               ` Bert Wesarg
2008-09-02  7:26                 ` Bert Wesarg
2008-09-02 14:39                   ` Shawn O. Pearce
2008-09-02 21:57                     ` [PATCH v2] " Bert Wesarg
2008-09-02 23:10                       ` Junio C Hamano
2008-09-03  8:33                         ` Bert Wesarg [this message]
2008-09-03  8:42                           ` [PATCH v3] " Bert Wesarg
2008-09-03 15:18                             ` Shawn O. Pearce
2008-09-03 16:33                               ` Bert Wesarg
2008-09-03 16:56                                 ` Bert Wesarg
2008-09-03 18:36                             ` Junio C Hamano
2008-09-05 21:16                               ` [PATCH v4] " Bert Wesarg
2008-09-05 22:20                                 ` Junio C Hamano
2008-09-06 18:16                                   ` Bert Wesarg
2008-09-08 22:57                                 ` Junio C Hamano
2008-09-08 23:04                                   ` Shawn O. Pearce
2008-09-09  6:52                                   ` Bert Wesarg
2008-09-09  8:05                                     ` Junio C Hamano
2008-09-09  8:57                                       ` Bert Wesarg

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=36ca99e90809030133r43fc5a3agad1aa38339a758a3@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    --cc=szeder@ira.uka.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 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).