{"thread":{"id":"7331","subject":"[PATCH 2/4] update-hook: show the contents of the tag message for annotated tags","startedAt":"2007-03-20T10:58:38Z","lastAt":"2007-03-20T15:36:48Z","messageCount":4,"participants":["Andy Parkins","Martin Waitz","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"37616","messageId":"200703201058.38519.andyparkins@gmail.com","threadId":"7331","inReplyTo":null,"subject":"[PATCH 2/4] update-hook: show the contents of the tag message for annotated tags","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-20T10:58:38Z","receivedAt":"2007-03-20T10:58:38Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"The annotated tag points at a commit, for which we show the short log.\nHowever, the tag itself contains a message, possibly release notes or\nhand-written change log - whatever it contains is worth showing.  The\ntag message is extracted with\n\n  git cat-file tag $newrev | tail -q -n +5\n\nWhich is dangerously reliant on the format of the tag object being four\nheader lines then the message.  I don't like it, but I don't know of any\nother way of extracting the message.  It's also missing any kind of\nsupport for the GPG signature.\n\nSigned-off-by: Andy Parkins <andyparkins@gmail.com>\n---\n templates/hooks--update |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/templates/hooks--update b/templates/hooks--update\nindex 1a60773..31e72ca 100644\n--- a/templates/hooks--update\n+++ b/templates/hooks--update\n@@ -231,8 +231,14 @@ case \"$refname_type\" in\n \n \t\techo \"\"\n \t\techo $LOGBEGIN\n-\t\techo \"\"\n \n+\t\t# Show the content of the tag message; this might contain a change log\n+\t\t# or release notes so is worth displaying.  \"tail -n +5\" is there to\n+\t\t# remove the first 4 lines of the tag object, those details have\n+\t\t# already been summarised above\n+\t\tgit cat-file tag $newrev | tail -q -n +5\n+\n+\t\techo \"\"\n \t\tif [ -n \"$prevtag\" ]; then\n \t\t\tgit rev-list --pretty=short \"$prevtag..$newrev\" | git shortlog\n \t\telse\n-- \n1.5.0.3.402.g0c48\n"},{"id":"37618","messageId":"20070320124154.GB22773@admingilde.org","threadId":"7331","inReplyTo":"200703201058.38519.andyparkins@gmail.com","subject":"Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-03-20T12:41:54Z","receivedAt":"2007-03-20T12:41:54Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Tue, Mar 20, 2007 at 10:58:38AM +0000, Andy Parkins wrote:\n>   git cat-file tag $newrev | tail -q -n +5\n> \n> Which is dangerously reliant on the format of the tag object being four\n> header lines then the message.\n\nI think you can split at the blank line after the header.\n\n-- \nMartin Waitz\n"},{"id":"37625","messageId":"200703201527.15476.andyparkins@gmail.com","threadId":"7331","inReplyTo":"20070320124154.GB22773@admingilde.org","subject":"Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-20T15:27:11Z","receivedAt":"2007-03-20T15:27:11Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 March 20 12:41, Martin Waitz wrote:\n\n> > Which is dangerously reliant on the format of the tag object being four\n> > header lines then the message.\n>\n> I think you can split at the blank line after the header.\n\nThat's a good idea; I can't think of an efficient way of doing that in shell \nscript though.  What I need is a \n\n grep --everything-after \"^$\"\n\n:-)\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"37626","messageId":"20070320153648.GC1750@spearce.org","threadId":"7331","inReplyTo":"200703201527.15476.andyparkins@gmail.com","subject":"Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-03-20T15:36:48Z","receivedAt":"2007-03-20T15:36:48Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> wrote:\n> On Tuesday 2007 March 20 12:41, Martin Waitz wrote:\n> \n> > > Which is dangerously reliant on the format of the tag object being four\n> > > header lines then the message.\n> >\n> > I think you can split at the blank line after the header.\n> \n> That's a good idea; I can't think of an efficient way of doing that in shell \n> script though.  What I need is a \n> \n>  grep --everything-after \"^$\"\n\n\tsed -e '1,/^$/d'\n\nPortable too.  ;-)\n\n-- \nShawn.\n"}]}