Thread (11 messages) flat view 11 messages, 3 authors, 2016-06-15

Re: Cygwin + git log = no pager!

From: Chris Packham <hidden>
Date: 2016-06-15 23:00:01

On 27/02/14 04:54, Robert Dailey wrote:
On Wed, Feb 26, 2014 at 3:26 AM, Jeff King [off-list ref] wrote:
quoted
On Mon, Feb 24, 2014 at 01:34:34PM -0600, Robert Dailey wrote:
quoted
So I set GIT_PAGER to 'echo custom pager' as you instructed, and I
noticed that wasn't being printed when I ran my git log alias. So what
I did after that was set GIT_TRACE=1 and here is the output I see
before my logs start printing:
[...]
Does using an alias have something to do with this?
The aliases shouldn't matter (and I constructed a scenario like the one
you showed and it starts the pager for me on Linux). It's more like git
is deciding not to show a pager at all (e.g., it thinks your stdout is
not a tty). Does running:

  git log

not use a pager, but:

  git -p log

does? In that case, I think that your stdout is not a tty for some
reason.

If that is the case, try:

  git -p lg

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).

-Peff

<snip>
I have tried `git -p log` and `git log` and neither use the pager.
Should I apply the provided patch to the Git for Windows master
branch? 
That may be relevant (refer to my previous questions about what version
you're using and how you got it). Are you using git via cygwin or "Git
For Windows"? I believe the two are different (*caveat* I haven't used
windows in years and I've never used Git For Windows, I've added the
msysgit list to this email thread).

If you're executing the Git For Windows installation from the cygwin
bash shell that's probably why the terminal detection is getting
confused. If you've installed Git For Windows you should use the Git
BASH shell that comes with it. If you want to use git with other bits of
cygwin I suggest uninstalling Git For Windows and installing the git
package via the cygwin setup tool.
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?
Save the email file in your email client. Most support saving as plain
text or RFC822 format. Then 'git am <filename>' should do the trick.
I'm assuming your patch depended on -p working but not without it, so
I'm not sure if you still think the patch might help. Let me know!
Thanks for your help.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help