@@ -37,6 +37,7 @@ rerere-autoupdate update the index with reused conflict resolution if possible rebasing*(internaluseforgit-rebase)" .git-sh-setup+.git-sh-i18nprefix=$(gitrev-parse--show-prefix) set_reflog_actionam require_work_tree
@@ -115,7 +115,7 @@ go_next () { cannot_fallback(){echo"$1"-echo"Cannot fall back to three-way merge."+gettext"Cannot fall back to three-way merge.";echoexit1}
@@ -645,7 +645,7 @@ doiftest-z"$GIT_AUTHOR_EMAIL"then-echo"Patch does not have a valid e-mail address."+gettext"Patch does not have a valid e-mail address.";echostop_here$thisfi
@@ -696,7 +696,7 @@ doaction=againwhiletest"$action"=againdo-echo"Commit Body is:"+gettext"Commit Body is:";echoecho"--------------------------"cat"$dotest/final-commit"echo"--------------------------"
@@ -757,16 +757,16 @@ do# working tree.resolved=gitdiff-index--quiet--cachedHEAD--&&{-echo"No changes - did you forget to use 'git add'?"-echo"If there is nothing left to stage, chances are that something else"-echo"already introduced the same changes; you might want to skip this patch."+gettext"No changes - did you forget to use 'git add'?+Ifthereisnothinglefttostage,chancesarethatsomethingelse+alreadyintroducedthesamechanges;youmightwanttoskipthispatch."; echostop_here_user_resolve$this}unmerged=$(gitls-files-u)iftest-n"$unmerged"then-echo"You still have unmerged paths in your index"-echo"did you forget to use 'git add'?"+gettext"You still have unmerged paths in your index+didyouforgettouse'git add'?"; echostop_here_user_resolve$thisfiapply_status=0
Messages that use variables to be interpolated need to use
eval_gettext(), this wrapper will eval the message and expand the
variable for us.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
@@ -99,9 +99,9 @@ stop_here_user_resolve () {printf'%s\n'"$resolvemsg"stop_here$1fi-echo"When you have resolved this problem run \"$cmdline --resolved\"."-echo"If you would prefer to skip this patch, instead run \"$cmdline --skip\"."-echo"To restore the original branch and stop patching run \"$cmdline --abort\"."+eval_gettext"When you have resolved this problem run \"\$cmdline --resolved\".+Ifyouwouldprefertoskipthispatch,insteadrun\"\$cmdline--skip\".+Torestoretheoriginalbranchandstoppatchingrun\"\$cmdline--abort\"."; echostop_here$1}
@@ -608,9 +608,9 @@ dogo_next&&continuetest-s"$dotest/patch"||{-echo"Patch is empty. Was it split wrong?"-echo"If you would prefer to skip this patch, instead run \"$cmdline --skip\"."-echo"To restore the original branch and stop patching run \"$cmdline --abort\"."+eval_gettext"Patch is empty. Was it split wrong?+Ifyouwouldprefertoskipthispatch,insteadrun\"\$cmdline--skip\".+Torestoretheoriginalbranchandstoppatchingrun\"\$cmdline--abort\"."; echostop_here$this}rm-f"$dotest/original-commit""$dotest/author-script"
@@ -89,8 +89,8 @@ safe_to_abort () {thenreturn0fi-echo>&2"You seem to have moved HEAD since the last 'am' failure."-echo>&2"Not rewinding to ORIG_HEAD"+echo>&2"$(gettext"You seem to have moved HEAD since the last 'am' failure.+NotrewindingtoORIG_HEAD")"return1}
Translate messages with gettext(1) before they're passed to the
cannot_fallback function, just like we handle the die function.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@@ -130,7 +130,7 @@ fall_back_3way () {"$dotest/patch"&&GIT_INDEX_FILE="$dotest/patch-merge-tmp-index"\gitwrite-tree>"$dotest/patch-merge-base+"||-cannot_fallback"Repository lacks necessary blobs to fall back on 3-way merge."+cannot_fallback"$(gettext"Repository lacks necessary blobs to fall back on 3-way merge.")"sayUsingindexinfotoreconstructabasetree...ifGIT_INDEX_FILE="$dotest/patch-merge-tmp-index"\
@@ -139,8 +139,8 @@ fall_back_3way () {mv"$dotest/patch-merge-base+""$dotest/patch-merge-base"mv"$dotest/patch-merge-tmp-index""$dotest/patch-merge-index"else-cannot_fallback"Did you hand edit your patch?-Itdoesnotapplytoblobsrecordedinitsindex."+cannot_fallback"$(gettext"Did you hand edit your patch?+Itdoesnotapplytoblobsrecordedinitsindex.")"fitest-f"$dotest/patch-merge-index"&&
Messages that used the clean_abort function needed both gettext(1) and
eval_gettext(). These need to be interpolated in a string like the die
and cannot_fallback messages.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@@ -255,7 +255,7 @@ split_patches () {stgit-series)iftest$#-ne1then-clean_abort"Only one StGIT patch series can be applied at once"+clean_abort"$(gettext"Only one StGIT patch series can be applied at once")"fiseries_dir=`dirname"$1"`series_file="$1"
@@ -307,9 +307,9 @@ split_patches () {;;*)iftest-n"$parse_patch";then-clean_abort"Patch format $patch_format is not supported."+clean_abort"$(eval_gettext"Patch format \$patch_format is not supported.")"else-clean_abort"Patch format detection failed."+clean_abort"$(gettext"Patch format detection failed.")"fi;;esac
The die messages in git-am need to use:
die "$(gettext "string")"
Since gettext(1) emits the message instead of returning it like the C
equivalent, and our die() function in git-sh-setup needs to get a
string as an argument.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
@@ -44,7 +44,7 @@ require_work_tree cd_to_toplevel gitvarGIT_COMMITTER_IDENT>/dev/null||-die"You need to set your committer info first"+die"$(gettext"You need to set your committer info first")"ifgitrev-parse--verify-qHEAD>/dev/nullthen
@@ -359,7 +359,7 @@ do--rebasing)rebasing=tthreeway=tkeep=tscissors=fno_inbody_headers=t;;-d|--dotest)-die"-d option is no longer supported. Do not use."+die"$(gettext"-d option is no longer supported. Do not use.")";;--resolvemsg)shift;resolvemsg=$1;;
@@ -422,12 +422,12 @@ thenfalse;;esac||-die"previous rebase directory $dotest still exists but mbox given."+die"$(eval_gettext"previous rebase directory \$dotest still exists but mbox given.")"resume=yescase"$skip,$abort"int,t)-die"Please make up your mind. --skip or --abort?"+die"$(gettext"Please make up your mind. --skip or --abort?")";;t,)gitrerereclear
@@ -454,7 +454,7 @@ thenelse# Make sure we are not given --skip, --resolved, nor --aborttest"$skip$resolved$abort"=""||-die"Resolve operation not in progress, we are not resuming."+die"$(gettext"Resolve operation not in progress, we are not resuming.")"# Start afresh.mkdir-p"$dotest"||exit
@@ -692,7 +692,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; eciftest"$interactive"=tthentest-t0||-die"cannot be interactive without stdin connected to a terminal."+die"$(gettext"cannot be interactive without stdin connected to a terminal.")"action=againwhiletest"$action"=againdo
@@ -18,20 +18,20 @@ cd_to_toplevel die_conflict(){gitdiff-index--cached--name-status-r--ignore-submodulesHEAD--if[$(gitconfig--bool--getadvice.resolveConflict||echotrue)="true"];then-die"Pull is not possible because you have unmerged files.+die"$(gettext"Pull is not possible because you have unmerged files. Please,fixthemupintheworktree,andthenuse'git add/rm <file>'-asappropriatetomarkresolution,oruse'git commit -a'."+asappropriatetomarkresolution,oruse'git commit -a'.")"else-die"Pull is not possible because you have unmerged files."+die"$(gettext"Pull is not possible because you have unmerged files.")"fi} die_merge(){if[$(gitconfig--bool--getadvice.resolveConflict||echotrue)="true"];then-die"You have not concluded your merge (MERGE_HEAD exists).-Please,commityourchangesbeforeyoucanmerge."+die"$(gettext"You have not concluded your merge (MERGE_HEAD exists).+Please,commityourchangesbeforeyoucanmerge.")"else-die"You have not concluded your merge (MERGE_HEAD exists)."+die"$(gettext"You have not concluded your merge (MERGE_HEAD exists).")"fi}
@@ -186,7 +186,7 @@ test true = "$rebase" && {# On an unborn branchiftest-f"$GIT_DIR/index"then-die"updating an unborn branch with changes added to the index"+die"$(gettext"updating an unborn branch with changes added to the index")"fielserequire_clean_work_tree"pull with rebase""Please commit or stash them."
@@ -242,11 +242,11 @@ case "$merge_head" in ?*' '?*)iftest-z"$orig_head"then-die"Cannot merge multiple branches into empty head"+die"$(gettext"Cannot merge multiple branches into empty head")"fiiftesttrue="$rebase"then-die"Cannot rebase onto multiple branches"+die"$(gettext"Cannot rebase onto multiple branches")"fi;;esac
@@ -9,6 +9,7 @@ LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEASUBDIRECTORY_OK=YesOPTIONS_SPEC= .git-sh-setup+.git-sh-i18n set_reflog_action"pull $*" require_work_tree cd_to_toplevel
@@ -234,7 +234,7 @@ cmd_add()theniftest-d"$path"/.git-o-f"$path"/.gitthen-echo"Adding existing repo at '$path' to the index"+echo"$(eval_gettext"Adding existing repo at '\$path' to the index")"elsedie"'$path' already exists and is not a valid git repo"fi
Gettextize $update_module say and die messages. These messages needed
to be split up to make them translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 17 ++++++++---------
t/t7406-submodule-update.sh | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
@@ -511,24 +511,23 @@ cmd_update()case"$update_module"inrebase)command="git rebase"-action="rebase"-msg="rebased onto"+die_msg="$(eval_gettext"Unable to rebase '\$sha1' in submodule path '\$path'")"+say_msg="$(eval_gettext"Submodule path '\$path': rebased into '\$sha1'")";;merge)command="git merge"-action="merge"-msg="merged in"+die_msg="$(eval_gettext"Unable to merge '\$sha1' in submodule path '\$path'")"+say_msg="$(eval_gettext"Submodule path '\$path': merged in '\$sha1'")";;*)command="git checkout $subforce -q"-action="checkout"-msg="checked out"+die_msg="$(eval_gettext"Unable to checkout '\$sha1' in submodule path '\$path'")"+say_msg="$(eval_gettext"Submodule path '\$path': checked out '\$sha1'")";;esac-(clear_local_git_env;cd"$path"&&$command"$sha1")||-die"Unable to $action '$sha1' in submodule path '$path'"-say"Submodule path '$path': $msg '$sha1'"+(clear_local_git_env;cd"$path"&&$command"$sha1")||die$die_msg+say$say_msgfiiftest-n"$recursive"
Gettextize the "Entering [...]" message. This is explicitly tested for
so we need to skip a portion of a test with test_i18ncmp.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 2 +-
t/t7407-submodule-foreach.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Gettextize the "--cached cannot be used with --files" message. Since
this message starts with "--" we have to pass "--" as the first
argument. This works with both GNU gettext 0.18.1 (as expected), and
the gettext(1) on Solaris 10.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -617,7 +617,7 @@ cmd_summary() {if[-n"$files"]thentest-n"$cached"&&-die"--cached cannot be used with --files"+die"$(gettext--"--cached cannot be used with --files")"diff_cmd=diff-fileshead=fi
Convert a message that used printf(1) format to use eval_gettext. It's
easier for translators to handle the latter, since the eval format
automatically gives them context via variable names.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -794,7 +794,7 @@ did you forget to use 'git add'?"; echofiiftest$apply_status!=0then-printf'Patch failed at %s %s\n'"$msgnum""$FIRSTLINE"+eval_gettext'Patch failed at $msgnum $FIRSTLINE';echostop_here_user_resolve$thisfi
@@ -35,7 +35,7 @@ resolve_relative_url (){remote=$(get_default_remote)remoteurl=$(gitconfig"remote.$remote.url")||-die"remote ($remote) does not have a url defined in .git/config"+die"$(eval_gettext"remote (\$remote) does not have a url defined in .git/config")"url="$1"remoteurl=${remoteurl%/}sep=/
@@ -53,7 +53,7 @@ resolve_relative_url ()sep=:;;*)-die"cannot strip one component off url '$remoteurl'"+die"$(eval_gettext"cannot strip one component off url '\$remoteurl'")";;esac;;
@@ -105,7 +105,7 @@ module_name()name=$(gitconfig-f.gitmodules--get-regexp'^submodule\..*\.path$'|sed-n-e's|^submodule\.\(.*\)\.path '"$re"'$|\1|p')test-z"$name"&&-die"No submodule mapping found in .gitmodules for path '$path'"+die"$(eval_gettext"No submodule mapping found in .gitmodules for path '\$path'")"echo"$name"}
@@ -129,7 +129,7 @@ module_clone()elsegit-clone-n"$url""$path"fi||-die"Clone of '$url' into submodule path '$path' failed"+die"$(eval_gettext"Clone of '\$url' into submodule path '\$path' failed")"}#
@@ -202,7 +202,7 @@ cmd_add()realrepo=$repo;;*)-die"repo URL: '$repo' must be absolute or begin with ./|../"+die"$(eval_gettext"repo URL: '\$repo' must be absolute or begin with ./|../")";;esac
@@ -219,7 +219,7 @@ cmd_add()s|/*$||')gitls-files--error-unmatch"$path">/dev/null2>&1&&-die"'$path' already exists in the index"+die"$(eval_gettext"'\$path' already exists in the index")"iftest-z"$force"&&!gitadd--dry-run--ignore-missing"$path">/dev/null2>&1then
@@ -236,7 +236,7 @@ cmd_add()thenecho"$(eval_gettext"Adding existing repo at '\$path' to the index")"else-die"'$path' already exists and is not a valid git repo"+die"$(eval_gettext"'\$path' already exists and is not a valid git repo")"ficase"$repo"in
@@ -259,16 +259,16 @@ cmd_add()'')gitcheckout-f-q;;?*)gitcheckout-f-q-B"$branch""origin/$branch";;esac-)||die"Unable to checkout submodule '$path'"+)||die"$(eval_gettext"Unable to checkout submodule '\$path'")"figitadd$force"$path"||-die"Failed to add submodule '$path'"+die"$(eval_gettext"Failed to add submodule '\$path'")"gitconfig-f.gitmodulessubmodule."$path".path"$path"&&gitconfig-f.gitmodulessubmodule."$path".url"$repo"&&gitadd--force.gitmodules||-die"Failed to register submodule '$path'"+die"$(eval_gettext"Failed to register submodule '\$path'")"}#
@@ -318,7 +318,7 @@ cmd_foreach()cmd_foreach"--recursive""$@"fi)||-die"Stopping at '$path'; script returned non-zero status."+die"$(eval_gettext"Stopping at '\$path'; script returned non-zero status.")"fidone}
@@ -361,7 +361,7 @@ cmd_init()url=$(gitconfig-f.gitmodulessubmodule."$name".url)test-z"$url"&&-die"No url found for submodule path '$path' in .gitmodules"+die"$(eval_gettext"No url found for submodule path '\$path' in .gitmodules")"# Possibly a url relative to parentcase"$url"in
@@ -371,14 +371,14 @@ cmd_init()esacgitconfigsubmodule."$name".url"$url"||-die"Failed to register url for submodule path '$path'"+die"$(eval_gettext"Failed to register url for submodule path '\$path'")"upd="$(gitconfig-f.gitmodulessubmodule."$name".update)"test-z"$upd"||gitconfigsubmodule."$name".update"$upd"||-die"Failed to register update mode for submodule path '$path'"+die"$(eval_gettext"Failed to register update mode for submodule path '\$path'")"-say"Submodule '$name' ($url) registered for path '$path'"+say"$(eval_gettext"Submodule '\$name' (\$url) registered for path '\$path'")"done}
@@ -474,7 +474,7 @@ cmd_update()elsesubsha1=$(clear_local_git_env;cd"$path"&&gitrev-parse--verifyHEAD)||-die"Unable to find current revision in submodule path '$path'"+die"$(eval_gettext"Unable to find current revision in submodule path '\$path'")"fiif!test-z"$update"
@@ -498,7 +498,7 @@ cmd_update()(clear_local_git_env;cd"$path"&&((rev=$(gitrev-list-n1$sha1--not--all2>/dev/null)&&test-z"$rev")||git-fetch))||-die"Unable to fetch in submodule path '$path'"+die"$(eval_gettext"Unable to fetch in submodule path '\$path'")"fi# Is this something we just cloned?
@@ -534,7 +534,7 @@ cmd_update()iftest-n"$recursive"then(clear_local_git_env;cd"$path"&&evalcmd_update"$orig_flags")||-die"Failed to recurse into submodule path '$path'"+die"$(eval_gettext"Failed to recurse into submodule path '\$path'")"fidone}
@@ -831,7 +831,7 @@ cmd_status()cd"$path"&&evalcmd_status"$orig_args")||-die"Failed to recurse into submodule path '$path'"+die"$(eval_gettext"Failed to recurse into submodule path '\$path'")"fidone}
Gettextize the words "blob" and "submodule", which will be
interpolated in a message emitted by git-submodule. This is
explicitly tested for so we need to skip a portion of a test with
test_i18ncmp.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 6 ++++--
t/t7401-submodule-summary.sh | 8 ++++----
2 files changed, 8 insertions(+), 6 deletions(-)
Gettextize the "Submodule path '$path' not initialized" message. This
is explicitly tested for so we need to skip a portion of a test with
test_i18grep.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 4 ++--
t/t7400-submodule-basic.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -461,8 +461,8 @@ cmd_update()# Only mention uninitialized submodules when its# path have been specifiedtest"$#"!="0"&&-say"Submodule path '$path' not initialized"&&-say"Maybe you want to use 'update --init'?"+say"$(eval_gettext"Submodule path '\$path' not initialized+Maybeyouwanttouse'update --init'?")"continuefi
@@ -40,7 +40,7 @@ no_changes () { clear_stash(){iftest$#!=0then-die"git stash clear with parameters is unimplemented"+die"$(gettext"git stash clear with parameters is unimplemented")"fiifcurrent=$(gitrev-parse--verify$ref_stash2>/dev/null)then
@@ -62,7 +62,7 @@ create_stash () {thenhead=$(gitrev-list--oneline-n1HEAD--)else-die"You do not have the initial commit yet"+die"$(gettext"You do not have the initial commit yet")"fiifbranch=$(gitsymbolic-ref-qHEAD)
@@ -77,7 +77,7 @@ create_stash () {i_tree=$(gitwrite-tree)&&i_commit=$(printf'index on %s\n'"$msg"|gitcommit-tree$i_tree-p$b_commit)||-die"Cannot save the current index state"+die"$(gettext"Cannot save the current index state")"iftest-z"$patch_mode"then
@@ -91,7 +91,7 @@ create_stash () {gitwrite-tree&&rm-f"$TMPindex"))||-die"Cannot save the current worktree state"+die"$(gettext"Cannot save the current worktree state")"else
@@ -104,14 +104,14 @@ create_stash () {# state of the working treew_tree=$(GIT_INDEX_FILE="$TMP-index"gitwrite-tree)||-die"Cannot save the current worktree state"+die"$(gettext"Cannot save the current worktree state")"gitdiff-tree-pHEAD$w_tree>"$TMP-patch"&&test-s"$TMP-patch"||-die"No changes selected"+die"$(gettext"No changes selected")"rm-f"$TMP-index"||-die"Cannot remove temporary index (can't happen)"+die"$(gettext"Cannot remove temporary index (can't happen)")"fi
@@ -124,7 +124,7 @@ create_stash () {fiw_commit=$(printf'%s\n'"$stash_msg"|gitcommit-tree$w_tree-p$b_commit-p$i_commit)||-die"Cannot record working tree state"+die"$(gettext"Cannot record working tree state")"} save_stash(){
@@ -180,7 +180,7 @@ save_stash () {:>>"$GIT_DIR/logs/$ref_stash"gitupdate-ref-m"$stash_msg"$ref_stash$w_commit||-die"Cannot save the current status"+die"$(gettext"Cannot save the current status")"saySavedworkingdirectoryandindexstate"$stash_msg"iftest-z"$patch_mode"
@@ -336,11 +336,11 @@ apply_stash () {assert_stash_like"$@"-gitupdate-index-q--refresh||die'unable to refresh index'+gitupdate-index-q--refresh||die"$(gettext"unable to refresh index")"# current index statec_tree=$(gitwrite-tree)||-die'Cannot apply a stash in the middle of a merge'+die"$(gettext"Cannot apply a stash in the middle of a merge")"unstashed_index_tree=iftest-n"$INDEX_OPTION"&&test"$b_tree"!="$i_tree"&&
@@ -348,9 +348,9 @@ apply_stash () {thengitdiff-tree--binary$s^2^..$s^2|gitapply--cachedtest$?-ne0&&-die'Conflicts in index. Try without --index.'+die"$(gettext"Conflicts in index. Try without --index.")"unstashed_index_tree=$(gitwrite-tree)||-die'Could not save index tree'+die"$(gettext"Could not save index tree")"gitresetfi
Gettextize the say/die eval_gettext messages in the drop_stash
function. Since making these translatable would result in a long line
I've wrapped this into two lines.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-stash.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
@@ -422,7 +422,8 @@ drop_stash () {assert_stash_ref"$@"gitreflogdelete--updateref--rewrite"${REV}"&&-say"Dropped ${REV} ($s)"||die"${REV}: Could not drop stash entry"+say"$(eval_gettext"Dropped \${REV} (\$s)")"||+die"$(eval_gettext"\${REV}: Could not drop stash entry")"# clear_stash if we just dropped the last stash entrygitrev-parse--verify"$ref_stash@{0}">/dev/null2>&1||clear_stash
Gettextize a messages that used the $1 variable. Since it's subroutine
local we have to provide an alias for it for eval_gettext.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-stash.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
@@ -299,7 +299,10 @@ parse_flags_and_rev();;esac-REV=$(gitrev-parse--quiet--symbolic--verify$12>/dev/null)||die"$1 is not valid reference"+REV=$(gitrev-parse--quiet--symbolic--verify$12>/dev/null)||{+reference="$1"+die"$(eval_gettext"\$reference is not valid reference")"+}i_commit=$(gitrev-parse--quiet--verify$REV^22>/dev/null)&&set--$(gitrev-parse$REV$REV^1$REV:$REV^1:$REV^2:2>/dev/null)&&
Gettextize the "unknown option for 'stash save'" message that's shown
on:
$ git stash save --blah-blah
error: unknown option for 'stash save': --blah-blah
To provide a message, use git stash save -- '--blah-blah'
Usage: git stash list [<options>]
In a translation the second line should be aligned with the first
one. I've added a TRANSLATORS comment to indicate this.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-stash.sh | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
@@ -152,8 +152,14 @@ save_stash () {break;;-*)-echo"error: unknown option for 'stash save': $1"-echo" To provide a message, use git stash save -- '$1'"+option="$1"+# TRANSLATORS: $option is an invalid option, like+# `--blah-blah'. The 7 spaces at the beginning of the+# second line correspond to "error: ". So you should line+# up the second line with however many characters the+# translation of "error: " takes in your language.+eval_gettext"$("error: unknown option for 'stash save': \$option+Toprovideamessage,usegitstashsave--'\$option'")";echousage;;*)
@@ -28,6 +28,7 @@ Please use "git help bisect" to get the full man page.'OPTIONS_SPEC= .git-sh-setup+.git-sh-i18n require_work_tree_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
ettextize bisect_reset messages that use the $1 variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-bisect.sh | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
@@ -313,8 +313,10 @@ bisect_reset() {}case"$#"in0)branch=$(cat"$GIT_DIR/BISECT_START");;-1)gitrev-parse--quiet--verify"$1^{commit}">/dev/null||-die"'$1' is not a valid commit"+1)gitrev-parse--quiet--verify"$1^{commit}">/dev/null||{+invalid="$1"+die"$(eval_gettext"'\$invalid' is not a valid commit")"+}branch="$1";;*)usage;;
@@ -111,7 +111,7 @@ bisect_start() {*)rev=$(gitrev-parse-q--verify"$arg^{commit}")||{test$has_double_dash-eq1&&-die"'$arg' does not appear to be a valid revision"+die"$(eval_gettext"'\$arg' does not appear to be a valid revision")"break}case$bad_seenin
@@ -322,8 +322,8 @@ bisect_reset() {ifgitcheckout"$branch"--;thenbisect_clean_stateelse-die"Could not check out original HEAD '$branch'."\-"Try 'git bisect reset <commit>'."+die"$(eval_gettext"Could not check out original HEAD '\$branch'.+Try'git bisect reset <commit>'.")"fi}
Gettextize the [Y/n] questions git-bisect presents, and leave a note
in a TRANSLATORS comment explaining that translators have to preserve
a mention of the Y/n characters since the program will expect them,
and not their localized equivalents.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-bisect.sh | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
@@ -39,7 +39,10 @@ bisect_autostart() {echo>&2"$(gettext"You need to start by \"git bisect start\"")"iftest-t0then-echo>&2-n'Do you want me to do it for you [Y/n]? '+# TRANSLATORS: Make sure to include [Y] and [n] in your+# translation. The program will only accept English input+# at this point.+echo>&2-n"$(gettext"Do you want me to do it for you [Y/n]? ")"readyesnocase"$yesno"in[Nn]*)
@@ -242,7 +245,10 @@ bisect_next_check() {echo>&2"$(gettext"Warning: bisecting only with a bad commit.")"iftest-t0then-printf>&2'Are you sure [Y/n]? '+# TRANSLATORS: Make sure to include [Y] and [n] in your+# translation. The program will only accept English input+# at this point.+printf>&2"$(gettext"Are you sure [Y/n]? ")"readyesnocase"$yesno"in[Nn]*)exit1;;esacfi
Gettextize the "You need to start by" message in
bisect_next_check. This message assembled English output by hand so it
needed to be split up to make it translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-bisect.sh | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
@@ -255,15 +255,16 @@ bisect_next_check() {:bisectwithoutgood...;;*)-THEN=''-test-s"$GIT_DIR/BISECT_START"||{-echo>&2'You need to start by "git bisect start".'-THEN='then '-}-echo>&2'You '$THEN'need to give me at least one good'\-'and one bad revisions.'-echo>&2'(You can use "git bisect bad" and'\-'"git bisect good" for that.)'++iftest-s"$GIT_DIR/BISECT_START"+then+echo>&2"$(gettext"You need to give me at least one good and one bad revisions.+(Youcanuse\"gitbisectbad\"and\"gitbisectgood\"forthat.)")"+else+echo>&2"$(gettext"You need to start by \"git bisect start\".+Youthenneedtogivemeatleastonegoodandonebadrevisions.+(Youcanuse\"gitbisectbad\"and\"gitbisectgood\"forthat.)")"+fiexit1;;esac}
Gettextize the "Submodules changed but not updated" and "Submodule
changes to be committed" messages. This is explicitly tested for so we
need to skip a portion of a test with test_i18ncmp.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 4 ++--
t/t7401-submodule-summary.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -742,9 +742,9 @@ cmd_summary() {done|iftest-n"$for_status";thenif[-n"$files"];then-echo"# Submodules changed but not updated:"+gettext"# Submodules changed but not updated:";echoelse-echo"# Submodule changes to be committed:"+gettext"# Submodule changes to be committed:";echofiecho"#"sed-e's|^|# |'-e's|^# $|#|'
@@ -58,7 +58,7 @@ bisect_start() {#head=$(GIT_DIR="$GIT_DIR"gitsymbolic-ref-qHEAD)||head=$(GIT_DIR="$GIT_DIR"gitrev-parse--verifyHEAD)||-die"Bad HEAD - I need a HEAD"+die"$(gettext"Bad HEAD - I need a HEAD")"## Check if we are bisecting.
@@ -77,11 +77,11 @@ bisect_start() {# cogito usage, and cogito users should understand# it relates to cg-seek.[-s"$GIT_DIR/head-name"]&&-die"won't bisect on seeked tree"+die"$(gettext"won't bisect on seeked tree")"start_head="${head#refs/heads/}";;*)-die"Bad HEAD - strange symbolic ref"+die"$(gettext"Bad HEAD - strange symbolic ref")";;esacfi
@@ -198,10 +198,10 @@ bisect_state() {state=$1case"$#,$state"in0,*)-die"Please call 'bisect_state' with at least one argument.";;+die"$(gettext"Please call 'bisect_state' with at least one argument.")";;1,bad|1,good|1,skip)rev=$(gitrev-parse--verifyHEAD)||-die"Bad rev input: HEAD"+die"$(gettext"Bad rev input: HEAD")"bisect_write"$state""$rev"check_expected_revs"$rev";;2,bad|*,good|*,skip)
@@ -216,7 +216,7 @@ bisect_state() {eval"$eval"check_expected_revs"$@";;*,bad)-die"'git bisect bad' can take only one argument.";;+die"$(gettext"'git bisect bad' can take only one argument.")";;*)usage;;esac
@@ -363,7 +363,7 @@ bisect_replay () {good|bad|skip)bisect_write"$command""$rev";;*)-die"?? what are you talking about?";;+die"$(gettext"?? what are you talking about?")";;esacdone<"$1"bisect_auto_next
@@ -422,7 +422,7 @@ bisect_run () {} bisect_log(){-test-s"$GIT_DIR/BISECT_LOG"||die"We are not bisecting."+test-s"$GIT_DIR/BISECT_LOG"||die"$(gettext"We are not bisecting.")"cat"$GIT_DIR/BISECT_LOG"}
Gettextize bisect_run messages that use the $@ variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-bisect.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
@@ -374,14 +374,15 @@ bisect_run () {whiletruedo-echo"running $@"+command="$@"+eval_gettext"running \$command";echo"$@"res=$?# Check for really bad run error.if[$res-lt0-o$res-ge128];then-echo>&2"bisect run failed:"-echo>&2"exit code $res from '$@' is < 0 or >= 128"+echo>&2"$(eval_gettext"bisect run failed:+exitcode\$resfrom'\$command'is<0or>=128")"exit$resfi
Gettextize bisect_replay messages that use the $1 variable. Since it's
subroutine local we have to provide an alias for it for eval_gettext.
Since I was doing that anyway I've changed all other uses of $1
variable to use the alias variable for clarity.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-bisect.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Gettextize messages that used the $* variable. Since it's subroutine
local we have to provide an alias for it for eval_gettext.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-stash.sh | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
@@ -321,7 +321,10 @@ is_stash_like()} assert_stash_like(){-is_stash_like"$@"||die"'$*' is not a stash-like commit"+is_stash_like"$@"||{+args="$*"+die"$(eval_gettext"'\$args' is not a stash-like commit")"+}} is_stash_ref(){
@@ -329,7 +332,10 @@ is_stash_ref() {} assert_stash_ref(){-is_stash_ref"$@"||die"'$*' is not a stash reference"+is_stash_ref"$@"||{+args="$*"+die"$(eval_gettext"'\$args' is not a stash reference")"+}} apply_stash(){
@@ -308,7 +308,7 @@ bisect_visualize() { bisect_reset(){test-s"$GIT_DIR/BISECT_START"||{-echo"We are not bisecting."+gettext"We are not bisecting.";echoreturn}case"$#"in
@@ -414,7 +414,7 @@ bisect_run () {fiifsane_grep"is the first bad commit""$GIT_DIR/BISECT_RUN">/dev/null;then-echo"bisect run success"+gettext"bisect run success";echoexit0;fi
@@ -390,7 +390,7 @@ apply_stash () {status=$?iftest-n"$INDEX_OPTION"then-echo>&2'Index was not unstashed.'+echo>&2"$(gettext"Index was not unstashed.")"fiexit$statusfi
@@ -168,7 +168,7 @@ save_stash () {gitupdate-index-q--refreshifno_changesthen-say'No local changes to save'+say"$(gettext"No local changes to save")"exit0fitest-f"$GIT_DIR/logs/$ref_stash"||
@@ -485,7 +485,7 @@ branch)case$#in0)save_stash&&-say'(To restore them type "git stash apply")'+say"$(gettext"(To restore them type \"git stash apply\")")";;*)usage
@@ -217,9 +217,9 @@ then# $orig_head commit, but we are merging into $curr_head.# First update the working tree to match $curr_head.-echo>&2"Warning: fetch updated the current branch head."-echo>&2"Warning: fast-forwarding your working tree from"-echo>&2"Warning: commit $orig_head."+echo>&2"$(eval_gettext"Warning: fetch updated the current branch head.+Warning:fast-forwardingyourworkingtreefrom+Warning:commit\$orig_head.")"gitupdate-index-q--refreshgitread-tree-u-m"$orig_head""$curr_head"||die"$(eval_gettext"Cannot fast-forward your working tree.
@@ -36,7 +36,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" bisect_autostart(){test-s"$GIT_DIR/BISECT_START"||{-echo>&2'You need to start by "git bisect start"'+echo>&2"$(gettext"You need to start by \"git bisect start\"")"iftest-t0thenecho>&2-n'Do you want me to do it for you [Y/n]? '
@@ -239,7 +239,7 @@ bisect_next_check() {t,,good)# have bad but not good. we could bisect although# this is less optimum.-echo>&2'Warning: bisecting only with a bad commit.'+echo>&2"$(gettext"Warning: bisecting only with a bad commit.")"iftest-t0thenprintf>&2'Are you sure [Y/n]? '
@@ -403,7 +403,7 @@ bisect_run () {ifsane_grep"first bad commit could be any of""$GIT_DIR/BISECT_RUN"\>/dev/null;then-echo>&2"bisect run cannot continue any more"+echo>&2"$(gettext"bisect run cannot continue any more")"exit$resfi
Gettextize warning messages stored in the $errmsg variable using
eval_gettext interpolation. This is explicitly tested for so we
need to skip a portion of a test with test_i18ncmp.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 6 +++---
t/t7401-submodule-summary.sh | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
Make the core git-am messages that use say() translatable. These are
visible on almost every git am invocation.
There are tests that depend on the "Applying" output that need to be
changed to use the test_i18* functions along with this translation.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 6 +++---
t/t4150-am.sh | 2 +-
t/t4151-am-abort.sh | 5 +++--
3 files changed, 7 insertions(+), 6 deletions(-)
@@ -739,7 +739,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ecstop_here$thisfi-say"Applying: $FIRSTLINE"+say"$(eval_gettext"Applying: \$FIRSTLINE")"case"$resolved"in'')
@@ -784,7 +784,7 @@ did you forget to use 'git add'?"; echo# Applying the patch to an earlier tree and merging the# result may have produced the same tree as ours.gitdiff-index--quiet--cachedHEAD--&&{-sayNochanges--Patchalreadyapplied.+say"$(gettext"No changes -- Patch already applied.")"go_nextcontinue}
@@ -810,7 +810,7 @@ did you forget to use 'git add'?"; echoGIT_AUTHOR_DATE=fiparent=$(gitrev-parse--verify-qHEAD)||-say>&2"applying to an empty history"+say>&2"$(gettext"applying to an empty history")"iftest-n"$committer_date_is_author_date"then
Make the "Falling back to patching base and 3-way merge..." message
used by fall_back_3way() translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -148,7 +148,7 @@ It does not apply to blobs recorded in its index.")"orig_tree=$(cat"$dotest/patch-merge-base")&&rm-fr"$dotest"/patch-merge-*||exit1-sayFallingbacktopatchingbaseand3-waymerge...+say"$(gettext"Falling back to patching base and 3-way merge...")"# This is not so wrong. Depending on which base we picked,# orig_tree may be wildly different from ours, but his_tree
Make the "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all" message
translatable, and leave a note in a TRANSLATORS comment explaining
that translators have to preserve a mention of the y/n/e/v/a
characters since the program will expect them, and not their
localized equivalents.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-am.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
@@ -700,7 +700,10 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ececho"--------------------------"cat"$dotest/final-commit"echo"--------------------------"-printf"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "+# TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]+# in your translation. The program will only accept English+# input at this point.+gettext"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "readreplycase"$reply"in[yY]*)action=yes;;
Gettextize the "The following path is ignored" message. This is
explicitly tested for so we need to skip a portion of a test with
test_i18ncmp.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-submodule.sh | 6 +++---
t/t7400-submodule-basic.sh | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -223,9 +223,9 @@ cmd_add()iftest-z"$force"&&!gitadd--dry-run--ignore-missing"$path">/dev/null2>&1then-echo>&2"The following path is ignored by one of your .gitignore files:"&&-echo>&2$path&&-echo>&2"Use -f if you really want to add it."+echo>&2"$(eval_gettext"The following path is ignored by one of your .gitignore files:+\$path+Use-fifyoureallywanttoaddit.")"exit1fi
From: Motiejus Jakštys <hidden> Date: 2016-06-15 22:51:11
On Sun, May 08, 2011 at 12:21:08PM +0000, Ævar Arnfjörð Bjarmason wrote:
Gettextize the "unknown option for 'stash save'" message that's shown
on:
$ git stash save --blah-blah
error: unknown option for 'stash save': --blah-blah
To provide a message, use git stash save -- '--blah-blah'
Usage: git stash list [<options>]
In a translation the second line should be aligned with the first
one. I've added a TRANSLATORS comment to indicate this.
I think the commit message should be included to the message for the
translators. Like this:
@@ -152,8 +152,14 @@ save_stash () {break;;-*)-echo"error: unknown option for 'stash save': $1"-echo" To provide a message, use git stash save -- '$1'"+option="$1"+# TRANSLATORS: $option is an invalid option, like+# `--blah-blah'. The 7 spaces at the beginning of the+# second line correspond to "error: ". So you should line+# up the second line with however many characters the+# translation of "error: " takes in your language. In other+# words, second line should be aligned with the first one.+eval_gettext"$("error: unknown option for 'stash save': \$option+Toprovideamessage,usegitstashsave--'\$option'")";echousage;;*)
@@ -217,9 +217,9 @@ then# $orig_head commit, but we are merging into $curr_head.# First update the working tree to match $curr_head.-echo>&2"Warning: fetch updated the current branch head."-echo>&2"Warning: fast-forwarding your working tree from"-echo>&2"Warning: commit $orig_head."+echo>&2"$(eval_gettext"Warning: fetch updated the current branch head.+Warning:fast-forwardingyourworkingtreefrom+Warning:commit\$orig_head.")"
echo "$(...)"
sounds quite wasteful and harder to read than necessary.
The same also happens in later patches.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:51:13
Am 5/8/2011 14:20, schrieb Ævar Arnfjörð Bjarmason:
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
On Windows, we have a problem with messages like this (and many others)
that reference $path. eval_gettext has to export 'path', but on Windows
environment variables are case-insensitive. In the substitution, this
happens to pick the value of 'PATH' rather than of 'path'... Can you do
something about this?
Of course, the problem is not limited to 'path' at all, but it is a
prominent example discovered by the test suite.
-- Hannes
On Thu, May 12, 2011 at 10:08, Johannes Sixt [off-list ref] wrote:
Am 5/8/2011 14:20, schrieb Ævar Arnfjörð Bjarmason:
quoted
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
On Windows, we have a problem with messages like this (and many others)
that reference $path. eval_gettext has to export 'path', but on Windows
environment variables are case-insensitive. In the substitution, this
happens to pick the value of 'PATH' rather than of 'path'... Can you do
something about this?
Of course, the problem is not limited to 'path' at all, but it is a
prominent example discovered by the test suite.
I didn't know Windows had that limitation. We can easily work around
it by just renaming $path to something else (e.g. $filepath).
Since we do:
export PATH $(git sh-i18n--envsubst --variables "$1");
I assume this problem only occurs with variables that match
/^path$/i. Or are there other problems on Windows?
I don't have a Windows machine, and I'm not about to buy a license. So
getting the output of the failing test suite would be very useful if
this happens for variables other than $path.
If it's only $path I'll just change it to something else and include
that change in v2 of the series.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:51:13
Am 5/12/2011 15:48, schrieb Ævar Arnfjörð Bjarmason:
On Thu, May 12, 2011 at 10:08, Johannes Sixt [off-list ref] wrote:
quoted
Am 5/8/2011 14:20, schrieb Ævar Arnfjörð Bjarmason:
quoted
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
On Windows, we have a problem with messages like this (and many others)
that reference $path. eval_gettext has to export 'path', but on Windows
environment variables are case-insensitive. In the substitution, this
happens to pick the value of 'PATH' rather than of 'path'... Can you do
something about this?
Of course, the problem is not limited to 'path' at all, but it is a
prominent example discovered by the test suite.
I didn't know Windows had that limitation. We can easily work around
it by just renaming $path to something else (e.g. $filepath).
Since we do:
export PATH $(git sh-i18n--envsubst --variables "$1");
I assume this problem only occurs with variables that match
/^path$/i. Or are there other problems on Windows?
It is *not* limited to PATH. There can be other variables in the
environment that are the same name as some that are exported in this
statement. Here's a brief test:
Particularly PROMPT and USERNAME appear regularly in the environment and
are rather generic names likely to be used in scripts as (non-exported)
variables. For exposition, these are the environment variables that I use
in production:
ALLUSERSPROFILE
APPDATA
CLIENTNAME
CommonProgramFiles
COMPUTERNAME
ComSpec
FP_NO_HOST_CHECK
GIT_EDITOR
HOME
HOMEDRIVE
HOMEPATH
LESS
LOGONSERVER
MSYSDIR
NUMBER_OF_PROCESSORS
OS
OS_ROOTDIR
OS_TMPDIR
Path
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
ProgramFiles
PROMPT
SESSIONNAME
SystemDrive
SystemRoot
TEMP
TERM
TMP
USERDOMAIN
USERNAME
USERPROFILE
VS100COMNTOOLS
VS90COMNTOOLS
windir
WXWIN
-- Hannes
On Thu, May 12, 2011 at 16:20, Johannes Sixt [off-list ref] wrote:
quoted hunk
Am 5/12/2011 15:48, schrieb Ævar Arnfjörð Bjarmason:
quoted
On Thu, May 12, 2011 at 10:08, Johannes Sixt [off-list ref] wrote:
quoted
Am 5/8/2011 14:20, schrieb Ævar Arnfjörð Bjarmason:
quoted
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
On Windows, we have a problem with messages like this (and many others)
that reference $path. eval_gettext has to export 'path', but on Windows
environment variables are case-insensitive. In the substitution, this
happens to pick the value of 'PATH' rather than of 'path'... Can you do
something about this?
Of course, the problem is not limited to 'path' at all, but it is a
prominent example discovered by the test suite.
I didn't know Windows had that limitation. We can easily work around
it by just renaming $path to something else (e.g. $filepath).
Since we do:
export PATH $(git sh-i18n--envsubst --variables "$1");
I assume this problem only occurs with variables that match
/^path$/i. Or are there other problems on Windows?
It is *not* limited to PATH. There can be other variables in the
environment that are the same name as some that are exported in this
statement. Here's a brief test:
That's interesting. I thought that the problem would only be with
PATH, since we'd clobber the other environment variables when we do
the export in git-sh-i18n.
But evidently not, but I don't quite grok why.
Anyway, this behavior seems un-POSIX compliant, and I'd been assuming
that our shell scripts were POSIX shellscripts when I wrote this.
But if we want to make this work on Windows I guess we can change
things like $path and $repo to $windows_me_harder_path and
$windows_me_harder_repo.
From: Erik Faye-Lund <hidden> Date: 2016-06-15 22:51:14
On Fri, May 13, 2011 at 10:21 AM, Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
On Thu, May 12, 2011 at 16:20, Johannes Sixt [off-list ref] wrote:
quoted
Am 5/12/2011 15:48, schrieb Ævar Arnfjörð Bjarmason:
quoted
On Thu, May 12, 2011 at 10:08, Johannes Sixt [off-list ref] wrote:
quoted
Am 5/8/2011 14:20, schrieb Ævar Arnfjörð Bjarmason:
quoted
- say "Submodule '$name' ($url) registered for path '$path'"
+ say "$(eval_gettext "Submodule '\$name' (\$url) registered for path '\$path'")"
On Windows, we have a problem with messages like this (and many others)
that reference $path. eval_gettext has to export 'path', but on Windows
environment variables are case-insensitive. In the substitution, this
happens to pick the value of 'PATH' rather than of 'path'... Can you do
something about this?
Of course, the problem is not limited to 'path' at all, but it is a
prominent example discovered by the test suite.
I didn't know Windows had that limitation. We can easily work around
it by just renaming $path to something else (e.g. $filepath).
Since we do:
export PATH $(git sh-i18n--envsubst --variables "$1");
I assume this problem only occurs with variables that match
/^path$/i. Or are there other problems on Windows?
It is *not* limited to PATH. There can be other variables in the
environment that are the same name as some that are exported in this
statement. Here's a brief test:
That's interesting. I thought that the problem would only be with
PATH, since we'd clobber the other environment variables when we do
the export in git-sh-i18n.
But evidently not, but I don't quite grok why.
Anyway, this behavior seems un-POSIX compliant, and I'd been assuming
that our shell scripts were POSIX shellscripts when I wrote this.
May I remind you of the first rule in Documentation/CodingGuidelines?
- Most importantly, we never say "It's in POSIX; we'll happily
ignore your needs should your system not conform to it."
We live in the real world.
On Fri, May 13, 2011 at 11:04, Erik Faye-Lund [off-list ref] wrote:
On Fri, May 13, 2011 at 10:21 AM, Ævar Arnfjörð Bjarmason
quoted
That's interesting. I thought that the problem would only be with
PATH, since we'd clobber the other environment variables when we do
the export in git-sh-i18n.
But evidently not, but I don't quite grok why.
Anyway, this behavior seems un-POSIX compliant, and I'd been assuming
that our shell scripts were POSIX shellscripts when I wrote this.
May I remind you of the first rule in Documentation/CodingGuidelines?
- Most importantly, we never say "It's in POSIX; we'll happily
ignore your needs should your system not conform to it."
We live in the real world.
I'm not saying we shouldn't work around it, I'll submit another series
which adds some unique prefix to all the environment variables.
I was just saying that I'd assumed that at least POSIX behavior for
environment variables could be relied upon.