git-summary: unescape tab for linux column utility

git-summary: unescape tab for linux column utility

Linux column utility will escape tab if a separator is specified.
This problem is first reported in Fedora 27.
This commit is contained in:
罗泽轩 2018-02-08 22:34:43 +08:00 committed by GitHub
parent 16591d3788
commit d4bf79df8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,9 @@ file_count() {
#
authors() {
# a rare unicode character is used as separator to avoid conflicting with
# author name. However, Linux column utility will escape tab if separator
# specified, so we do unesaping after it.
git shortlog -n -s $commit | LC_ALL=C awk '
{ args[NR] = $0; sum += $0 }
END {
@ -54,7 +57,7 @@ authors() {
printf "%s♪%2.1f%%\n", args[i], 100 * args[i] / sum
}
}
' | column -t -s♪
' | column -t -s♪ | sed "s/\\\x09/\t/g"
}
#