Thread (18 messages) 18 messages, 5 authors, 2022-06-10

Re: [PATCH v4] git-prompt: make colourization consistent

flat view

From: Joakim Petersen <hidden>
Date: 2022-06-04 19:26:24

On 04/06/2022 19:30, Justin Donnelly wrote:
I like this solution. This isn't new, but does anybody know if there
is a reason why `$w` is compared for equality to "*" as opposed to
just checking whether it's a nonempty value (`-n`)? I think I'd
generally prefer it to be consistent with the others, which has the
added benefit of continuing to work if the asterisk is ever changed to
something else.
Looking at the commit that introduced colourization, 9b7e776c0a5 (show color hints based on state of the git tree, 2012-10-10), it looks like
the author wanted the be as specific as possible in the check, with $w
only being empty or holding a '*', while $i could hold multiple
different indicators. Since the layout of the script has changed
significantly since then, I'll submit a v5 shortly with the $w check
altered.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help