{"thread":{"id":"56880","subject":"Feature request: Ability to edit existing tag's message","startedAt":"2021-11-12T15:05:59Z","lastAt":"2021-11-12T16:21:49Z","messageCount":2,"participants":["Eyal Rozenberg","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"440983","messageId":"04cbce68-bcbd-dbb2-5d9d-df7dd464fa03@gmx.com","threadId":"56880","inReplyTo":null,"subject":"Feature request: Ability to edit existing tag's message","fromName":"Eyal Rozenberg","fromEmail":"eyalroz1@gmx.com","sentAt":"2021-11-12T15:05:55Z","receivedAt":"2021-11-12T15:05:59Z","isPatch":false,"sender":{"key":"eyalroz1@gmx.com","avatar":null},"body":"At the moment, one has to go through some hoops to edit a tag's message;\nsee discussions here:\n\nhttps://stackoverflow.com/q/7813194/1593077\n\nIt would be nice if:\n\n    git tag --edit my_tag_name\n\nwould bring up the editor with the existing text of my_tag_name's\nmessage, for amendment. And, perhaps,\n\n    git tag --edit my_tag_name -m \"new message\"\n\nwould overwrite the existing message. I've suggested `--edit` since the\nswitch already exists, but if you like a different bikeshed then it\ncould be --amend like git commit --amend.\n\n\nJust my 2 cents and have a nice day,\nEyal Rozenberg\n\n\nPS - I'm not on this mailing list, so if you want to reply, please use\nmy actual address.\n"},{"id":"440989","messageId":"211112.86fss1uyxy.gmgdl@evledraar.gmail.com","threadId":"56880","inReplyTo":"04cbce68-bcbd-dbb2-5d9d-df7dd464fa03@gmx.com","subject":"Re: Feature request: Ability to edit existing tag's message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-11-12T16:08:54Z","receivedAt":"2021-11-12T16:21:49Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Nov 12 2021, Eyal Rozenberg wrote:\n\n> At the moment, one has to go through some hoops to edit a tag's message;\n> see discussions here:\n>\n> https://stackoverflow.com/q/7813194/1593077\n>\n> It would be nice if:\n>\n>    git tag --edit my_tag_name\n>\n> would bring up the editor with the existing text of my_tag_name's\n> message, for amendment. And, perhaps,\n>\n>    git tag --edit my_tag_name -m \"new message\"\n>\n> would overwrite the existing message. I've suggested `--edit` since the\n> switch already exists, but if you like a different bikeshed then it\n> could be --amend like git commit --amend.\n>\n>\n> Just my 2 cents and have a nice day,\n> Eyal Rozenberg\n>\n>\n> PS - I'm not on this mailing list, so if you want to reply, please use\n> my actual address.\n\nYes, these should be an easier way to do that.\n\nIn the meantime it seems a lot of those suggestions on Stack Overflow\nare way too complex, since they're struggling to maintain all the tag\nmetadata as-is, an easier way is:\n\n    git cat-file tag <tag-name> | sed s/foo/bar/g | git mktag\n\nWhich will create and print out the OID of a tag object, if nothing is\nchanged the OID is the same, then just:\n\n    git tag <tag-name> <that-oid>\n\nWhere you'll need a --force if the <tag-name> is the same.\n\nIt's not as \"safe\" as e.g. \"git commit --amend\", as you can edit the raw\nheaders, but for people who want this that may be a feature most of the\ntime.\n\nIt will also preserve the inline PGP signature, which if you make any\nedits to the tag won't verify anymore.\n\nIt also looks like a lot of those SO answers pre-date my not-so-recent\nchanges to \"fetch\" where we'll by default error if any existing tags\nwould be clobbered.\n\nSo you can do this, but there's a reason for why it's not\nimplemented. I.e. you really don't want to edit existing tags in the\ngeneral case.\n\nBut I can see how it's useful if you've not pushed it out, or if\nchanging it is OK in your environment even if it was pushed out.\n"}]}