bump2version
bump2version copied to clipboard
Handling custom tag messages with Git
There's currently no support for creating annotated tags in Git without specifying the message. The git tag -a
option will create an annotated tag and open the editor to write the tag message. This is useful when you may want to include a multiline message such as a change log. To do this currently, I have to use bumpversion and then overwrite the tag manually with Git.
I see it as an annotate_tags
option that would be ignored for Mercurial repos, and override the default tag message, calling git tag -a
instead of git tag -m
. I'm happy to work on implementing this, but I wanted to check here first to make sure that it would be acceptable.
git-tag has a fairly new argument, '--edit'.
Perhaps it's easier to add that rather than to strip out the existing -m argument.
The --edit
option is certainly nicer. It was introduced earlier this year in git 2.17. Are we worried about backwards portability here? Debian stable, for example, is still on git 2.11 - users would have to install a backport or upgrade to testing to be able to use this feature.
I wonder if it's ugly to have some value for the message that it'd always prompt. For example on an empty string it'd pass -a
instead of -m
. On the other hand, users could be relying on that.
You could use [annotate_interactive]
as the special string?
I was thinking about that or EDIT
but it might be a bit too magical.
On the other hand, this feature request can be solved by "allowing arbitrary arguments to git tag command", which sounds very similar to PR #47 ("allow arbitrary arguments to git commit command").
Agree with @florisla, would rather not support another feature unless it's part of a more general design: "arbitrary args to git-tag and git-commit".
If somebody were to implement this, it should be similar to #47.
Hello there 👋
I would like to have a stab at this, getting inspiration from what has been done in #47. Is it something still wanted/relevant?