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

[PATCH 2/4] update-hook: show the contents of the tag message for annotated tags

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 20, 2007, 10:58 UTC
Message-ID
<200703201058.38519.andyparkins@gmail.com>

The annotated tag points at a commit, for which we show the short log. However, the tag itself contains a message, possibly release notes or hand-written change log - whatever it contains is worth showing. The tag message is extracted with

  git cat-file tag $newrev | tail -q -n +5

Which is dangerously reliant on the format of the tag object being four header lines then the message. I don't like it, but I don't know of any other way of extracting the message. It's also missing any kind of support for the GPG signature.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 templates/hooks--update |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index 1a60773..31e72ca 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -231,8 +231,14 @@ case "$refname_type" in
 
 		echo ""
 		echo $LOGBEGIN
-		echo ""
 
+		# Show the content of the tag message; this might contain a change log
+		# or release notes so is worth displaying.  "tail -n +5" is there to
+		# remove the first 4 lines of the tag object, those details have
+		# already been summarised above
+		git cat-file tag $newrev | tail -q -n +5
+
+		echo ""
 		if [ -n "$prevtag" ]; then
 			git rev-list --pretty=short "$prevtag..$newrev" | git shortlog
 		else
-- 
1.5.0.3.402.g0c48
Next: Martin Waitz
Message 1 of 4 in “update-hook: show the contents of the tag message for annotated tags”
  1. 2/4 update-hook: show the contents of the tag message for annotated tagsAndy Parkins, Mar 20, 2007
  2. Martin WaitzMar 20, 2007
  3. Andy ParkinsMar 20, 2007
  4. Shawn O. PearceMar 20, 2007

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.