X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-request-pull.sh;h=8fd15f6df4926a89812437e04735bd924ee7088b;hb=251a4951a20b23760c3ccf3f3122d4394ab37357;hp=fd95beadab6aa01fc3fb26c7d72ba182201f8502;hpb=6b37b3d873e734919dfd43c3d124c4f98e265296;p=git.git diff --git a/git-request-pull.sh b/git-request-pull.sh index fd95beada..8fd15f6df 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -8,13 +8,33 @@ USAGE=' []' LONG_USAGE='Summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary.' SUBDIRECTORY_OK='Yes' -OPTIONS_SPEC= +OPTIONS_SPEC='git request-pull [options] start url [end] +-- +p show patch text as well +' + . git-sh-setup . git-parse-remote GIT_PAGER= export GIT_PAGER +patch= +while case "$#" in 0) break ;; esac +do + case "$1" in + -p) + patch=-p ;; + --) + shift; break ;; + -*) + usage ;; + *) + break ;; + esac + shift +done + base=$1 url=$2 head=${3-HEAD} @@ -45,14 +65,14 @@ if [ -z "$branch" ]; then status=1 fi -echo "The following changes since commit $baserev:" -git shortlog --max-count=1 $baserev | sed -e 's/^\(.\)/ \1/' +git show -s --format='The following changes since commit %H: -echo "are available in the git repository at:" -echo + %s (%ci) + +are available in the git repository at:' $baserev echo " $url $branch" echo git shortlog ^$baserev $headrev -git diff -M --stat --summary $merge_base $headrev +git diff -M --stat --summary $patch $merge_base..$headrev exit $status