[PATCH] request-pull: do not paginate output of git commands

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] request-pull: do not paginate output of git commands

From: Michal Marek <hidden>
Date: 2016-06-15 22:47:00

git request-pull called inside a terminal prints part of the output to
the terminal and other parts are piped through the pager. Fix this.

Signed-off-by: Michal Marek <redacted>
---
 git-request-pull.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-request-pull.sh b/git-request-pull.sh
index a2cf5b8..b3aaded 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -34,7 +34,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 --no-pager 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
@@ -45,13 +45,13 @@ fi
 PAGER=
 export PAGER
 echo "The following changes since commit $baserev:"
-git shortlog --max-count=1 $baserev | sed -e 's/^\(.\)/  \1/'
+git --no-pager shortlog --max-count=1 $baserev | sed -e 's/^\(.\)/  \1/'
 
 echo "are available in the git repository at:"
 echo
 echo "  $url $branch"
 echo
 
-git shortlog ^$baserev $headrev
-git diff -M --stat --summary $merge_base $headrev
+git --no-pager shortlog ^$baserev $headrev
+git --no-pager diff -M --stat --summary $merge_base $headrev
 exit $status
-- 
1.6.3

Re: [PATCH] request-pull: do not paginate output of git commands

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:00

Michal Marek [off-list ref] writes:
git request-pull called inside a terminal prints part of the output to
the terminal and other parts are piped through the pager. Fix this.
Hmph, I have always thought this was meant to be a feature.

That is, you run it to yourself, instead of piping it to a file or "| mail
torvalds", in order to sanity check before you actually do the latter.
When the request is larger than a screenful, you would want a pager while
reviewing.

Admittedly, I do not regularly use request-pull, so I wouldn't know if use
of the pager is inconvenient to people who have to use this feature
regularly. Your patch could be addressing a real usability issue.

But I have this nagging suspicion that you may be lacking F (or FX) from
your LESS environment variable?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help