From: Jeff King Date: Mon, 10 Aug 2015 05:19:01 GMT Subject: Re: "git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply Message-ID: <20150810051901.GA9262@sigill.intra.peff.net> 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