git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: M Hickford <mirth.hickford@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Suggestion: error "tag ... already exists" should distinguish between tagging different or same commit:
Date: Mon, 09 Jun 2025 11:42:33 -0700	[thread overview]
Message-ID: <xmqqcybcrc2u.fsf@gitster.g> (raw)
In-Reply-To: <CAGJzqsnvTnp3k8Ab2exaBAw5pszQRz00UcucnK=ECtY5vhG+1A@mail.gmail.com> (M. Hickford's message of "Mon, 9 Jun 2025 08:00:00 +0100")

M Hickford <mirth.hickford@gmail.com> writes:

> Hi. Presently, the error "tag ... already exists" doesn't distinguish
> between tagging the same commit or a different commit:
>
>      >git tag hello v1.9.5
>
>      >git tag hello v1.9.5
>      fatal: tag 'hello' already exists
>
>      >git tag hello v2.0.0
>      fatal: tag 'hello' already exists
>
> To inform the user, it would be nice to distinguish these cases, perhaps:
>
>      >git tag hello v1.9.5
>      fatal: tag 'hello' already exists pointing at
> d4e6038a068d0aecd5ec28c83afbfc6d4903092f
>
>      >git tag hello v2.0.0
>      fatal: tag 'hello' already exists but points at
> 18a07354e33f86c8349ffdc300d9087876658264
>
> The second error is typically more concerning than the first.
>
> What do you think?

Not interested.  When the user gets that "fatal" message, the
existing tag did not get modified, so they can just do whatever
check they want (like "git range-diff v1.9.5...hello") themselves.

Besides, in the above examples, is d4e6038a something the user
immediately recognises as the same as v1.9.5 or the object existing
v1.9.5 tag points at?  I somehow doubt it.  So after getting the
error, there needs some digging to figure out how v1.9.5 and
existing hello are related to each other _anyway_, I would think.



  reply	other threads:[~2025-06-09 18:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09  7:00 Suggestion: error "tag ... already exists" should distinguish between tagging different or same commit: M Hickford
2025-06-09 18:42 ` Junio C Hamano [this message]
2025-06-09 19:37   ` Hilco Wijbenga
2025-06-09 20:15     ` Andreas Schwab
2025-06-09 20:19     ` Junio C Hamano
2025-06-09 21:03       ` Hilco Wijbenga
2025-06-10  7:00   ` M Hickford
2025-06-10 14:51     ` Junio C Hamano
2025-07-07 22:24       ` Junio C Hamano
2025-07-07 23:12         ` rsbecker
2025-07-11 19:08           ` Junio C Hamano
2025-07-11 19:10       ` [PATCH] tag: allow idempotent "git tag" without "--force" Junio C Hamano
2025-07-11 20:57         ` Justin Tobler
2025-07-11 21:40           ` 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=xmqqcybcrc2u.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mirth.hickford@gmail.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).