git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
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: Fri, 21 Feb 2020 00:58:51 -0500	[thread overview]
Message-ID: <20200221055851.GE1280313@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq4kvlcgcz.fsf@gitster-ct.c.googlers.com>

On Thu, Feb 20, 2020 at 09:34:36AM -0800, Junio C Hamano wrote:

> > The "-g$objectname" one is kind of clever, and definitely not something
> > I had thought of. We already have "--long", and of course we'd show the
> > long version for any name that isn't an exact match anyway. So as an
> > added bonus, it seems unlikely to surprise anybody who is expecting the
> > current "show the tag, not the refname" output (though again, this is
> > rare enough that I think people simply expect them to be the same ;) ).
> 
> There is one thing you may have brought up in the discussion but I
> did not touch.  Using v1.0-0-g0123456, based on tagname "v1.0" Bob
> gave to it would still describe the right object, but if the user
> forced "--no-long", it becomes unclear what we should do.

I think "--no-long" is not "do not ever write a long name". It is
"counteract an earlier request to _always_ print long names". I.e.:

  $ git describe --no-long v2.25.1^
  v2.25.0-99-g6141e0cc00

still produces long output regardless of your patch. And if we continue
to do so in the wrongly-named case (which your patch seems to), that
would be consistent.

> Another thing that is not satisfying is what should happen in "all"
> mode.  We add "tags/" prefix so in the case we've been discussing,
> the output would be "tags/v1.0-0-g0123456", but the whole reason why
> we add the prefix is to say that the early part of the name, "v1.0",
> is a tag, and it would be natural to associate it with refs/tags/v1.0
> that is *not* Bob's tag.

I agree that is not fantastic, but the same problem is there to some
degree even without the "tags/" prefix. The prefix just makes you think
more of the ref namespace. :) I think it's the best we can do, given
that we'll also have just issued a warning.

Speaking of which...

> Having said all that, here is what I have at this moment.
> [...]
> While at it, remove an overly cautious dead code to protect against
> an annotated tag object without the tagname.  Such a tag is filtered
> out much earlier in the codeflow, and will not reach this part of
> the code.

This patch also reverses the order of the warning from "is really" to
"is externally known as", but I didn't see it mentioned in the commit
message.

-Peff

  parent reply	other threads:[~2020-02-21  5:58 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
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 [this message]
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=20200221055851.GE1280313@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=matheus.bernardino@usp.br \
    --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).