Re: [PATCH v12 03/13] ref-filter: introduce the ref_formatting_state stack machinery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> Speaking of quote_value, The quote doesn't work well with color's
> for e.g.
> git for-each-ref --shell --format="%(color:green)%(refname)"
> '''refs/heads/allow-unknown-type'''
> Seems like an simple fix, probably after GSoC I'll do this :)

Anyway, the %(color) is really meant to be displayed on-screen, and the
quoting is really meant to feed the value to another program, so I can
hardly imagine a use-case where you would want both.

But the current behavior seems fine to me: the color escape sequence is
quoted, which is good. For example, you can

x=$(git for-each-ref --shell --format="nocolor%(color:green)%(refname)" | head -n 1)
sh -c "echo $x"

it will actually display "nocolor" without color, then a green refname.
I'm not sure the quoting is really necessary, but it doesn't harm and it
makes sense since the escape sequence contains a '[' which is a shell
metacharacter.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]