threads / bug / 46928

[bug] git add -p breaks, if color.ui is set to "always"

Subject: [bug] git add -p breaks, if color.ui is set to "always"

## tl;dr

2 messages between Oct 6, 2017 and Oct 6, 2017.

replies: 1people: 2as markdown or json

Alexander Gehrke· Oct 6, 2017, 12:47 UTC · lore

After an update to version 2.14.2 from 2.14.1 "git add --patch" stopped working for me, just producing the same output as "git diff", but not prompting to stage anything.

I found that unsetting the config key color.ui, which was set to "always" fixed the problem.

From the manpage, color.ui should not have that effect and "always" should be a legal value.

Regards Alexander Gehrke

Kevin Daudt· Oct 6, 2017, 15:42 UTC · re: Alexander Gehrke · lore

Re: [bug] git add -p breaks, if color.ui is set to "always"

On Fri, Oct 06, 2017 at 02:47:30PM +0200, Alexander Gehrke wrote:
Show 12 quoted lines
> After an update to version 2.14.2 from 2.14.1 "git add --patch" stopped working
> for me, just producing the same output as "git diff", but not prompting to stage
> anything.
> 
> I found that unsetting the config key color.ui, which was set to "always" fixed
> the problem.
> 
> From the manpage, color.ui should not have that effect and "always" should be a
> legal value.
> 
> Regards
> Alexander Gehrke
Hello Alexander,

There have been a few mailing-list posts[0] about this already. While git add -p should probably not have broken by this, setting ui.color to always itself does not make a lot of sense either.

You are telling git to always output color, even when the target is something that does not know what to do with the color codes. Setting it to 'auto' would make more sense.

The thread I posted to discusses some changes that might get introduced to improve the situation though.

Kevin.
[0}:https://public-inbox.org/git/20171003093157.gq7za2fwcqsouire@sigill.intra.peff.net/T/

← back to recent threads