threads / discuss / 36941

Annotated tags by default?

Subject: Annotated tags by default?

## tl;dr

2 messages between Jun 17, 2014 and Jun 17, 2014.

replies: 1people: 2as markdown or json

Robert Dailey· Jun 17, 2014, 20:04 UTC · lore

Is there a config option or some way for `git tag -a` to be the default? I could create an alias but would make more sense to have a config:

git config --global tag.alwaysannotate true
Junio C Hamano· Jun 17, 2014, 21:02 UTC · re: Robert Dailey · lore

Re: Annotated tags by default?

Robert Dailey <rcdailey.lists@gmail.com> writes:
Show 5 quoted lines
> Is there a config option or some way for `git tag -a` to be the
> default? I could create an alias but would make more sense to have a
> config:
>
> git config --global tag.alwaysannotate true

If you really wanted to, you could do the following (and you must to do all of the following):

 * Introduce "git tag --no-annotate" option, that defeats the effect
   of such a configuration variable.
 * Devise some way to reliably catch scripts that use "git tag"
   without saying what kind of tag they want to create.  Add new
   code to issue a warning message saying that the script will be
   horribly broken when user starts using the configuration variable
   that will be introduced in the future.  This will force them to
   be updated to pass the "--no-annotate" option.
 * Wait for several releases to make sure that no script that want
   to use light-weight tags use "git tag" without "--no-annotate"
   option.
 * Introduce the configuration variable.

I personally do not think it is worth it, and also I do not know what that "some way to reliably catch" would look like.

We gave short-and-sweet "-a" and "-s" options exactly because we wanted to make it easy to type them. Also, "tag -m msg" will DWIM to "-a".

← back to recent threads