Re: [TopGit PATCH] tg patch: disable pager and colors for git-diff
- From
Petr Baudis <pasky@suse.cz>
- Date
- Nov 20, 2008, 15:07 UTC
- Message-ID
- <20081120150754.GH10491@machine.or.cz>
- In-Reply-To
- <2c6b72b30811200655o770efd63u4101f44683f2bc0d@mail.gmail.com>
On Thu, Nov 20, 2008 at 03:55:47PM +0100, Jonas Fonseca wrote:
Show 19 quoted lines
> On Thu, Nov 20, 2008 at 15:34, Petr Baudis <pasky@suse.cz> wrote: > > 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.
This shows just that color.diff=always is asking for trouble. ;-) I think we shouldn't try to outsmart the user if they _force_ that they really always want the colors.
-- Petr "Pasky" Baudis People who take cold baths never have rheumatism, but they have cold baths.