From: Jeff King <peff@peff.net>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Chris Packham <judge.packham@gmail.com>, Git <git@vger.kernel.org>
Subject: Re: Cygwin + git log = no pager!
Date: Thu, 27 Feb 2014 01:21:07 -0500 [thread overview]
Message-ID: <20140227062107.GA21000@sigill.intra.peff.net> (raw)
In-Reply-To: <CAHd499Co9Amdf_gWnY81dkRa2uDTH0fVM8HSb99VHhrb1AAKhA@mail.gmail.com>
On Wed, Feb 26, 2014 at 09:54:39AM -0600, Robert Dailey wrote:
> > That _should_ turn on the pager, but I think it does not due to a bug
> > with setup_pager and aliases. Something like the patch below would make
> > it work (but if you are having to use "-p" manually, there is something
> > to fix in your cygwin environment, which does not think you are on a
> > terminal).
>
> I have tried `git -p log` and `git log` and neither use the pager.
I thought Git's behavior was a bug, but it seems to be the intended
effect that "-p" is just "cancel --no-pager" and not "turn on the pager,
even if stdout is not a tty".
So the patch I sent is not something we would want to apply, but it
might help debugging your situation (if my hunch is right that isatty()
is returning false, then "git -p log" would work with it). Or perhaps a
simpler way to check that is just:
diff --git a/pager.c b/pager.c
index 0cc75a8..6d870ac 100644
--- a/pager.c
+++ b/pager.c
@@ -41,8 +41,10 @@ const char *git_pager(int stdout_is_tty)
{
const char *pager;
- if (!stdout_is_tty)
+ if (!stdout_is_tty) {
+ warning("disabling pager, stdout is not a tty");
return NULL;
+ }
pager = getenv("GIT_PAGER");
if (!pager) {
> Should I apply the provided patch to the Git for Windows master
> branch? Also I'm not sure if there is a convenient way to apply a
> patch via email, so should I copy & paste it to a file & then apply
> the file?
The usual way is to save the patch to an mbox, then use "git am" to
apply it. Most Unix-y mail clients have mbox support, but I suspect many
Windows ones do not.
-Peff
next prev parent reply other threads:[~2014-02-27 6:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-22 5:18 Cygwin + git log = no pager! Robert Dailey
2014-02-22 7:39 ` Chris Packham
2014-02-23 20:33 ` Robert Dailey
2014-02-24 7:55 ` Chris Packham
2014-02-24 9:06 ` Jeff King
2014-02-24 19:34 ` Robert Dailey
2014-02-26 9:26 ` Jeff King
2014-02-26 15:54 ` Robert Dailey
2014-02-26 16:41 ` Robert Dailey
2014-02-27 6:21 ` Jeff King [this message]
2014-02-27 7:36 ` Chris Packham
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=20140227062107.GA21000@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=judge.packham@gmail.com \
--cc=rcdailey.lists@gmail.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 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).