Re: [PATCH v2 3/3] for-each-ref: introduce %(color:...) for color
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Nov 14, 2013, 07:03 UTC
- Message-ID
- <CALkWK0k4MudojZt4PkLjnq0uZe322n30WP-=N0ckLw2QcnbzMA@mail.gmail.com>
- In-Reply-To
- <xmqq38n0dpgy.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
> Perhaps like this (obviously not tested as these three patches did > not add any tests ;-)
Sorry about that. I didn't notice t6300-for-each-ref.sh. Will fix in the next round.
Show 7 quoted lines
> I also think that there should be a mechanism to do "color:reset" > after each record is issued automatically, and also have the color > output honor --color=auto from the command line, i.e. > > git for-each-ref --color=auto --format='%(color:blue)%(subject)' | cat > > should turn the coloring off.
We can add --color=auto later, but I'm wondering about auto-reset color after each token. What happens if I do:
$ git for-each-ref --format='%(subject)%(color:blue)'
No color, right? So, it should be auto-reset color after each token _and_ at end of format-string.