Re: [PATCH] branch: colorize branches checked out in a linked working tree the same way as the current branch is colorized
- From
Rafael Ascensão <rafa.almas@gmail.com>
- Date
- Sep 27, 2018, 19:28 UTC
- Message-ID
- <20180927192804.GA27163@rigel>
- In-Reply-To
- <20180927181708.GA2468@sigill.intra.peff.net>
On Thu, Sep 27, 2018 at 02:17:08PM -0400, Jeff King wrote:
Show 7 quoted lines
> Do we want to limit this to git-branch, though? Ideally any output you > get from git-branch could be replicated with for-each-ref (or with > a custom "branch --format"). > > I.e., could we have a format in ref-filter that matches HEAD, but > returns a distinct symbol for a worktree HEAD? That would allow a few > things:
I was going to suggest using dim green and green for elsewhere and here respectively, in a similar way how range-diff uses it to show different versions of the same diff.
But if we're open to change how branches are displayed maybe a config option like branch.format (probably not the best name choice) that can be set to the 'for-each-ref --format' syntax would be way more flexible.
e.g.
branch.format='%(if:equals=+)...'I think the different symbol and dimmed color would be a nice addition, but I am leaning towards giving the user the ultimate choice on how they want to format their output. (Maybe with dimmed plus symbol as default).
-- Cheers, Rafael Ascensão