git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 11, 2025, 19:08 UTC
Message-ID
<xmqq34b21r6h.fsf@gitster.g>
In-Reply-To
<00ca01dbef94$b155f380$1401da80$@nexbridge.com>
<rsbecker@nexbridge.com> writes:
Show 7 quoted lines
> Considering that git tag T O will generally require a git push
> --force and always a git pull --force in order to update tags on
> the upstream and receiving an update to the tag locally, I think
> requiring git tag --force T O when O is different from the current
> tag is a reasonable idea from a consistency standpoint. I do
> support the notion of git tag T O not requiring a --force if O is
> already where the tag is pointing.
Yup, that is essentially the idea behind that patch.
> The only counter case I can really see in this is when -s is used
> to allow the sign to be updated but even then, does --force really
> change anything when only signing (I think not) because O does not
> change.

In "git tag -s T O" (or "-a" for that matter), O may not change, but the resulting tag object would certainly be different from the object that is pointed at by the existing tag reference T, due to tagger identity and the message in the tag being different from the original. So even without O changing ...

> If O changes when signing, I think that --force is almost
> essential to avoid messing up the signatures.
... we would require --force and that would be a good thing.
Previous: rsbecker@nexbridge.comNext: Junio C Hamano
Message 11 of 14 in “Suggestion: error "tag ... already exists" should distinguish between tagging different or same commit:”
  1. M HickfordJun 9, 2025
  2. Junio C HamanoJun 9, 2025
  3. Hilco WijbengaJun 9, 2025
  4. Andreas SchwabJun 9, 2025
  5. Junio C HamanoJun 9, 2025
  6. Hilco WijbengaJun 9, 2025
  7. M HickfordJun 10, 2025
  8. Junio C HamanoJun 10, 2025
  9. Junio C HamanoJul 7, 2025
  10. rsbecker@nexbridge.comJul 7, 2025
  11. Junio C HamanoJul 11, 2025
  12. tag: allow idempotent "git tag" without "--force"Junio C Hamano, Jul 11, 2025
  13. Justin ToblerJul 11, 2025
  14. Junio C HamanoJul 11, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.