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

Re: [TopGit PATCH] tg patch: disable pager and colors for git-diff

From
Jonas Fonseca <fonseca@diku.dk>
Date
Nov 20, 2008, 14:55 UTC
Message-ID
<2c6b72b30811200655o770efd63u4101f44683f2bc0d@mail.gmail.com>
In-Reply-To
<20081120143455.GH10544@machine.or.cz>
On Thu, Nov 20, 2008 at 15:34, Petr Baudis <pasky@suse.cz> wrote:
Show 12 quoted lines
> On Thu, Nov 20, 2008 at 02:57:10PM +0100, Jonas Fonseca wrote:
>> When output is not redirected to a file, git brings up the pager for
>> only the diff, which can be confusing, so disable with --no-pager.
>> git-diff is a porcelain command and thus subject to color options. Use
>> --no-color, to avoid the patch being corrupted with terminal escape
>> characters when color.diff=always.
>>
>> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
>
> I still don't understand how did that color thing happen - shouldn't
> git diff avoid spewing out colors when the output is not a tty? And when
> it is, I want the colors myself, too.

As I wrote in the commit message, git diff always spews out colors with color.diff=always. This was what I for experimental reasons had in my .git/config (and forgotten all about) before sending the README update patch. Topgit could check the git color configuration but that seems more hacky.

> Good point with the --no-pager, but in that case, tg patch itself should
> by default invoke the pager, since it really is very desirable.
Yes, probably.
-- 
Jonas Fonseca
Previous: Petr BaudisNext: Petr Baudis
Message 7 of 8 in “README: Fix spelling”
  1. README: Fix spellingJonas Fonseca, Nov 20, 2008
  2. Jonas FonsecaNov 20, 2008
  3. martin f krafftNov 20, 2008
  4. Jonas FonsecaNov 20, 2008
  5. tg patch: disable pager and colors for git-diffJonas Fonseca, Nov 20, 2008
  6. Petr BaudisNov 20, 2008
  7. Jonas FonsecaNov 20, 2008
  8. Petr BaudisNov 20, 2008

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.