From 19f66943cbe857760305e20ae4b2b85f36a39fff Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Fri, 2 Oct 2015 08:35:04 -0400 Subject: [PATCH] git-summary: protect against character encoding issues with LC_ALL=C --- bin/git-line-summary | 2 +- bin/git-summary | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/git-line-summary b/bin/git-line-summary index 74c0166..940bd73 100755 --- a/bin/git-line-summary +++ b/bin/git-line-summary @@ -9,7 +9,7 @@ single_file() { while read data do if [[ $(file "$data") = *text* ]]; then - git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | sed -n 's/^author //p'; + git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | LC_ALL=C sed -n 's/^author //p'; fi done } diff --git a/bin/git-summary b/bin/git-summary index 33f21be..7643f10 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -1,5 +1,6 @@ #!/usr/bin/env bash + SUBDIRECTORY_OK=Yes source "$(git --exec-path)/git-sh-setup" cd_to_toplevel @@ -63,7 +64,7 @@ authors() { # repository_age() { - git log --reverse --pretty=oneline --format="%ar" | head -n 1 | sed 's/ago//' + git log --reverse --pretty=oneline --format="%ar" | head -n 1 | LC_ALL=C sed 's/ago//' } # summary