From: Daniele Segato <daniele.segato@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default)
Date: Wed, 24 Jul 2013 12:17:13 +0200 [thread overview]
Message-ID: <51EFA9A9.4010103@gmail.com> (raw)
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
next reply other threads:[~2013-07-24 10:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 10:17 Daniele Segato [this message]
2013-07-24 20:34 ` git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default) 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
-- strict thread matches above, loose matches on Subject: below --
2013-07-24 19:09 Jonathon Mah
2013-07-24 20:37 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51EFA9A9.4010103@gmail.com \
--to=daniele.segato@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).