X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-request-pull.sh;h=6fdea397ddec3cfa4ff37cdf672e7cced840bb60;hb=452c6d506b1a6dcf24d4ceaa592afc39c1c1a60e;hp=fd95beadab6aa01fc3fb26c7d72ba182201f8502;hpb=07d6309e63aa272d2930540faa72147dc5be97a5;p=git.git diff --git a/git-request-pull.sh b/git-request-pull.sh index fd95beada..6fdea397d 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # Copyright 2005, Ryan Anderson # # This file is licensed under the GPL v2, or a later version @@ -8,13 +8,34 @@ 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_KEEPDASHDASH= +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 +66,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: + + %s (%ci) -echo "are available in the git repository at:" -echo -echo " $url $branch" -echo +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 shortlog ^$baserev $headrev && +git diff -M --stat --summary $patch $merge_base..$headrev || exit exit $status