# GIT_PAGER=cat git-svn log --> Illegal seek

2 messages from 2007-09-21 to 2007-09-22. Participants: Chris Moore, Eric Wong.
Thread: https://gitlist.dev/t/9972

## Chris Moore, 2007-09-21 23:40

Subject: GIT_PAGER=cat git-svn log --> Illegal seek
Message-ID: <a9691ee20709211640q63881718k75ebf416bf5e217f@mail.gmail.com>
URL: https://gitlist.dev/e/a9691ee20709211640q63881718k75ebf416bf5e217f%40mail.gmail.com

```
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

```

## Eric Wong, 2007-09-22 01:48

Subject: [PATCH] git-svn: don't attempt to spawn pager if we don't want one
Message-ID: <20070922014845.GA8087@mayonaise>
URL: https://gitlist.dev/e/20070922014845.GA8087%40mayonaise
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

```
