# Adding color to git-add--interactive

8 messages from 2007-10-09 to 2007-10-10. Participants: Jonathan del Strother, Wincent Colaiuta, Johannes Schindelin, Jeff King, Alex Riesen.
Thread: https://gitlist.dev/t/10215

## Jonathan del Strother, 2007-10-09 13:06

Subject: Adding color to git-add--interactive
Message-ID: <91EBB71E-BB4E-4089-8C33-6B0C4A61223A@steelskies.com>
URL: https://gitlist.dev/e/91EBB71E-BB4E-4089-8C33-6B0C4A61223A%40steelskies.com

```
I find git-add--interactive incredibly awkward to use, mostly due to  
the lack of visual differentiation as you type in a sequence of  
commands.  For example, when stepping through hunks to patch, every  
time it shows a new hunk I have to carefully scan up the screen to  
find where the hunk starts, before I can actually start reading what's  
contained in that hunk.

For me at least, adding color would make the interactive mode far more  
readable.   I hacked in basic color support (just coloring PROMPT &  
HEADER in list_and_choose, and the "Stage this hunk?" prompt) - which  
helped a lot - but then reached the limits of my perl knowledge.  For  
instance, I can't see a sensible way of reusing git-svn's  
log_use_color function without importing the entire file, and I can't  
figure out how you'd go about diff-coloring the hunks.  Is anyone with  
more perl knowledge than me interested in taking this on?

Or am I alone in finding interactive mode basically unreadable?
Jon

```

## Wincent Colaiuta, 2007-10-09 13:31

Subject: Re: Adding color to git-add--interactive
Message-ID: <A59A0321-9E29-4857-AF03-E6226C45E87C@wincent.com>
URL: https://gitlist.dev/e/A59A0321-9E29-4857-AF03-E6226C45E87C%40wincent.com
In-Reply-To: <91EBB71E-BB4E-4089-8C33-6B0C4A61223A@steelskies.com>

```
El 9/10/2007, a las 15:06, Jonathan del Strother escribió:

> Or am I alone in finding interactive mode basically unreadable?

I don't think you're alone. Compared with the nice colorized output  
from things like git-status, git-log, git-diff and friends, the  
output of "git-add --interactive" is decidedly hard to read.

Cheers,
Wincent

```

## Johannes Schindelin, 2007-10-09 14:04

Subject: Re: Adding color to git-add--interactive
Message-ID: <Pine.LNX.4.64.0710091503460.4174@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710091503460.4174%40racer.site
In-Reply-To: <A59A0321-9E29-4857-AF03-E6226C45E87C@wincent.com>

```
Hi,

On Tue, 9 Oct 2007, Wincent Colaiuta wrote:

> El 9/10/2007, a las 15:06, Jonathan del Strother escribi?:
> 
> > Or am I alone in finding interactive mode basically unreadable?
> 
> I don't think you're alone. Compared with the nice colorized output from 
> things like git-status, git-log, git-diff and friends, the output of 
> "git-add --interactive" is decidedly hard to read.

And since git-add--interactive is still a script, there is no excuse: 
providing a patch should take the same time and amount of work as 
complaining about the lack of colour.

Ciao,
Dscho

```

## Wincent Colaiuta, 2007-10-09 14:44

Subject: Re: Adding color to git-add--interactive
Message-ID: <4D8B16C8-C543-4E67-B0D1-F737A4D14B25@wincent.com>
URL: https://gitlist.dev/e/4D8B16C8-C543-4E67-B0D1-F737A4D14B25%40wincent.com
In-Reply-To: <Pine.LNX.4.64.0710091503460.4174@racer.site>

```
El 9/10/2007, a las 16:04, Johannes Schindelin escribió:

> On Tue, 9 Oct 2007, Wincent Colaiuta wrote:
>
>> El 9/10/2007, a las 15:06, Jonathan del Strother escribió:
>>
>>> Or am I alone in finding interactive mode basically unreadable?
>>
>> I don't think you're alone. Compared with the nice colorized  
>> output from
>> things like git-status, git-log, git-diff and friends, the output of
>> "git-add --interactive" is decidedly hard to read.
>
> And since git-add--interactive is still a script, there is no excuse:
> providing a patch should take the same time and amount of work as
> complaining about the lack of colour.

Why so combative, Johannes? I merely answered one of Jonathan's  
questions. Nobody has proffered any "excuses".

And in any case, you're exaggerating. Jonathan said that he's already  
invested time in trying to get it working, most certainly more time  
than it has taken he, you or I, to write the emails in this thread,  
and he's gotten as far as his Perl knowledge permits him.

Cheers,
Wincent

```

## Jeff King, 2007-10-09 23:40

Subject: Re: Adding color to git-add--interactive
Message-ID: <20071009234020.GA20952@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20071009234020.GA20952%40coredump.intra.peff.net
In-Reply-To: <91EBB71E-BB4E-4089-8C33-6B0C4A61223A@steelskies.com>

```
On Tue, Oct 09, 2007 at 02:06:31PM +0100, Jonathan del Strother wrote:

> For me at least, adding color would make the interactive mode far more
> readable.   I hacked in basic color support (just coloring PROMPT &
> HEADER in list_and_choose, and the "Stage this hunk?" prompt) - which
> helped a lot - but then reached the limits of my perl knowledge.  For
> instance, I can't see a sensible way of reusing git-svn's
> log_use_color function without importing the entire file, and I can't
> figure out how you'd go about diff-coloring the hunks.  Is anyone with
> more perl knowledge than me interested in taking this on?

Why don't you post what you have, and we can make comments on it?

As far as reusing code from git-svn, there is a 'Git.pm' module in the
perl/ subdirectory. You can move the code there and 'use Git' in
git-add--interactive.perl (git-svn already uses it).

-Peff

```

## Johannes Schindelin, 2007-10-10 15:06

Subject: Re: Adding color to git-add--interactive
Message-ID: <Pine.LNX.4.64.0710101604350.4174@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710101604350.4174%40racer.site
In-Reply-To: <20071009234020.GA20952@coredump.intra.peff.net>

```
Hi,

On Tue, 9 Oct 2007, Jeff King wrote:

> On Tue, Oct 09, 2007 at 02:06:31PM +0100, Jonathan del Strother wrote:
> 
> > For me at least, adding color would make the interactive mode far more
> > readable.   I hacked in basic color support (just coloring PROMPT &
> > HEADER in list_and_choose, and the "Stage this hunk?" prompt) - which
> > helped a lot - but then reached the limits of my perl knowledge.  For
> > instance, I can't see a sensible way of reusing git-svn's
> > log_use_color function without importing the entire file, and I can't
> > figure out how you'd go about diff-coloring the hunks.  Is anyone with
> > more perl knowledge than me interested in taking this on?
> 
> Why don't you post what you have, and we can make comments on it?
> 
> As far as reusing code from git-svn, there is a 'Git.pm' module in the
> perl/ subdirectory. You can move the code there and 'use Git' in
> git-add--interactive.perl (git-svn already uses it).

I think the reason git-add--interactive does not use it is that some 
people (me included) experienced heavy problems with perl modules.  
However, I do not recall to which extent they have been solved.  I guess 
when git-add--interactive goes Git.pm and stops working for me, I'll do my 
famous "aargh, I'll just make it a builtin" song.

Ciao,
Dscho

```

## Jeff King, 2007-10-10 17:06

Subject: Re: Adding color to git-add--interactive
Message-ID: <20071010170621.GA5444@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20071010170621.GA5444%40coredump.intra.peff.net
In-Reply-To: <Pine.LNX.4.64.0710101604350.4174@racer.site>

```
On Wed, Oct 10, 2007 at 04:06:09PM +0100, Johannes Schindelin wrote:

> I think the reason git-add--interactive does not use it is that some 
> people (me included) experienced heavy problems with perl modules.  
> However, I do not recall to which extent they have been solved.  I guess 
> when git-add--interactive goes Git.pm and stops working for me, I'll do my 
> famous "aargh, I'll just make it a builtin" song.

I had thought this was the case, too (and in fact, I started to write
"we don't have a good solution for sharing perl code"), but it looks
like git-remote, git-svn, and git-send-email are all using Git.pm these
days.

-Peff

```

## Alex Riesen, 2007-10-10 21:09

Subject: Re: Adding color to git-add--interactive
Message-ID: <20071010210958.GA16635@steel.home>
URL: https://gitlist.dev/e/20071010210958.GA16635%40steel.home
In-Reply-To: <20071010170621.GA5444@coredump.intra.peff.net>

```
Jeff King, Wed, Oct 10, 2007 19:06:21 +0200:
> On Wed, Oct 10, 2007 at 04:06:09PM +0100, Johannes Schindelin wrote:
> 
> > I think the reason git-add--interactive does not use it is that some 
> > people (me included) experienced heavy problems with perl modules.  
> > However, I do not recall to which extent they have been solved.  I guess 
> > when git-add--interactive goes Git.pm and stops working for me, I'll do my 
> > famous "aargh, I'll just make it a builtin" song.
> 
> I had thought this was the case, too (and in fact, I started to write
> "we don't have a good solution for sharing perl code"), but it looks
> like git-remote, git-svn, and git-send-email are all using Git.pm these
> days.
> 

And strangely enough, git-remote is even usable on cygwin.
Can't say for others though.

```
