git formatting: truncating with columns

Viewed 447

I have the following command to list local branches in the command line:

git for-each-ref --sort=committerdate refs/heads/ --format='%(color:yellow)%(refname:short)%(color:reset);(%(color:green)%(committerdate:relative)%(color:reset));%<(70,trunc)(%(contents:subject)%s)' | column -t -s';'

everything works except for the %<(70,trunc) which just prints out rather than getting applied as a command.

Per the docs:

'%<(<N>[,trunc|ltrunc|mtrunc])': make the next placeholder take at least N columns, padding spaces on the right if necessary. Optionally truncate at the beginning (ltrunc), the middle (mtrunc) or the end (trunc) if the output is longer than N columns. Note that truncating only works correctly with N >= 2.

I don't believe it should matter, but this didn't work in either zsh or bash.

Here's a snippet of how it looks: snippet of formatted git branch list output

1 Answers
Related