I'm trying to create an alias for a particular view of my git branches, with the usual verbose data plus some extra. (Datetime; I'm also sorting by date.) This is possible with a custom format string, but it loses the default coloring from git branch -v
; the active branch doesn't get highlighted in green and other coloring like upstreams doesn't show up either. It looks to me from git docs like this should be fixed by adding %C(always)
as a prefix to the format string, but this doesn't seem to work:
git branch --format=:%C(always) %(committerdate:short) %(refname:short) %(contents:lines=1)"
just displays
%C(always) 2022-08-23 foo/bar testing Token
%C(always) 2022-08-26 seethefnords fix validation
with no color. What is wrong here?
(Also, just incidentally, is it possible to get the smart alignment back in a custom format string?)