Skip to content

Commit 96e86a8

Browse files
committed
Merge pull request tj#460 from apjanke/summary-defensive-locale
git-summary: protect against character encoding issues with LC_ALL=C
2 parents 4698845 + 15e458d commit 96e86a8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bin/git-line-summary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ single_file() {
99
while read data
1010
do
1111
if [[ $(file "$data") = *text* ]]; then
12-
git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | sed -n 's/^author //p';
12+
git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | LC_ALL=C sed -n 's/^author //p';
1313
fi
1414
done
1515
}

bin/git-summary

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
34
SUBDIRECTORY_OK=Yes
45
source "$(git --exec-path)/git-sh-setup"
56
cd_to_toplevel
@@ -63,7 +64,7 @@ authors() {
6364
#
6465

6566
repository_age() {
66-
git log --reverse --pretty=oneline --format="%ar" | head -n 1 | sed 's/ago//'
67+
git log --reverse --pretty=oneline --format="%ar" | head -n 1 | LC_ALL=C sed 's/ago//'
6768
}
6869

6970
# summary

0 commit comments

Comments
 (0)