Skip to content

Commit 133cfae

Browse files
committed
request-pull: optionally show a patch as well
Allow git request-pull to append diff body into the pull request. It's useful for small series of commits. Tested-by: Cyrill Gorcunov <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b65954d commit 133cfae

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

git-request-pull.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,33 @@ USAGE='<start> <url> [<end>]'
88
LONG_USAGE='Summarizes the changes between two commits to the standard output,
99
and includes the given URL in the generated summary.'
1010
SUBDIRECTORY_OK='Yes'
11-
OPTIONS_SPEC=
11+
OPTIONS_SPEC='git request-pull [options] start url [end]
12+
--
13+
p show patch text as well
14+
'
15+
1216
. git-sh-setup
1317
. git-parse-remote
1418

1519
GIT_PAGER=
1620
export GIT_PAGER
1721

22+
patch=
23+
while case "$#" in 0) break ;; esac
24+
do
25+
case "$1" in
26+
-p)
27+
patch=-p ;;
28+
--)
29+
shift; break ;;
30+
-*)
31+
usage ;;
32+
*)
33+
break ;;
34+
esac
35+
shift
36+
done
37+
1838
base=$1
1939
url=$2
2040
head=${3-HEAD}
@@ -54,5 +74,5 @@ echo " $url $branch"
5474
echo
5575

5676
git shortlog ^$baserev $headrev
57-
git diff -M --stat --summary $merge_base $headrev
77+
git diff -M --stat --summary $patch $merge_base..$headrev
5878
exit $status

0 commit comments

Comments
 (0)