summaryrefslogtreecommitdiff
path: root/git-request-pull.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-20 22:52:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-05 21:51:26 (GMT)
commitc0168147831fce00975949213eef3471b7a2b76b (patch)
treebb79939b9e1e34adc35237ff1a502e59088a1984 /git-request-pull.sh
parentcf7316663e2ae459591bc52f0a1c91c3a684e48b (diff)
downloadgit-c0168147831fce00975949213eef3471b7a2b76b.zip
git-c0168147831fce00975949213eef3471b7a2b76b.tar.gz
git-c0168147831fce00975949213eef3471b7a2b76b.tar.bz2
request-pull: use the branch description
Now we have branch descriptions stored in the repository, we can use it when preparing the request-pull message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-request-pull.sh')
-rwxr-xr-xgit-request-pull.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 438e7eb..626cf25 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -35,7 +35,18 @@ do
shift
done
-base=$1 url=$2 head=${3-HEAD} status=0
+base=$1 url=$2 head=${3-HEAD} status=0 branch_name=
+
+headref=$(git symbolic-ref -q "$head")
+if git show-ref -q --verify "$headref"
+then
+ branch_name=${headref#refs/heads/}
+ if test "z$branch_name" = "z$headref" ||
+ ! git config "branch.$branch_name.description" >/dev/null
+ then
+ branch_name=
+ fi
+fi
test -n "$base" && test -n "$url" || usage
baserev=$(git rev-parse --verify "$base"^0) &&
@@ -66,6 +77,13 @@ for you to fetch changes up to %H:
----------------------------------------------------------------' $headrev &&
+if test -n "$branch_name"
+then
+ echo "(from the branch description for $branch local branch)"
+ echo
+ git config "branch.$branch_name.description"
+ echo "----------------------------------------------------------------"
+fi &&
git shortlog ^$baserev $headrev &&
git diff -M --stat --summary $patch $merge_base..$headrev || status=1