Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/git-l
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ SHA_FORMAT="%C(green)%<($SHA_COLUMN_SIZE,trunc)%h"
# relative commit date - 15 characters wide, truncated
DATE_FORMAT="%C(white)%<(15,trunc)%cr"

# author's abbreviated name - 12 characters wide, truncated
AUTHOR_FORMAT="%C(white)%<(8,trunc)%al"
# find the longest author email local part for the commits we'll show
max_author_len=$(git log -n20 "$@" --format='%al' 2>/dev/null | awk '{if(length>m) m=length} END{print m}')
if [[ -z "$max_author_len" ]]; then
max_author_len=8
fi
# author's abbreviated name - dynamically sized based on the longest author
AUTHOR_FORMAT="%C(white)%<(${max_author_len},trunc)%al"

# decorative information like branch heads or tags
DECORATION_FORMAT="%C(auto)%d"
Expand Down