As per the git-log manual, ltrunc
, mtrunc
and trunc
is only an optional argument to the %<(<N>)
placeholder, which main purpose is to do the padding:
%<(<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.
As of right now the git log
pretty formats don't seem to have an option that just does the truncation. I think this kinda goes along with "pretty printing" being generally used to tabularize the output to be easily human-readable.
You can remove extra whitespace from git log
pretty print output with some post-processing, .e.g. using sed
to replace two or more adjacent spaces with one:
git log --oneline --format="%h %<(70,trunc)%s %cn" | sed -e "s/[ ]\{2,\}/ /g"