Re: [PATCH] branch: colorize branches checked out in a linked working tree the same way as the current branch is colorized
- From
Jeff King <peff@peff.net>
- Date
- Sep 27, 2018, 19:41 UTC
- Message-ID
- <20180927194150.GA7452@sigill.intra.peff.net>
- In-Reply-To
- <20180927193559.GB6950@sigill.intra.peff.net>
On Thu, Sep 27, 2018 at 03:35:59PM -0400, Jeff King wrote:
Show 11 quoted lines
> now, we could do: > > %(if)%(HEAD)%(then)* %(color:bold green) > %(else)%(if)%(worktree)%(then)+ %(color:green) > %(else) %(end)%(end) > > (respecting the user's color config, of course, rather than hard-coded > colors). > > Trying that out, though, I'm not sure if we properly support nested > if's. That might be a bug we have to fix first.
Sorry, false alarm. I just had a typo in my format.
This seems to work with the patch I posted earlier:
git for-each-ref \
--format='%(if)%(HEAD)%(then)* %(color:bold green)%(else)%(if)%(worktree)%(then)+ %(color:green)%(else) %(end)%(end)%(refname)' \
refs/headsIt sure would be nice if there was a way to insert line breaks without impacting the output. ;)
-Peff