From d4bf79df8f329af8cd8ad2aa50a1fd60e0188bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=B3=BD=E8=BD=A9?= Date: Thu, 8 Feb 2018 22:34:43 +0800 Subject: [PATCH] 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. --- bin/git-summary | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/git-summary b/bin/git-summary index bfeec6f..5388866 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -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" } #