@matheusbsbs / matheus-bagliano / commits / e3e291fc07
Fork 0

Do not lose author name information to locale gotchas.

I noticed format-patch loses authorship information of Lukas' patch when I run git tools with LC_LANG set to ja_JP. It turns out that the sed script to set environment variables were not working on his name (encoded in UTF-8), which is unfortunate but technically correct. Force sed invocation under C locale because we always want literal byte semantics. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 10, 2005 at 23:34 UTC e3e291fc07b49b74bb655ca854bdb19e849e044c
3 files changed +3 -3
git-commit.sh
+1 -1
@@ -184,7 +184,7 @@ then
184 }
185 '
186 set_author_env=`git-cat-file commit "$use_commit" |
187 - sed -ne "$pick_author_script"`
187 + LANG=C LC_ALL=C sed -ne "$pick_author_script"`
188 eval "$set_author_env"
189 export GIT_AUTHOR_NAME
190 export GIT_AUTHOR_EMAIL
git-format-patch.sh
+1 -1
@@ -201,7 +201,7 @@ process_one () {
201 ;;
202 esac
203
204 - eval "$(sed -ne "$whosepatchScript" $commsg)"
204 + eval "$(LANG=C LC_ALL=C sed -ne "$whosepatchScript" $commsg)"
205 test "$author,$au" = ",$me" || {
206 mailScript="$mailScript"'
207 a\
git-revert.sh
+1 -1
@@ -112,7 +112,7 @@ cherry-pick)
112 q
113 }'
114 set_author_env=`git-cat-file commit "$commit" |
115 - sed -ne "$pick_author_script"`
115 + LANG=C LC_ALL=C sed -ne "$pick_author_script"`
116 eval "$set_author_env"
117 export GIT_AUTHOR_NAME
118 export GIT_AUTHOR_EMAIL