Skip to content

Commit

Permalink
Do not lose author name information to locale gotchas.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 11, 2005
1 parent 605607c commit e3e291f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion git-commit.sh
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion git-format-patch.sh
Expand Up @@ -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\
Expand Down
2 changes: 1 addition & 1 deletion git-revert.sh
Expand Up @@ -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
Expand Down

0 comments on commit e3e291f

Please sign in to comment.