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>
Junio C Hamano committed
Sep 20, 2011 at 15:52 UTC
c0168147831fce00975949213eef3471b7a2b76b
1 file changed
+19
-1
git-request-pull.sh
+19
-1
@@ -35,7 +35,18 @@ do
35
shift
36
done
37
38
-base=$1 url=$2 head=${3-HEAD} status=0
38
+base=$1 url=$2 head=${3-HEAD} status=0 branch_name=
39
+
40
+headref=$(git symbolic-ref -q "$head")
41
+if git show-ref -q --verify "$headref"
42
+then
43
+ branch_name=${headref#refs/heads/}
44
+ if test "z$branch_name" = "z$headref" ||
45
+ ! git config "branch.$branch_name.description" >/dev/null
46
+ then
47
+ branch_name=
48
+ fi
49
+fi
50
51
test -n "$base" && test -n "$url" || usage
52
baserev=$(git rev-parse --verify "$base"^0) &&
@@ -66,6 +77,13 @@ for you to fetch changes up to %H:
77
78
----------------------------------------------------------------' $headrev &&
79
80
+if test -n "$branch_name"
81
+then
82
+ echo "(from the branch description for $branch local branch)"
83
+ echo
84
+ git config "branch.$branch_name.description"
85
+ echo "----------------------------------------------------------------"
86
+fi &&
87
git shortlog ^$baserev $headrev &&
88
git diff -M --stat --summary $patch $merge_base..$headrev || status=1
89