Skip to content

Commit c016814

Browse files
committed
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 <[email protected]>
1 parent cf73166 commit c016814

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

git-request-pull.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ do
3535
shift
3636
done
3737

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
3950

4051
test -n "$base" && test -n "$url" || usage
4152
baserev=$(git rev-parse --verify "$base"^0) &&
@@ -66,6 +77,13 @@ for you to fetch changes up to %H:
6677
6778
----------------------------------------------------------------' $headrev &&
6879

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 &&
6987
git shortlog ^$baserev $headrev &&
7088
git diff -M --stat --summary $patch $merge_base..$headrev || status=1
7189

0 commit comments

Comments
 (0)