git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Per Cederqvist <cederp@opera.com>
Cc: git@vger.kernel.org
Subject: Re: "git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply
Date: Mon, 10 Aug 2015 01:19:01 -0400	[thread overview]
Message-ID: <20150810051901.GA9262@sigill.intra.peff.net> (raw)
In-Reply-To: <20150809234238.GB25769@sigill.intra.peff.net>

On Sun, Aug 09, 2015 at 07:42:38PM -0400, Jeff King wrote:

> It looks like the use of a pager is fooling our "should we colorize the
> diff" check when generating the patches. Usually we check isatty(1) to
> see if we should use color, so "git format-patch >patches" does the
> right thing. But if a pager is in use, we have to override that check
> (since stdout goes to the pager, but the pager is going to a tty). That
> propagates to children via the GIT_PAGER_IN_USE environment variable.

Here's the fix I came up with. The first patch is just a tiny
refactoring; second one is the interesting bit.

  [1/2]: pager_in_use: use git_env_bool
  [2/2]: pager_in_use: make sure output is still going to pager

-Peff

  reply	other threads:[~2015-08-10  5:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 15:21 "git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply Per Cederqvist
2015-08-09 23:42 ` Jeff King
2015-08-10  5:19   ` Jeff King [this message]
2015-08-10  5:19     ` [PATCH 1/2] pager_in_use: use git_env_bool Jeff King
2015-08-10  5:23     ` [PATCH 2/2] pager_in_use: make sure output is still going to pager Jeff King
2015-08-10 16:38       ` Johannes Schindelin
2015-08-10 17:24         ` Jeff King
2015-08-11  7:48           ` Per Cederqvist

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=20150810051901.GA9262@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=cederp@opera.com \
    --cc=git@vger.kernel.org \
    /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).