git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Hilco Wijbenga <hilco.wijbenga@gmail.com>
Cc: M Hickford <mirth.hickford@gmail.com>,
	 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 13:19:41 -0700	[thread overview]
Message-ID: <xmqqqzzspt0i.fsf@gitster.g> (raw)
In-Reply-To: <CAE1pOi34+btHyV8GbjpFPcJ+2ixu59ce4eAE=Q7F4JEcuJyXnw@mail.gmail.com> (Hilco Wijbenga's message of "Mon, 9 Jun 2025 12:37:41 -0700")

Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:

> Does it really make sense for that first example to fail, though? "git
> tag hello v1.9.5" is an idempotent operation, isn't it? The second
> attempt is a no-op?
>
> If "git tag ..." simply does nothing if the tag already exists (as
> requested) then that would make the OP's issue go away: only the 2nd
> example would fail.

I do not think I personally mind that direction; when I responded, I
thought that in the example, 'hello' is initially pointing at
something entirely different (perhaps v2.0.0), though.

But it may be tricky to do, though.

It is easy for lightweight tags, but you'd have to fail an attempt
to add an annotated and/or signed tag without -f anyway, so you have
to be prepared to answer "why does this behave differently with and
without -a/-s?".

  parent reply	other threads:[~2025-06-09 20:19 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
2025-06-09 19:37   ` Hilco Wijbenga
2025-06-09 20:15     ` Andreas Schwab
2025-06-09 20:19     ` Junio C Hamano [this message]
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=xmqqqzzspt0i.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=hilco.wijbenga@gmail.com \
    --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).