File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 1313items=$( git ls-files | cut -d/ -f1 | sort -u)
1414
1515# Get current year and 6 months ago timestamp for comparison
16- current_year=$( date +%Y)
1716six_months_ago=$( date -v-6m +%s 2> /dev/null || date -d ' 6 months ago' +%s)
1817
1918# First pass: collect data and find max filename length
@@ -47,7 +46,7 @@ while read -r item; do
4746
4847 # Track max length
4948 len=${# display_name}
50- [ $len -gt $max_len ] && max_len=$len
49+ [ " $len " -gt " $max_len " ] && max_len=$len
5150 fi
5251done <<< " $items"
5352
@@ -61,6 +60,6 @@ sort_opts="-r"
6160 IFS=' |' read -r name hash full_date date msg <<< " $line"
6261 printf " %s|%-${max_len} s|%s|%s|%s\n" " $full_date " " $name " " $hash " " $date " " $msg "
6362 done
64- ) | sort $sort_opts | while IFS=' |' read -r sortkey name hash date msg; do
63+ ) | sort $sort_opts | while IFS=' |' read -r _ name hash date msg; do
6564 printf " \033[32m%-${max_len} s\033[0m \033[33m%s\033[0m %s %s\n" " $name " " $hash " " $date " " $msg "
6665done
You can’t perform that action at this time.
0 commit comments