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 <gorcunov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 27, 2009 at 14:27 UTC
133cfaeb8ba40f12e4c0ad99bdd3a0a4f8d0ade2
1 file changed
+22
-2
git-request-pull.sh
+22
-2
@@ -8,13 +8,33 @@ USAGE='<start> <url> [<end>]'
8
LONG_USAGE='Summarizes the changes between two commits to the standard output,
9
and includes the given URL in the generated summary.'
10
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
+
16
. git-sh-setup
17
. git-parse-remote
18
19
GIT_PAGER=
20
export GIT_PAGER
21
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
+
38
base=$1
39
url=$2
40
head=${3-HEAD}
@@ -54,5 +74,5 @@ echo " $url $branch"
74
echo
75
76
git shortlog ^$baserev $headrev
57
-git diff -M --stat --summary $merge_base $headrev
77
+git diff -M --stat --summary $patch $merge_base..$headrev
78
exit $status