Do not lose author name information to locale gotchas.
authorJunio C Hamano <junkio@cox.net>
Fri, 11 Nov 2005 07:34:08 +0000 (23:34 -0800)
committerJunio C Hamano <junkio@cox.net>
Fri, 11 Nov 2005 08:37:34 +0000 (00:37 -0800)
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>
git-commit.sh
git-format-patch.sh
git-revert.sh

index daf90f1..41955e8 100755 (executable)
@@ -184,7 +184,7 @@ then
                }
                '
                set_author_env=`git-cat-file commit "$use_commit" |
-               sed -ne "$pick_author_script"`
+               LANG=C LC_ALL=C sed -ne "$pick_author_script"`
                eval "$set_author_env"
                export GIT_AUTHOR_NAME
                export GIT_AUTHOR_EMAIL
index 548d2d5..7ee5d32 100755 (executable)
@@ -201,7 +201,7 @@ process_one () {
            ;;
        esac
 
-       eval "$(sed -ne "$whosepatchScript" $commsg)"
+       eval "$(LANG=C LC_ALL=C sed -ne "$whosepatchScript" $commsg)"
        test "$author,$au" = ",$me" || {
                mailScript="$mailScript"'
        a\
index dfd914c..4154fe0 100755 (executable)
@@ -112,7 +112,7 @@ cherry-pick)
                q
        }'
        set_author_env=`git-cat-file commit "$commit" |
-       sed -ne "$pick_author_script"`
+       LANG=C LC_ALL=C sed -ne "$pick_author_script"`
        eval "$set_author_env"
        export GIT_AUTHOR_NAME
        export GIT_AUTHOR_EMAIL