All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Chris Moore <christopher.ian.moore@gmail.com>, git@vger.kernel.org
Subject: [PATCH] git-svn: don't attempt to spawn pager if we don't want one
Date: Fri, 21 Sep 2007 18:48:45 -0700	[thread overview]
Message-ID: <20070922014845.GA8087@mayonaise> (raw)
In-Reply-To: <a9691ee20709211640q63881718k75ebf416bf5e217f@mail.gmail.com>

Even though config_pager() unset the $pager variable, we were
blindly calling exec() on it through run_pager().

Noticed-by: Chris Moore <christopher.ian.moore@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---

  Chris Moore <christopher.ian.moore@gmail.com> wrote:
  > I run my git commands inside an Emacs *shell* buffer, so I don't want
  > it running 'less' all the time.  I export GIT_PAGER=cat to stop it.
  > 
  > I just tried a "git-svn log" and it failed:
  > 
  > $ GIT_PAGER=cat git-svn log
  > Use of uninitialized value in exec at /usr/bin/git-svn line 3451.
  > Use of uninitialized value in concatenation (.) or string at
  > /usr/bin/git-svn line 3451.
  > Can't run pager: Illegal seek ()
  > 
  > I don't get a shell prompt back.  It just hangs.
  > 
  > This is on ubuntu feisty with the ubuntu-backport repositories enabled:
  > 
  > ii  git-core                                     1.5.2.5-2~feisty1
  > ii  git-svn                                      1.5.2.5-2~feisty1

 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 288d32c..484b057 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3578,7 +3578,7 @@ sub config_pager {
 }
 
 sub run_pager {
-	return unless -t *STDOUT;
+	return unless -t *STDOUT && defined $pager;
 	pipe my $rfd, my $wfd or return;
 	defined(my $pid = fork) or ::fatal "Can't fork: $!\n";
 	if (!$pid) {
-- 
Eric Wong

      reply	other threads:[~2007-09-22  1:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21 23:40 GIT_PAGER=cat git-svn log --> Illegal seek Chris Moore
2007-09-22  1:48 ` Eric Wong [this message]

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=20070922014845.GA8087@mayonaise \
    --to=normalperson@yhbt.net \
    --cc=christopher.ian.moore@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.