git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Matheus Tavares <matheus.bernardino@usp.br>,
	git@vger.kernel.org, rhi@pengutronix.de
Subject: Re: [PATCH] describe: output tag's ref instead of embedded name
Date: Tue, 18 Feb 2020 15:28:24 -0800	[thread overview]
Message-ID: <xmqqzhdfh3vr.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqq4kvnijim.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Tue, 18 Feb 2020 15:05:21 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Coming back to the original topic, ...
>
>> If a tag describes a commit, we currently output not the tag's ref but
>> its embedded name. This means that when the tag is locally stored under
>> a different name, the output given cannot be used to access the tag in
>> any way. A warning is also emitted in this case, but the message is not
>> very enlightening:
>
> None of the above is wrong per-se, but the reason why we chose to
> use the real name of the tag in the tag object, while issuing a
> warning, was so that people can correct the mistake of storing an
> annotated tag A to a wrong refname Q.  If "describe" gave a name
> based on refname Q, there is no incentive to correct the situation
> to use the right refname.  The name that describes the commits
> relative to the real name of the A is *not* usable by design, until
> the refname is corrected (i.e. the tag is stored in the right
> place).
>
> So I am not 100% confident that the original patch is a good idea.

FWIW, this design came from 212945d4 ("Teach git-describe to verify
annotated tag names before output", 2008-02-28).  Shawn was quite
explicit that use of the real name was deliberate:

    If an annotated tag describes a commit we want to favor the name
    listed in the body of the tag, rather than whatever name it has
    been stored under locally.  By doing so it is easier to converse
    about tags with others, even if the tags happen to be fetched to
    a different name than it was given by its creator.

and I tend to agree with the original rationale.

  reply	other threads:[~2020-02-18 23:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 14:13 git-describe --tags warning: 'X' is really 'Y' here Roland Hieber
2020-02-05 17:15 ` Matheus Tavares Bernardino
2020-02-14  6:53   ` Jeff King
2020-02-14 16:57     ` Junio C Hamano
2020-02-15 21:34       ` [PATCH] describe: output tag's ref instead of embedded name Matheus Tavares
2020-02-16  6:51         ` Jeff King
2020-02-18 19:31           ` Junio C Hamano
2020-02-18 19:54             ` Jeff King
2020-02-18 23:05               ` Junio C Hamano
2020-02-18 23:28                 ` Junio C Hamano [this message]
2020-02-19  1:57                   ` Jeff King
2020-02-19  3:22                     ` Junio C Hamano
2020-02-19  3:56                       ` Jeff King
2020-02-19 11:14                         ` Junio C Hamano
2020-02-20 11:25                           ` Jeff King
2020-02-20 17:34                             ` Junio C Hamano
2020-02-20 22:19                               ` Matheus Tavares Bernardino
2020-02-20 22:59                                 ` Junio C Hamano
2020-02-21  1:33                                   ` Matheus Tavares
2020-02-21  2:05                                     ` Junio C Hamano
2020-02-21  6:00                                       ` Jeff King
2020-02-21  5:58                               ` Jeff King
2020-02-19 10:08                       ` Roland Hieber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqzhdfh3vr.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    --cc=peff@peff.net \
    --cc=rhi@pengutronix.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).