All of lore.kernel.org
 help / color / mirror / Atom feed
* git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default)
@ 2013-07-24 10:17 Daniele Segato
  2013-07-24 20:34 ` Junio C Hamano
  0 siblings, 1 reply; 23+ messages in thread
From: Daniele Segato @ 2013-07-24 10:17 UTC (permalink / raw)
  To: Git Mailing List

Hi,

I think there is an issue with the documentation of git tag, or with the 
default being chosen for tags.

the git tag documentation say:

*****
        If one of -a, -s, or -u <key-id> is passed, the command creates 
a tag object, and requires a tag message. Unless -m <msg> or -F <file> 
is given, an editor is started for the user to type in the tag
        message.

        If -m <msg> or -F <file> is given and -a, -s, and -u <key-id> 
are absent, -a is implied.

        Otherwise just a tag reference for the SHA1 object name of the 
commit object is created (i.e. a lightweight tag).
******

And no options below is provided to list annotated tags only or 
lightweight tags only (is there a way to do so?)

I initially didn't get git cared too much on this difference: I've been 
using both annotated and lightweight tags without distinctions, 
annotated when I want to write something about the tag and non-annotated 
when I do not need it.

Since no option is given to show annotated only tags these made sense to me.



Recently I started using submodules and I noticed that:
git submodule status

sometimes gave me the tag name of the submodule between parentesis and 
sometimes it gave me something like this:
+6903774653de52d0206e0e6026ca6914def8a333 submodule (1.0-2-g6903774)

even if the 6903774653de52d0206e0e6026ca6914def8a333 was actually a tag 
(1.1)

the git help submodule say status use git describe, so I've entered the 
submodule directory and tried:

$ git describe
1.0-2-g6903774

$ git describe --tags
1.1

reading the git help describe I discovered the git describe made an 
assumption and default to just show annotated tags.


To me, this assumption should have been documented very clearly in the 
git tag help page, something like this:

*****
        If one of -a, -s, or -u <key-id> is passed, the command creates 
a tag object, and requires a tag message. Unless -m <msg> or -F <file> 
is given, an editor is started for the user to type in the tag
        message.

        If -m <msg> or -F <file> is given and -a, -s, and -u <key-id> 
are absent, -a is implied.

        Otherwise just a tag reference for the SHA1 object name of the 
commit object is created (i.e. a lightweight tag).


        ANNOTATED vs LIGHTWEIGHT tags

        Some git command (ex. git describe) by default only consider 
annotated tags. Annotated and Lightweight tags are not the same thing 
for git and you shouldn't mix them up. Annotated tags are meant for 
release while lightweight tags are meant to tag random commits.
******

And I think an option in git tag to only show annotated tags (or only 
show lightweight tags) is needed.



Finally, now that I discovered this I can't replace the lightweights 
tags with annotated tags without a public announcement requiring all 
developers to delete their local tags.

I'm not aware of any discussion you did about this matter but I think 
there's something wrong here that should be fixed.

Regards,
Daniele Segato

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-08-07 12:33 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 10:17 git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default) Daniele Segato
2013-07-24 20:34 ` Junio C Hamano
2013-07-25 13:45   ` [PATCH] git-tag man: when to use lightweight or annotated tags Daniele Segato
2013-07-25 14:47     ` Marc Branchaud
2013-07-26  8:44       ` Daniele Segato
2013-07-26  8:46         ` Daniele Segato
2013-07-26 14:51           ` Marc Branchaud
2013-07-26 17:19             ` Daniele Segato
2013-07-26 17:33               ` [PATCHv3] " Daniele Segato
2013-07-26 19:06                 ` Jeff King
2013-07-26 19:36                   ` Jonathan Nieder
2013-07-29 18:02                     ` Daniele Segato
2013-08-07 12:32                       ` Daniele Segato
2013-07-26 21:13                   ` Marc Branchaud
2013-07-29 15:04                     ` Junio C Hamano
2013-07-29 18:20                       ` Daniele Segato
2013-07-27 10:39                   ` Daniele Segato
2013-07-27 11:26                     ` Philip Oakley
2013-07-27 11:45                       ` Stefan Beller
2013-07-29 18:16                         ` Daniele Segato
2013-07-26 21:13               ` [PATCH] " Marc Branchaud
2013-07-29 18:21                 ` Daniele Segato
2013-07-25 13:48   ` git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default) Daniele Segato

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.