From: Michal Marek <mmarek@suse.cz>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH] request-pull: do not paginate output of git commands
Date: Wed, 1 Jul 2009 11:40:30 +0200 [thread overview]
Message-ID: <20090701094029.GA22508@sepie.suse.cz> (raw)
In-Reply-To: <7vtz1x7f05.fsf@alter.siamese.dyndns.org>
On Tue, Jun 30, 2009 at 11:28:26AM -0700, Junio C Hamano wrote:
> Looking at ff06c74 (Improve request-pull to handle non-rebased branches,
> 2007-05-01), it introduced these specifically to address the issue you are
> bringing up, but it is ineffective.
>
> I'd suggest to replace your patch with the attached instead.
>
> ---
>
> git-request-pull.sh | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/git-request-pull.sh b/git-request-pull.sh
> index a2cf5b8..f86d8fd 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=cat
> +export GIT_PAGER
Good idea, but for completeness, it should be set before this command:
git log --max-count=1 --pretty='format:warn: %h: %s' $headrev >&2
(which should use tformat to get the newline right). So what about this
one?
---
diff --git a/git-request-pull.sh b/git-request-pull.sh
index ab2dd10..5917773 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/'
next prev parent reply other threads:[~2009-07-01 9:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 11:33 [PATCH] request-pull: do not paginate output of git commands Michal Marek
2009-06-30 16:20 ` Junio C Hamano
2009-06-30 16:32 ` Junio C Hamano
2009-06-30 17:26 ` Michal Marek
2009-06-30 18:28 ` Junio C Hamano
2009-07-01 9:40 ` Michal Marek [this message]
2009-07-01 20:16 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090701094029.GA22508@sepie.suse.cz \
--to=mmarek@suse.cz \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).