git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply

From
Jeff King <peff@peff.net>
Date
Aug 10, 2015, 05:19 UTC
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:
Show 6 quoted lines
> 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
Previous: Jeff KingNext: Jeff King
Message 3 of 8 in “"git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply”
  1. Per CederqvistAug 3, 2015
  2. Jeff KingAug 9, 2015
  3. Jeff KingAug 10, 2015
  4. 1/2 pager_in_use: use git_env_boolJeff King, Aug 10, 2015
  5. 2/2 pager_in_use: make sure output is still going to pagerJeff King, Aug 10, 2015
  6. Johannes SchindelinAug 10, 2015
  7. Jeff KingAug 10, 2015
  8. Per CederqvistAug 11, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.