From 3eb91bfc0d2e0c8c67bd4ec62523deb849919dd9 Mon Sep 17 00:00:00 2001 From: Stefan Naewe Date: Mon, 17 Nov 2008 09:57:19 +0100 Subject: request-pull: make usage string match manpage The usage string of 'git request-pull' differs from he manpage which gives the correct 'synopsis'. Signed-off-by: Stefan Naewe Signed-off-by: Junio C Hamano --- git-request-pull.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git-request-pull.sh') diff --git a/git-request-pull.sh b/git-request-pull.sh index 073a314c80..a2cf5b8215 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -4,9 +4,9 @@ # This file is licensed under the GPL v2, or a later version # at the discretion of Linus Torvalds. -USAGE=' []' -LONG_USAGE='Summarizes the changes since to the standard output, -and includes in the message generated.' +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= . git-sh-setup -- cgit v1.3 From 476cc724242e715c150dce0d26d2feabe2dbe5e1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 30 Jun 2009 11:29:36 -0700 Subject: request-pull: really disable pager ff06c74 (Improve request-pull to handle non-rebased branches, 2007-05-01) attempted to disable pager when running subcommands in this script, but with a wrong variable. If GIT_PAGER is set, it takes precedence over PAGER. Noticed by Michal Marek. Signed-off-by: Junio C Hamano --- git-request-pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-request-pull.sh') diff --git a/git-request-pull.sh b/git-request-pull.sh index a2cf5b8215..ab2dd10498 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -42,8 +42,8 @@ if [ -z "$branch" ]; then status=1 fi -PAGER= -export PAGER +GIT_PAGER= +export GIT_PAGER echo "The following changes since commit $baserev:" git shortlog --max-count=1 $baserev | sed -e 's/^\(.\)/ \1/' -- cgit v1.3 From 653a31c16a0b83c11f00eb94ef49857ce8f2e37b Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Wed, 1 Jul 2009 11:40:30 +0200 Subject: request-pull: really really disable pager Earlier 476cc72 (request-pull: really disable pager, 2009-06-30) tried to use the correct environment variable to disable paging from multiple calls to "git log" and friends, but there was one extra call to "git log" that was not covered by the trick. Move the setting and exporting of GIT_PAGER much earlier in the script to cover everybody. Signed-off-by: Junio C Hamano --- git-request-pull.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'git-request-pull.sh') diff --git a/git-request-pull.sh b/git-request-pull.sh index ab2dd10498..5917773240 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -12,6 +12,9 @@ OPTIONS_SPEC= . git-sh-setup . git-parse-remote +GIT_PAGER= +export GIT_PAGER + base=$1 url=$2 head=${3-HEAD} @@ -34,7 +37,7 @@ branch=$(git ls-remote "$url" \ }") if [ -z "$branch" ]; then echo "warn: No branch of $url is at:" >&2 - git log --max-count=1 --pretty='format:warn: %h: %s' $headrev >&2 + git log --max-count=1 --pretty='tformat:warn: %h: %s' $headrev >&2 echo "warn: Are you sure you pushed $head there?" >&2 echo >&2 echo >&2 @@ -42,8 +45,6 @@ if [ -z "$branch" ]; then status=1 fi -GIT_PAGER= -export GIT_PAGER echo "The following changes since commit $baserev:" git shortlog --max-count=1 $baserev | sed -e 's/^\(.\)/ \1/' -- cgit v1.3 From 33016c491367c5144b3007927cd76492ac193d16 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Tue, 28 Jul 2009 18:30:02 -0700 Subject: request-pull: allow ls-remote to notice remote.$nickname.uploadpack The location to pull from should be converted from the configured nickname to URL in the message, but ls-remote should be fed the nickname so that the command uses remote.$nickname.* variables, most notably "uploadpack". Signed-off-by: Tom Grennan Signed-off-by: Junio C Hamano --- git-request-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-request-pull.sh') diff --git a/git-request-pull.sh b/git-request-pull.sh index 5917773240..fd95beadab 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -28,13 +28,13 @@ headrev=`git rev-parse --verify "$head"^0` || exit merge_base=`git merge-base $baserev $headrev` || die "fatal: No commits in common between $base and $head" -url=$(get_remote_url "$url") branch=$(git ls-remote "$url" \ | sed -n -e "/^$headrev refs.heads./{ s/^.* refs.heads.// p q }") +url=$(get_remote_url "$url") if [ -z "$branch" ]; then echo "warn: No branch of $url is at:" >&2 git log --max-count=1 --pretty='tformat:warn: %h: %s' $headrev >&2 -- cgit v1.3 From 133cfaeb8ba40f12e4c0ad99bdd3a0a4f8d0ade2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 27 Jul 2009 14:27:47 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- git-request-pull.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'git-request-pull.sh') diff --git a/git-request-pull.sh b/git-request-pull.sh index fd95beadab..630ceddf03 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} @@ -54,5 +74,5 @@ 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 -- cgit v1.3