Re: Suggestion: error "tag ... already exists" should distinguish between tagging different or same commit:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clearly, I have not used everything that "git tag" offers. :-)

So, to clarify, I was thinking (naively?) that Git would check that
the tag as requested is _exactly_ the same as the existing tag. Only
_that_ specific scenario would then not fail.

On Mon, Jun 9, 2025 at 1:19 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Hilco Wijbenga <hilco.wijbenga@xxxxxxxxx> 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?".





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux