git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-tag man: when to use lightweight or annotated tags

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Jul 25, 2013, 14:47 UTC
Message-ID
<51F13A8F.9040400@xiplink.com>
In-Reply-To
<51F12BE6.80606@gmail.com>
On 13-07-25 09:45 AM, Daniele Segato wrote:
Show 25 quoted lines
> From d0f4eca712e7cf74286bfab306763a8a571b6c95 Mon Sep 17 00:00:00 2001
> From: Daniele Segato <daniele.segato@gmail.com>
> Date: Thu, 25 Jul 2013 15:33:18 +0200
> Subject: [PATCH] git-tag man: when to use lightweight or annotated tags
> 
> stress the difference between the two with suggestion on when the user
> should use one in place of the other.
> 
> Signed-off-by: Daniele Segato <daniele.segato@gmail.com>
> ---
>  Documentation/git-tag.txt |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
> index 22894cb..48f5504 100644
> --- a/Documentation/git-tag.txt
> +++ b/Documentation/git-tag.txt
> @@ -36,6 +36,10 @@ are absent, `-a` is implied.
>  Otherwise just a tag reference for the SHA-1 object name of the commit
> object is
>  created (i.e. a lightweight tag).
> 
> +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.

Unfortunately the word "annotated" hasn't yet been introduced at this point, so the overall effect is even more confusing. Also, I find the "release" vs. "random" distinction a bit misleading since both types of tag can refer to any object. I also liked the direction of your earlier "command only consider annotated tags by default" phrasing.

After reading the Tagging section of the Git Book[1] I came up with the following. Feel free to modify it as you like, or ignore it completely:

Tag objects (created with -a) are called annotated tags. While a lightweight tag is simply a name for an object (usually a commit object), an annotated tag contains the creation date, the tagger's name and e-mail, a tagging message, and can be signed and verified with GNU Privacy Guard (GnuPG). Most git commands only consider annotated tags by default. In general lightweight tags are for private or temporary object labels, while annotated tags are meant to be permanent and/or published. For example, an annotated tag is normally used to identify a release point.

		M.
[1] http://git-scm.com/book/en/Git-Basics-Tagging
Previous: Daniele SegatoNext: Daniele Segato
Message 4 of 23 in “git tag usability issue: Lightweight vs Annotated confusion for the end user (ex. git describe default)”
  1. Daniele SegatoJul 24, 2013
  2. Junio C HamanoJul 24, 2013
  3. git-tag man: when to use lightweight or annotated tagsDaniele Segato, Jul 25, 2013
  4. Marc BranchaudJul 25, 2013
  5. Daniele SegatoJul 26, 2013
  6. Daniele SegatoJul 26, 2013
  7. Marc BranchaudJul 26, 2013
  8. Daniele SegatoJul 26, 2013
  9. Daniele SegatoJul 26, 2013
  10. Jeff KingJul 26, 2013
  11. Jonathan NiederJul 26, 2013
  12. Daniele SegatoJul 29, 2013
  13. Daniele SegatoAug 7, 2013
  14. Marc BranchaudJul 26, 2013
  15. Junio C HamanoJul 29, 2013
  16. Daniele SegatoJul 29, 2013
  17. Daniele SegatoJul 27, 2013
  18. Philip OakleyJul 27, 2013
  19. Stefan BellerJul 27, 2013
  20. Daniele SegatoJul 29, 2013
  21. Marc BranchaudJul 26, 2013
  22. Daniele SegatoJul 29, 2013
  23. Daniele SegatoJul 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.