request-pull: use the annotated tag contents

The integrator tool will start allowing to pull a signed or an annotated
tag, i.e.

    $ git pull $there tags/for-linus

and the description in the tag is used to convey a meaningful message from
the lieutenant to the integrator to justify the history being pulled.

Include the message in the pull request e-mail, as the same information is
useful in this context, too. It would encourage the lieutenants to write
meaningful messages in their signed tags.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2011-11-09 05:05:00 -08:00
parent 90a321c04c
commit d050464541
2 changed files with 18 additions and 0 deletions

View File

@@ -48,6 +48,8 @@ then
fi fi
fi fi
tag_name=$(git describe --exact "$head^0" 2>/dev/null)
test -n "$base" && test -n "$url" || usage test -n "$base" && test -n "$url" || usage
baserev=$(git rev-parse --verify "$base"^0) && baserev=$(git rev-parse --verify "$base"^0) &&
headrev=$(git rev-parse --verify "$head"^0) || exit headrev=$(git rev-parse --verify "$head"^0) || exit
@@ -82,8 +84,20 @@ then
echo "(from the branch description for $branch local branch)" echo "(from the branch description for $branch local branch)"
echo echo
git config "branch.$branch_name.description" git config "branch.$branch_name.description"
fi &&
if test -n "$tag_name"
then
git cat-file tag "$tag_name" |
sed -n -e '1,/^$/d' -e '/^-----BEGIN PGP /q' -e p
echo
fi &&
if test -n "$branch_name" || test -n "$tag_name"
then
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
fi && fi &&
git shortlog ^$baserev $headrev && git shortlog ^$baserev $headrev &&
git diff -M --stat --summary $patch $merge_base..$headrev || status=1 git diff -M --stat --summary $patch $merge_base..$headrev || status=1

View File

@@ -86,6 +86,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '
s/$downstream_url_for_sed/URL/g s/$downstream_url_for_sed/URL/g
s/for-upstream/BRANCH/g s/for-upstream/BRANCH/g
s/mnemonic.txt/FILENAME/g s/mnemonic.txt/FILENAME/g
s/^version [0-9]/VERSION/
/^ FILENAME | *[0-9]* [-+]*\$/ b diffstat /^ FILENAME | *[0-9]* [-+]*\$/ b diffstat
/^AUTHOR ([0-9]*):\$/ b shortlog /^AUTHOR ([0-9]*):\$/ b shortlog
p p
@@ -200,6 +201,9 @@ test_expect_success 'pull request format' '
SUBJECT (DATE) SUBJECT (DATE)
----------------------------------------------------------------
VERSION
---------------------------------------------------------------- ----------------------------------------------------------------
SHORTLOG SHORTLOG