* [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags
@ 2007-03-20 10:58 Andy Parkins
2007-03-20 12:41 ` Martin Waitz
0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2007-03-20 10:58 UTC (permalink / raw)
To: git
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags
2007-03-20 10:58 [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags Andy Parkins
@ 2007-03-20 12:41 ` Martin Waitz
2007-03-20 15:27 ` Andy Parkins
0 siblings, 1 reply; 4+ messages in thread
From: Martin Waitz @ 2007-03-20 12:41 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
hoi :)
On Tue, Mar 20, 2007 at 10:58:38AM +0000, Andy Parkins wrote:
> 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 think you can split at the blank line after the header.
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags
2007-03-20 12:41 ` Martin Waitz
@ 2007-03-20 15:27 ` Andy Parkins
2007-03-20 15:36 ` Shawn O. Pearce
0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2007-03-20 15:27 UTC (permalink / raw)
To: git; +Cc: Martin Waitz
On Tuesday 2007 March 20 12:41, Martin Waitz wrote:
> > Which is dangerously reliant on the format of the tag object being four
> > header lines then the message.
>
> I think you can split at the blank line after the header.
That's a good idea; I can't think of an efficient way of doing that in shell
script though. What I need is a
grep --everything-after "^$"
:-)
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags
2007-03-20 15:27 ` Andy Parkins
@ 2007-03-20 15:36 ` Shawn O. Pearce
0 siblings, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2007-03-20 15:36 UTC (permalink / raw)
To: Andy Parkins; +Cc: git, Martin Waitz
Andy Parkins <andyparkins@gmail.com> wrote:
> On Tuesday 2007 March 20 12:41, Martin Waitz wrote:
>
> > > Which is dangerously reliant on the format of the tag object being four
> > > header lines then the message.
> >
> > I think you can split at the blank line after the header.
>
> That's a good idea; I can't think of an efficient way of doing that in shell
> script though. What I need is a
>
> grep --everything-after "^$"
sed -e '1,/^$/d'
Portable too. ;-)
--
Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-20 15:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-20 10:58 [PATCH 2/4] update-hook: show the contents of the tag message for annotated tags Andy Parkins
2007-03-20 12:41 ` Martin Waitz
2007-03-20 15:27 ` Andy Parkins
2007-03-20 15:36 ` Shawn O. Pearce
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 NNTP newsgroup(s).