{"thread":{"id":"27459","subject":"[PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","startedAt":"2011-05-25T23:19:48Z","lastAt":"2011-05-26T15:16:04Z","messageCount":11,"participants":["Ævar Arnfjörð Bjarmason","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"168731","messageId":"1306365594-22061-1-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":null,"subject":"[PATCH 0/6] i18n: Windows shellscript support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:48Z","receivedAt":"2011-05-25T23:19:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This series goes on top of the other shell script serieses and fixes\nthe issue with case insensitive environment variables on Windows by\ngiving all the variables passed to eval_gettext a prefix that's\nunlikely to clash with existing variables in the environment.\n\nWith this series the ab/i18n-sh-scripts series should be ready for\nmaster, since this fixes the last known issue with it.\n\nÆvar Arnfjörð Bjarmason (6):\n  i18n win32: add git-am eval_gettext variable prefix\n  i18n win32: add git-bisect eval_gettext variable prefix\n  i18n win32: add git-pull eval_gettext variable prefix\n  i18n win32: add git-stash eval_gettext variable prefix\n  i18n win32: add git-submodule eval_gettext variable prefix\n  i18n win32: add test eval_gettext variable prefix\n\n git-am.sh                    |   29 +++++---\n git-bisect.sh                |   39 +++++++----\n git-pull.sh                  |    5 +-\n git-stash.sh                 |   26 ++++---\n git-submodule.sh             |  151 ++++++++++++++++++++++++++++--------------\n t/t0201-gettext-fallbacks.sh |    4 +-\n 6 files changed, 167 insertions(+), 87 deletions(-)\n\n-- \n1.7.5.1\n"},{"id":"168728","messageId":"1306365594-22061-2-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:49Z","receivedAt":"2011-05-25T23:19:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |   29 +++++++++++++++++++----------\n 1 files changed, 19 insertions(+), 10 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex df918bb..02ecf66 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -102,9 +102,11 @@ stop_here_user_resolve () {\n \t    printf '%s\\n' \"$resolvemsg\"\n \t    stop_here $1\n     fi\n-    eval_gettext \"When you have resolved this problem run \\\"\\$cmdline --resolved\\\".\n-If you would prefer to skip this patch, instead run \\\"\\$cmdline --skip\\\".\n-To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; echo\n+\n+    GIT_I18N_VARIABLE_cmdline=$cmdline\n+    eval_gettext \"When you have resolved this problem run \\\"\\$GIT_I18N_VARIABLE_cmdline --resolved\\\".\n+If you would prefer to skip this patch, instead run \\\"\\$GIT_I18N_VARIABLE_cmdline --skip\\\".\n+To restore the original branch and stop patching run \\\"\\$GIT_I18N_VARIABLE_cmdline --abort\\\".\"; echo\n \n     stop_here $1\n }\n@@ -310,7 +312,8 @@ split_patches () {\n \t\t;;\n \t*)\n \t\tif test -n \"$parse_patch\" ; then\n-\t\t\tclean_abort \"$(eval_gettext \"Patch format \\$patch_format is not supported.\")\"\n+\t\t\tGIT_I18N_VARIABLE_patch_format=$patch_format\n+\t\t\tclean_abort \"$(eval_gettext \"Patch format \\$GIT_I18N_VARIABLE_patch_format is not supported.\")\"\n \t\telse\n \t\t\tclean_abort \"$(gettext \"Patch format detection failed.\")\"\n \t\tfi\n@@ -407,6 +410,7 @@ fi\n \n if test -d \"$dotest\"\n then\n+\tGIT_I18N_VARIABLE_dotest=$dotest\n \tcase \"$#,$skip$resolved$abort\" in\n \t0,*t*)\n \t\t# Explicit resume command and we do not have file, so\n@@ -425,7 +429,7 @@ then\n \t\tfalse\n \t\t;;\n \tesac ||\n-\tdie \"$(eval_gettext \"previous rebase directory \\$dotest still exists but mbox given.\")\"\n+\tdie \"$(eval_gettext \"previous rebase directory \\$GIT_I18N_VARIABLE_dotest still exists but mbox given.\")\"\n \tresume=yes\n \n \tcase \"$skip,$abort\" in\n@@ -522,7 +526,8 @@ case \"$resolved\" in\n \tif test \"$files\"\n \tthen\n \t\ttest -n \"$HAS_HEAD\" && : >\"$dotest/dirtyindex\"\n-\t\tdie \"$(eval_gettext \"Dirty index: cannot apply patches (dirty: \\$files)\")\"\n+\t\tGIT_I18N_VARIABLE_files=$files\n+\t\tdie \"$(eval_gettext \"Dirty index: cannot apply patches (dirty: \\$GIT_I18N_VARIABLE_files)\")\"\n \tfi\n esac\n \n@@ -611,9 +616,10 @@ do\n \t\t\tgo_next && continue\n \n \t\ttest -s \"$dotest/patch\" || {\n+\t\t\tGIT_I18N_VARIABLE_cmdline=$cmdline\n \t\t\teval_gettext \"Patch is empty.  Was it split wrong?\n-If you would prefer to skip this patch, instead run \\\"\\$cmdline --skip\\\".\n-To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; echo\n+If you would prefer to skip this patch, instead run \\\"\\$GIT_I18N_VARIABLE_cmdline --skip\\\".\n+To restore the original branch and stop patching run \\\"\\$GIT_I18N_VARIABLE_cmdline --abort\\\".\"; echo\n \t\t\tstop_here $this\n \t\t}\n \t\trm -f \"$dotest/original-commit\" \"$dotest/author-script\"\n@@ -742,7 +748,8 @@ To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; ec\n \t\tstop_here $this\n \tfi\n \n-\tsay \"$(eval_gettext \"Applying: \\$FIRSTLINE\")\"\n+\tGIT_I18N_VARIABLE_FIRSTLINE=$FIRSTLINE\n+\tsay \"$(eval_gettext \"Applying: \\$GIT_I18N_VARIABLE_FIRSTLINE\")\"\n \n \tcase \"$resolved\" in\n \t'')\n@@ -797,7 +804,9 @@ did you forget to use 'git add'?\"; echo\n \tfi\n \tif test $apply_status != 0\n \tthen\n-\t\teval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo\n+\t\tGIT_I18N_VARIABLE_msgnum=$msgnum\n+\t\tGIT_I18N_VARIABLE_FIRSTLINE=$FIRSTLINE\n+\t\teval_gettext 'Patch failed at $GIT_I18N_VARIABLE_msgnum $GIT_I18N_VARIABLE_FIRSTLINE'; echo\n \t\tstop_here_user_resolve $this\n \tfi\n \n-- \n1.7.5.1\n"},{"id":"168733","messageId":"1306365594-22061-3-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 2/6] i18n win32: add git-bisect eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:50Z","receivedAt":"2011-05-25T23:19:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-bisect.sh |   39 ++++++++++++++++++++++++++-------------\n 1 files changed, 26 insertions(+), 13 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 375b187..6a6ea43 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -116,8 +116,11 @@ bisect_start() {\n \t\t;;\n \t    *)\n \t\trev=$(git rev-parse -q --verify \"$arg^{commit}\") || {\n-\t\t    test $has_double_dash -eq 1 &&\n-\t\t        die \"$(eval_gettext \"'\\$arg' does not appear to be a valid revision\")\"\n+\t\t    if test $has_double_dash -eq 1\n+\t\t    then\n+\t\t        $GIT_I18N_VARIABLE_arg=$arg\n+\t\t        die \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_arg' does not appear to be a valid revision\")\"\n+\t\t    fi\n \t\t    break\n \t\t}\n \t\tcase $bad_seen in\n@@ -162,7 +165,8 @@ bisect_write() {\n \tcase \"$state\" in\n \t\tbad)\t\ttag=\"$state\" ;;\n \t\tgood|skip)\ttag=\"$state\"-\"$rev\" ;;\n-\t\t*)\t\tdie \"$(eval_gettext \"Bad bisect_write argument: \\$state\")\" ;;\n+\t\t*)\t\tGIT_I18N_VARIABLE_state=$state\n+\t\t\t\tdie \"$(eval_gettext \"Bad bisect_write argument: \\$GIT_I18N_VARIABLE_state\")\" ;;\n \tesac\n \tgit update-ref \"refs/bisect/$tag\" \"$rev\" || exit\n \techo \"# $state: $(git show-branch $rev)\" >>\"$GIT_DIR/BISECT_LOG\"\n@@ -190,7 +194,8 @@ bisect_skip() {\n \tdo\n \t    case \"$arg\" in\n             *..*)\n-                revs=$(git rev-list \"$arg\") || die \"$(eval_gettext \"Bad rev input: \\$arg\")\" ;;\n+\t\t\t\tGIT_I18N_VARIABLE_arg=$arg\n+                revs=$(git rev-list \"$arg\") || die \"$(eval_gettext \"Bad rev input: \\$GIT_I18N_VARIABLE_arg\")\" ;;\n             *)\n                 revs=$(git rev-parse --sq-quote \"$arg\") ;;\n \t    esac\n@@ -215,8 +220,9 @@ bisect_state() {\n \t\teval=''\n \t\tfor rev in \"$@\"\n \t\tdo\n+\t\t\tGIT_I18N_VARIABLE_rev=$rev\n \t\t\tsha=$(git rev-parse --verify \"$rev^{commit}\") ||\n-\t\t\t\tdie \"$(eval_gettext \"Bad rev input: \\$rev\")\"\n+\t\t\t\tdie \"$(eval_gettext \"Bad rev input: \\$GIT_I18N_VARIABLE_rev\")\"\n \t\t\teval=\"$eval bisect_write '$state' '$sha'; \"\n \t\tdone\n \t\teval \"$eval\"\n@@ -333,8 +339,8 @@ bisect_reset() {\n \tcase \"$#\" in\n \t0) branch=$(cat \"$GIT_DIR/BISECT_START\") ;;\n \t1) git rev-parse --quiet --verify \"$1^{commit}\" > /dev/null || {\n-\t       invalid=\"$1\"\n-\t       die \"$(eval_gettext \"'\\$invalid' is not a valid commit\")\"\n+\t       GIT_I18N_VARIABLE_invalid=\"$1\"\n+\t       die \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_invalid' is not a valid commit\")\"\n \t   }\n \t   branch=\"$1\" ;;\n \t*)\n@@ -343,7 +349,8 @@ bisect_reset() {\n \tif git checkout \"$branch\" -- ; then\n \t\tbisect_clean_state\n \telse\n-\t\tdie \"$(eval_gettext \"Could not check out original HEAD '\\$branch'.\n+\t\tGIT_I18N_VARIABLE_branch=$branch\n+\t\tdie \"$(eval_gettext \"Could not check out original HEAD '\\$GIT_I18N_VARIABLE_branch'.\n Try 'git bisect reset <commit>'.\")\"\n \tfi\n }\n@@ -369,7 +376,10 @@ bisect_clean_state() {\n bisect_replay () {\n \tfile=\"$1\"\n \ttest \"$#\" -eq 1 || die \"$(gettext \"No logfile given\")\"\n-\ttest -r \"$file\" || die \"$(eval_gettext \"cannot read \\$file for replaying\")\"\n+\ttest -r \"$file\" || {\n+\t\tGIT_I18N_VARIABLE_file=$file\n+\t\tdie \"$(eval_gettext \"cannot read \\$GIT_I18N_VARIABLE_file for replaying\")\"\n+\t}\n \tbisect_reset\n \twhile read git bisect command rev\n \tdo\n@@ -396,16 +406,17 @@ bisect_run () {\n \n     while true\n     do\n-      command=\"$@\"\n-      eval_gettext \"running \\$command\"; echo\n+      GIT_I18N_VARIABLE_command=\"$@\"\n+      eval_gettext \"running \\$GIT_I18N_VARIABLE_command\"; echo\n       \"$@\"\n       res=$?\n \n       # Check for really bad run error.\n       if [ $res -lt 0 -o $res -ge 128 ]; then\n \t  (\n+\t    GIT_I18N_VARIABLE_res=$res\n \t    eval_gettext \"bisect run failed:\n-exit code \\$res from '\\$command' is < 0 or >= 128\" &&\n+exit code \\$GIT_I18N_VARIABLE_res from '\\$GIT_I18N_VARIABLE_command' is < 0 or >= 128\" &&\n \t    echo\n \t  ) >&2\n \t  exit $res\n@@ -438,8 +449,10 @@ exit code \\$res from '\\$command' is < 0 or >= 128\" &&\n \n       if [ $res -ne 0 ]; then\n \t  (\n+\t      GIT_I18N_VARIABLE_state=$state\n+\t      GIT_I18N_VARIABLE_res=$res\n \t      eval_gettext \"bisect run failed:\n-'bisect_state \\$state' exited with error code \\$res\" &&\n+'bisect_state \\$GIT_I18N_VARIABLE_state' exited with error code \\$GIT_I18N_VARIABLE_res\" &&\n \t      echo\n \t  ) >&2\n \t  exit $res\n-- \n1.7.5.1\n"},{"id":"168730","messageId":"1306365594-22061-4-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 3/6] i18n win32: add git-pull eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:51Z","receivedAt":"2011-05-25T23:19:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-pull.sh |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex a10b129..d5f25a6 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -217,17 +217,18 @@ then\n \t# $orig_head commit, but we are merging into $curr_head.\n \t# First update the working tree to match $curr_head.\n \n+\tGIT_I18N_VARIABLE_orig_head=$orig_head\n \t(\n \t\teval_gettext \"Warning: fetch updated the current branch head.\n Warning: fast-forwarding your working tree from\n-Warning: commit \\$orig_head.\" &&\n+Warning: commit \\$GIT_I18N_VARIABLE_orig_head.\" &&\n \t\techo\n \t) >&2\n \tgit update-index -q --refresh\n \tgit read-tree -u -m \"$orig_head\" \"$curr_head\" ||\n \t\tdie \"$(eval_gettext \"Cannot fast-forward your working tree.\n After making sure that you saved anything precious from\n-$ git diff \\$orig_head\n+$ git diff \\$GIT_I18N_VARIABLE_orig_head\n output, run\n $ git reset --hard\n to recover.\")\"\n-- \n1.7.5.1\n"},{"id":"168729","messageId":"1306365594-22061-5-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 4/6] i18n win32: add git-stash eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:52Z","receivedAt":"2011-05-25T23:19:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-stash.sh |   26 +++++++++++++++-----------\n 1 files changed, 15 insertions(+), 11 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex c72ba49..e925e27 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -153,6 +153,7 @@ save_stash () {\n \t\t\t;;\n \t\t-*)\n \t\t\toption=\"$1\"\n+\t\t\tGIT_I18N_VARIABLE_option=$option\n \t\t\t# TRANSLATORS: $option is an invalid option, like\n \t\t\t# `--blah-blah'. The 7 spaces at the beginning of the\n \t\t\t# second line correspond to \"error: \". So you should line\n@@ -163,8 +164,8 @@ save_stash () {\n \t\t\t#    $ git stash save --blah-blah 2>&1 | head -n 2\n \t\t\t#    error: unknown option for 'stash save': --blah-blah\n \t\t\t#           To provide a message, use git stash save -- '--blah-blah'\n-\t\t\teval_gettext \"$(\"error: unknown option for 'stash save': \\$option\n-       To provide a message, use git stash save -- '\\$option'\")\"; echo\n+\t\t\teval_gettext \"$(\"error: unknown option for 'stash save': \\$GIT_I18N_VARIABLE_option\n+       To provide a message, use git stash save -- '\\$GIT_I18N_VARIABLE_option'\")\"; echo\n \t\t\tusage\n \t\t\t;;\n \t\t*)\n@@ -306,13 +307,14 @@ parse_flags_and_rev()\n \t\t\t:\n \t\t;;\n \t\t*)\n-\t\t\tdie \"$(eval_gettext \"Too many revisions specified: \\$REV\")\"\n+\t\t\tGIT_I18N_VARIABLE_REV=$REV\n+\t\t\tdie \"$(eval_gettext \"Too many revisions specified: \\$GIT_I18N_VARIABLE_REV\")\"\n \t\t;;\n \tesac\n \n \tREV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || {\n-\t\treference=\"$1\"\n-\t\tdie \"$(eval_gettext \"\\$reference is not valid reference\")\"\n+\t\tGIT_I18N_VARIABLE_reference=\"$1\"\n+\t\tdie \"$(eval_gettext \"\\$GIT_I18N_VARIABLE_reference is not valid reference\")\"\n \t}\n \n \ti_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) &&\n@@ -336,8 +338,8 @@ is_stash_like()\n \n assert_stash_like() {\n \tis_stash_like \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash-like commit\")\"\n+\t\tGIT_I18N_VARIABLE_args=\"$*\"\n+\t\tdie \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_args' is not a stash-like commit\")\"\n \t}\n }\n \n@@ -347,8 +349,8 @@ is_stash_ref() {\n \n assert_stash_ref() {\n \tis_stash_ref \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash reference\")\"\n+\t\tGIT_I18N_VARIABLE_args=\"$*\"\n+\t\tdie \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_args' is not a stash reference\")\"\n \t}\n }\n \n@@ -429,9 +431,11 @@ pop_stash() {\n drop_stash () {\n \tassert_stash_ref \"$@\"\n \n+\tGIT_I18N_VARIABLE_REV=$REV\n+\tGIT_I18N_VARIABLE_s=$s\n \tgit reflog delete --updateref --rewrite \"${REV}\" &&\n-\t\tsay \"$(eval_gettext \"Dropped \\${REV} (\\$s)\")\" ||\n-\t\tdie \"$(eval_gettext \"\\${REV}: Could not drop stash entry\")\"\n+\t\tsay \"$(eval_gettext \"Dropped \\$GIT_I18N_VARIABLE_REV (\\$GIT_I18N_VARIABLE_s)\")\" ||\n+\t\tdie \"$(eval_gettext \"\\$GIT_I18N_VARIABLE_REV: Could not drop stash entry\")\"\n \n \t# clear_stash if we just dropped the last stash entry\n \tgit rev-parse --verify \"$ref_stash@{0}\" > /dev/null 2>&1 || clear_stash\n-- \n1.7.5.1\n"},{"id":"168734","messageId":"1306365594-22061-6-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 5/6] i18n win32: add git-submodule eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:53Z","receivedAt":"2011-05-25T23:19:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-submodule.sh |  151 ++++++++++++++++++++++++++++++++++++-----------------\n 1 files changed, 102 insertions(+), 49 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex c1d3a5e..dea4f63 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -34,8 +34,10 @@ prefix=\n resolve_relative_url ()\n {\n \tremote=$(get_default_remote)\n-\tremoteurl=$(git config \"remote.$remote.url\") ||\n-\t\tdie \"$(eval_gettext \"remote (\\$remote) does not have a url defined in .git/config\")\"\n+\tremoteurl=$(git config \"remote.$remote.url\") || {\n+\t\tGIT_I18N_VARIABLE_remote=$(get_default_remote)\n+\t\tdie \"$(eval_gettext \"remote (\\$GIT_I18N_VARIABLE_remote) does not have a url defined in .git/config\")\"\n+\t}\n \turl=\"$1\"\n \tremoteurl=${remoteurl%/}\n \tsep=/\n@@ -53,7 +55,8 @@ resolve_relative_url ()\n \t\t\t\tsep=:\n \t\t\t\t;;\n \t\t\t*)\n-\t\t\t\tdie \"$(eval_gettext \"cannot strip one component off url '\\$remoteurl'\")\"\n+\t\t\t\tGIT_I18N_VARIABLE_remoteurl=$remoteurl\n+\t\t\t\tdie \"$(eval_gettext \"cannot strip one component off url '\\$GIT_I18N_VARIABLE_remoteurl'\")\"\n \t\t\t\t;;\n \t\t\tesac\n \t\t\t;;\n@@ -104,9 +107,12 @@ module_name()\n \tre=$(printf '%s\\n' \"$1\" | sed -e 's/[].[^$\\\\*]/\\\\&/g')\n \tname=$( git config -f .gitmodules --get-regexp '^submodule\\..*\\.path$' |\n \t\tsed -n -e 's|^submodule\\.\\(.*\\)\\.path '\"$re\"'$|\\1|p' )\n-       test -z \"$name\" &&\n-       die \"$(eval_gettext \"No submodule mapping found in .gitmodules for path '\\$path'\")\"\n-       echo \"$name\"\n+\tif test -z \"$name\"\n+\tthen\n+\t\tGIT_I18N_VARIABLE_path=$path\n+\t\tdie \"$(eval_gettext \"No submodule mapping found in .gitmodules for path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\tfi\n+\techo \"$name\"\n }\n \n #\n@@ -128,8 +134,11 @@ module_clone()\n \t\tgit-clone \"$reference\" -n \"$url\" \"$path\"\n \telse\n \t\tgit-clone -n \"$url\" \"$path\"\n-\tfi ||\n-\tdie \"$(eval_gettext \"Clone of '\\$url' into submodule path '\\$path' failed\")\"\n+\tfi || {\n+\t\tGIT_I18N_VARIABLE_url=$url\n+\t\tGIT_I18N_VARIABLE_path=$path\n+\t\tdie \"$(eval_gettext \"Clone of '\\$GIT_I18N_VARIABLE_url' into submodule path '\\$GIT_I18N_VARIABLE_path' failed\")\"\n+\t}\n }\n \n #\n@@ -202,7 +211,8 @@ cmd_add()\n \t\trealrepo=$repo\n \t\t;;\n \t*)\n-\t\tdie \"$(eval_gettext \"repo URL: '\\$repo' must be absolute or begin with ./|../\")\"\n+\t\tGIT_I18N_VARIABLE_repo=$repo\n+\t\tdie \"$(eval_gettext \"repo URL: '\\$GIT_I18N_VARIABLE_repo' must be absolute or begin with ./|../\")\"\n \t;;\n \tesac\n \n@@ -218,14 +228,18 @@ cmd_add()\n \t\t\ttstart\n \t\t\ts|/*$||\n \t\t')\n-\tgit ls-files --error-unmatch \"$path\" > /dev/null 2>&1 &&\n-\tdie \"$(eval_gettext \"'\\$path' already exists in the index\")\"\n+\tif git ls-files --error-unmatch \"$path\" > /dev/null 2>&1\n+\tthen\n+\t\tGIT_I18N_VARIABLE_path=$path\n+\t\tdie \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_path' already exists in the index\")\"\n+\tfi\n \n \tif test -z \"$force\" && ! git add --dry-run --ignore-missing \"$path\" > /dev/null 2>&1\n \tthen\n \t\t(\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n \t\t\teval_gettext \"The following path is ignored by one of your .gitignore files:\n-\\$path\n+\\$GIT_I18N_VARIABLE_path\n Use -f if you really want to add it.\" &&\n \t\t\techo\n \t\t) >&2\n@@ -237,9 +251,11 @@ Use -f if you really want to add it.\" &&\n \tthen\n \t\tif test -d \"$path\"/.git -o -f \"$path\"/.git\n \t\tthen\n-\t\t\teval_gettext \"Adding existing repo at '\\$path' to the index\"; echo\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\teval_gettext \"Adding existing repo at '\\$GIT_I18N_VARIABLE_path' to the index\"; echo\n \t\telse\n-\t\t\tdie \"$(eval_gettext \"'\\$path' already exists and is not a valid git repo\")\"\n+\t\t\tGIT_I18N_VARIABLE_path=$path\t\t\t\n+\t\t\tdie \"$(eval_gettext \"'\\$GIT_I18N_VARIABLE_path' already exists and is not a valid git repo\")\"\n \t\tfi\n \n \t\tcase \"$repo\" in\n@@ -262,16 +278,22 @@ Use -f if you really want to add it.\" &&\n \t\t\t'') git checkout -f -q ;;\n \t\t\t?*) git checkout -f -q -B \"$branch\" \"origin/$branch\" ;;\n \t\t\tesac\n-\t\t) || die \"$(eval_gettext \"Unable to checkout submodule '\\$path'\")\"\n+\t\t) || {\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tdie \"$(eval_gettext \"Unable to checkout submodule '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t}\n \tfi\n \n-\tgit add $force \"$path\" ||\n-\tdie \"$(eval_gettext \"Failed to add submodule '\\$path'\")\"\n+\tgit add $force \"$path\" || {\n+\t\tdie \"$(eval_gettext \"Failed to add submodule '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t}\n \n \tgit config -f .gitmodules submodule.\"$path\".path \"$path\" &&\n \tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" &&\n-\tgit add --force .gitmodules ||\n-\tdie \"$(eval_gettext \"Failed to register submodule '\\$path'\")\"\n+\tgit add --force .gitmodules || {\n+\t\tGIT_I18N_VARIABLE_path=$path\n+\t\tdie \"$(eval_gettext \"Failed to register submodule '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t}\n }\n \n #\n@@ -309,7 +331,9 @@ cmd_foreach()\n \tdo\n \t\tif test -e \"$path\"/.git\n \t\tthen\n-\t\t\tsay \"$(eval_gettext \"Entering '\\$prefix\\$path'\")\"\n+\t\t\tGIT_I18N_VARIABLE_prefix=$prefix\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tsay \"$(eval_gettext \"Entering '\\$GIT_I18N_VARIABLE_prefix\\$GIT_I18N_VARIABLE_path'\")\"\n \t\t\tname=$(module_name \"$path\")\n \t\t\t(\n \t\t\t\tprefix=\"$prefix$path/\"\n@@ -321,7 +345,7 @@ cmd_foreach()\n \t\t\t\t\tcmd_foreach \"--recursive\" \"$@\"\n \t\t\t\tfi\n \t\t\t) ||\n-\t\t\tdie \"$(eval_gettext \"Stopping at '\\$path'; script returned non-zero status.\")\"\n+\t\t\tdie \"$(eval_gettext \"Stopping at '\\$GIT_I18N_VARIABLE_path'; script returned non-zero status.\")\"\n \t\tfi\n \tdone\n }\n@@ -363,8 +387,11 @@ cmd_init()\n \t\ttest -z \"$url\" || continue\n \n \t\turl=$(git config -f .gitmodules submodule.\"$name\".url)\n-\t\ttest -z \"$url\" &&\n-\t\tdie \"$(eval_gettext \"No url found for submodule path '\\$path' in .gitmodules\")\"\n+\t\tif test -z \"$url\"\n+\t\tthen\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tdie \"$(eval_gettext \"No url found for submodule path '\\$GIT_I18N_VARIABLE_path' in .gitmodules\")\"\n+\t\tfi\n \n \t\t# Possibly a url relative to parent\n \t\tcase \"$url\" in\n@@ -373,15 +400,24 @@ cmd_init()\n \t\t\t;;\n \t\tesac\n \n-\t\tgit config submodule.\"$name\".url \"$url\" ||\n-\t\tdie \"$(eval_gettext \"Failed to register url for submodule path '\\$path'\")\"\n+\t\tif ! git config submodule.\"$name\".url \"$url\"\n+\t\tthen\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tdie \"$(eval_gettext \"Failed to register url for submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\tfi\n \n \t\tupd=\"$(git config -f .gitmodules submodule.\"$name\".update)\"\n \t\ttest -z \"$upd\" ||\n-\t\tgit config submodule.\"$name\".update \"$upd\" ||\n-\t\tdie \"$(eval_gettext \"Failed to register update mode for submodule path '\\$path'\")\"\n+\t\tif ! git config submodule.\"$name\".update \"$upd\"\n+\t\tthen\n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tdie \"$(eval_gettext \"Failed to register update mode for submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\tfi\n \n-\t\tsay \"$(eval_gettext \"Submodule '\\$name' (\\$url) registered for path '\\$path'\")\"\n+\t\tGIT_I18N_VARIABLE_name=$name\n+\t\tGIT_I18N_VARIABLE_url=$url\n+\t\tGIT_I18N_VARIABLE_path=$path\n+\t\tsay \"$(eval_gettext \"Submodule '\\$GIT_I18N_VARIABLE_name' (\\$GIT_I18N_VARIABLE_url) registered for path '\\$GIT_I18N_VARIABLE_path'\")\"\n \tdone\n }\n \n@@ -463,9 +499,11 @@ cmd_update()\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n \t\t\t# path have been specified\n-\t\t\ttest \"$#\" != \"0\" &&\n-\t\t\tsay \"$(eval_gettext \"Submodule path '\\$path' not initialized\n+\t\t\tif test \"$#\" != \"0\"\n+\t\t\tthen\n+\t\t\t\tsay \"$(eval_gettext \"Submodule path '\\$GIT_I18N_VARIABLE_path' not initialized\n Maybe you want to use 'update --init'?\")\"\n+\t\t\tfi\n \t\t\tcontinue\n \t\tfi\n \n@@ -476,8 +514,10 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\tsubsha1=\n \t\telse\n \t\t\tsubsha1=$(clear_local_git_env; cd \"$path\" &&\n-\t\t\t\tgit rev-parse --verify HEAD) ||\n-\t\t\tdie \"$(eval_gettext \"Unable to find current revision in submodule path '\\$path'\")\"\n+\t\t\t\tgit rev-parse --verify HEAD) || {\n+\t\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\t\tdie \"$(eval_gettext \"Unable to find current revision in submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t}\n \t\tfi\n \n \t\tif ! test -z \"$update\"\n@@ -500,8 +540,10 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\t\t# is not reachable from a ref.\n \t\t\t\t(clear_local_git_env; cd \"$path\" &&\n \t\t\t\t\t((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&\n-\t\t\t\t\t test -z \"$rev\") || git-fetch)) ||\n-\t\t\t\tdie \"$(eval_gettext \"Unable to fetch in submodule path '\\$path'\")\"\n+\t\t\t\t\t test -z \"$rev\") || git-fetch)) || {\n+\t\t\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\t\t\tdie \"$(eval_gettext \"Unable to fetch in submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t\t}\n \t\t\tfi\n \n \t\t\t# Is this something we just cloned?\n@@ -511,21 +553,23 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\t\tupdate_module= ;;\n \t\t\tesac\n \n+\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\tGIT_I18N_VARIABLE_sha1=$sha1\n \t\t\tcase \"$update_module\" in\n \t\t\trebase)\n \t\t\t\tcommand=\"git rebase\"\n-\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to rebase '\\$sha1' in submodule path '\\$path'\")\"\n-\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$path': rebased into '\\$sha1'\")\"\n+\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to rebase '\\$GIT_I18N_VARIABLE_sha1' in submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$GIT_I18N_VARIABLE_path': rebased into '\\$GIT_I18N_VARIABLE_sha1'\")\"\n \t\t\t\t;;\n \t\t\tmerge)\n \t\t\t\tcommand=\"git merge\"\n-\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to merge '\\$sha1' in submodule path '\\$path'\")\"\n-\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$path': merged in '\\$sha1'\")\"\n+\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to merge '\\$GIT_I18N_VARIABLE_sha1' in submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$GIT_I18N_VARIABLE_path': merged in '\\$GIT_I18N_VARIABLE_sha1'\")\"\n \t\t\t\t;;\n \t\t\t*)\n \t\t\t\tcommand=\"git checkout $subforce -q\"\n-\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to checkout '\\$sha1' in submodule path '\\$path'\")\"\n-\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$path': checked out '\\$sha1'\")\"\n+\t\t\t\tdie_msg=\"$(eval_gettext \"Unable to checkout '\\$GIT_I18N_VARIABLE_sha1' in submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t\tsay_msg=\"$(eval_gettext \"Submodule path '\\$GIT_I18N_VARIABLE_path': checked out '\\$GIT_I18N_VARIABLE_sha1'\")\"\n \t\t\t\t;;\n \t\t\tesac\n \n@@ -535,8 +579,10 @@ Maybe you want to use 'update --init'?\")\"\n \n \t\tif test -n \"$recursive\"\n \t\tthen\n-\t\t\t(clear_local_git_env; cd \"$path\" && eval cmd_update \"$orig_flags\") ||\n-\t\t\tdie \"$(eval_gettext \"Failed to recurse into submodule path '\\$path'\")\"\n+\t\t\t(clear_local_git_env; cd \"$path\" && eval cmd_update \"$orig_flags\") || {\n+\t\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\t\tdie \"$(eval_gettext \"Failed to recurse into submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t}\n \t\tfi\n \tdone\n }\n@@ -661,7 +707,8 @@ cmd_summary() {\n \t\t\t*)\n \t\t\t\t# unexpected type\n \t\t\t\t(\n-\t\t\t\t\teval_gettext \"unexpected mode \\$mod_dst\" &&\n+\t\t\t\t\tGIT_I18N_VARIABLE_mod_dst=$mod_dst\n+\t\t\t\t\teval_gettext \"unexpected mode \\$GIT_I18N_VARIABLE_mod_dst\" &&\n \t\t\t\t\techo\n \t\t\t\t) >&2\n \t\t\t\tcontinue ;;\n@@ -679,15 +726,18 @@ cmd_summary() {\n \t\tmissing_dst=t\n \n \t\ttotal_commits=\n+\t\tGIT_I18N_VARIABLE_name=$name\n+\t\tGIT_I18N_VARIABLE_sha1_src=$sha1_src\n+\t\tGIT_I18N_VARIABLE_sha1_dst=$sha1_dst\n \t\tcase \"$missing_src,$missing_dst\" in\n \t\tt,)\n-\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$name doesn't contain commit \\$sha1_src\")\"\n+\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$GIT_I18N_VARIABLE_name doesn't contain commit \\$GIT_I18N_VARIABLE_sha1_src\")\"\n \t\t\t;;\n \t\t,t)\n-\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$name doesn't contain commit \\$sha1_dst\")\"\n+\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$GIT_I18N_VARIABLE_name doesn't contain commit \\$GIT_I18N_VARIABLE_sha1_dst\")\"\n \t\t\t;;\n \t\tt,t)\n-\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$name doesn't contain commits \\$sha1_src and \\$sha1_dst\")\"\n+\t\t\terrmsg=\"$(eval_gettext \"  Warn: \\$GIT_I18N_VARIABLE_name doesn't contain commits \\$GIT_I18N_VARIABLE_sha1_src and \\$sha1_dst\")\"\n \t\t\t;;\n \t\t*)\n \t\t\terrmsg=\n@@ -837,8 +887,10 @@ cmd_status()\n \t\t\t\tclear_local_git_env\n \t\t\t\tcd \"$path\" &&\n \t\t\t\teval cmd_status \"$orig_args\"\n-\t\t\t) ||\n-\t\t\tdie \"$(eval_gettext \"Failed to recurse into submodule path '\\$path'\")\"\n+\t\t\t) || {\n+\t\t\t\tGIT_I18N_VARIABLE_path=$path\n+\t\t\t\tdie \"$(eval_gettext \"Failed to recurse into submodule path '\\$GIT_I18N_VARIABLE_path'\")\"\n+\t\t\t}\n \t\tfi\n \tdone\n }\n@@ -882,7 +934,8 @@ cmd_sync()\n \t\t\t;;\n \t\tesac\n \n-\t\tsay \"$(eval_gettext \"Synchronizing submodule url for '\\$name'\")\"\n+\t\tGIT_I18N_VARIABLE_name=$name\n+\t\tsay \"$(eval_gettext \"Synchronizing submodule url for '\\$GIT_I18N_VARIABLE_name'\")\"\n \t\tgit config submodule.\"$name\".url \"$url\"\n \n \t\tif test -e \"$path\"/.git\n-- \n1.7.5.1\n"},{"id":"168732","messageId":"1306365594-22061-7-git-send-email-avarab@gmail.com","threadId":"27459","inReplyTo":"1306365594-22061-1-git-send-email-avarab@gmail.com","subject":"[PATCH 6/6] i18n win32: add test eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-25T23:19:54Z","receivedAt":"2011-05-25T23:19:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_\nprefix for variables used in eval_gettext. On Windows environment\nvariables are case insensitive, so e.g. $PATH clashes with $path. By\nusing a sufficiently unique prefix we work around that issue.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t0201-gettext-fallbacks.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t0201-gettext-fallbacks.sh b/t/t0201-gettext-fallbacks.sh\nindex 54d98b9..209f078 100755\n--- a/t/t0201-gettext-fallbacks.sh\n+++ b/t/t0201-gettext-fallbacks.sh\n@@ -41,10 +41,10 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate v\n '\n \n test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '\n-    cmdline=\"git am\" &&\n+    GIT_I18N_VARIABLE_cmdline=\"git am\" &&\n     export cmdline;\n     printf \"When you have resolved this problem run \\\"git am --resolved\\\".\" >expect &&\n-    eval_gettext \"When you have resolved this problem run \\\"\\$cmdline --resolved\\\".\" >actual\n+    eval_gettext \"When you have resolved this problem run \\\"\\$GIT_I18N_VARIABLE_cmdline --resolved\\\".\" >actual\n     test_i18ncmp expect actual\n '\n \n-- \n1.7.5.1\n"},{"id":"168753","messageId":"4DDDF483.70805@viscovery.net","threadId":"27459","inReplyTo":"1306365594-22061-2-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-26T06:34:43Z","receivedAt":"2011-05-26T06:34:43Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/26/2011 1:19, schrieb Ævar Arnfjörð Bjarmason:\n> -\t\teval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo\n> +\t\tGIT_I18N_VARIABLE_msgnum=$msgnum\n> +\t\tGIT_I18N_VARIABLE_FIRSTLINE=$FIRSTLINE\n> +\t\teval_gettext 'Patch failed at $GIT_I18N_VARIABLE_msgnum $GIT_I18N_VARIABLE_FIRSTLINE'; echo\n\nThat's not pretty.\n\nI wonder whether it is possible to automate the variable prefix. Looking\nat the definition of eval_gettext()\n\neval_gettext () {\n\tprintf \"%s\" \"$1\" | (\n\t\texport PATH $(git sh-i18n--envsubst --variables \"$1\");\n\t\tgit sh-i18n--envsubst \"$1\"\n\t)\n}\n\nI gather that the actual substitution of variable values is done by\nsh-i18n--envsubst, and not by the shell (right?). Let's look at an example:\n\n\tgit sh-i18n--envsubst --variables '$foo and $bar'\n\nproduces\n\n\tfoo\n\tbar\n\nWhat if it produced\n\n\tGIT_I18N_VARIABLE_foo=$foo\n\tGIT_I18N_VARIABLE_bar=$bar\n\texport GIT_I18N_VARIABLE_foo GIT_I18N_VARIABLE_bar\n\nthen the definition of eval_gettext() would look like\n\neval_gettext () {\n\tprintf \"%s\" \"$1\" | (\n\t\texport PATH\n\t\teval \"$(git sh-i18n--envsubst --variables \"$1\")\"\n\t\tgit sh-i18n--envsubst \"$1\"\n\t)\n}\n\nand the second call of sh-i18n--envsubst should replace $foo and $bar that\nit sees on stdin by the values of GIT_I18N_VARIABLE_foo and\nGIT_I18N_VARIABLE_bar from the environment.\n\nWhat do you think?\n\nBTW, if you re-roll the series, would you mind shortening the prefix to,\nsay, _I18N__ because on Windows the variables names count towards the\nenvironment budget, which is restricted to 32k characters.\n\nBTW2, the following patch is needed to avoid a crash of an invocation of\n'git sh-i18n--envsubst' without arguments.\n\n-- Hannes\n\n(Warning: hand-edited patch text)\n\ndiff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c\nindex 7125093..8104973 100644\n--- a/sh-i18n--envsubst.c\n+++ b/sh-i18n--envsubst.c\n@@ -76,2 +76,3 @@ main (int argc, char *argv[])\n \t  error (\"we won't substitute all variables on stdin for you\");\n+\t  break;\n \t  /*\n"},{"id":"168768","messageId":"7vlixtzh1q.fsf@alter.siamese.dyndns.org","threadId":"27459","inReplyTo":"4DDDF483.70805@viscovery.net","subject":"Re: [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-26T14:13:05Z","receivedAt":"2011-05-26T14:13:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> I gather that the actual substitution of variable values is done by\n> sh-i18n--envsubst, and not by the shell (right?). Let's look at an example:\n>\n> \tgit sh-i18n--envsubst --variables '$foo and $bar'\n>\n> produces\n>\n> \tfoo\n> \tbar\n>\n> What if it produced\n>\n> \tGIT_I18N_VARIABLE_foo=$foo\n> \tGIT_I18N_VARIABLE_bar=$bar\n> \texport GIT_I18N_VARIABLE_foo GIT_I18N_VARIABLE_bar\n>\n> then the definition of eval_gettext() would look like\n>\n> eval_gettext () {\n> \tprintf \"%s\" \"$1\" | (\n> \t\texport PATH\n> \t\teval \"$(git sh-i18n--envsubst --variables \"$1\")\"\n> \t\tgit sh-i18n--envsubst \"$1\"\n> \t)\n> }\n>\n> and the second call of sh-i18n--envsubst should replace $foo and $bar that\n> it sees on stdin by the values of GIT_I18N_VARIABLE_foo and\n> GIT_I18N_VARIABLE_bar from the environment.\n>\n> What do you think?\n\nThis started on windows that confuses between $path and $PATH, we wouldn't\nbe doing this, right?  In git-submodule.sh uses $path variable for\nsomething other than the search-path, and the definition updated by you\nwould become in the larger picture:\n\n\tpath=... ;# git-submodule uses the variable for not-a-search-path\n        _I18N__path=$path\n        export _I18N__path\n        git sh-i18n--envsubst \"... $_I18N__path\"\n\nIs the RHS of the second assignment safe on Windows?  Are environment\nvariables case insane but normal variables are safe?\n\nIf that is a non-issue, I think your change is a good thing to do.\n"},{"id":"168772","messageId":"4DDE6AC9.9090003@viscovery.net","threadId":"27459","inReplyTo":"7vlixtzh1q.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-26T14:59:21Z","receivedAt":"2011-05-26T14:59:21Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/26/2011 16:13, schrieb Junio C Hamano:\n> This started on windows that confuses between $path and $PATH, we wouldn't\n> be doing this, right?  In git-submodule.sh uses $path variable for\n> something other than the search-path, and the definition updated by you\n> would become in the larger picture:\n> \n> \tpath=... ;# git-submodule uses the variable for not-a-search-path\n>         _I18N__path=$path\n>         export _I18N__path\n>         git sh-i18n--envsubst \"... $_I18N__path\"\n> \n> Is the RHS of the second assignment safe on Windows?  Are environment\n> variables case insane but normal variables are safe?\n\nYes, the second assignment is safe, because at this point everything is\ninternal to bash; it does the right thing.\n\nProblems start only when exported variables are transported from bash to\nanother process.\n\nBut ... wait a minute - I've another idea!\n\nbash -c \"path=z env\"\n\n*does* list both 'path' and 'PATH'\n\n... hack hack ...\n\nand so does a home-grown equivalent of 'env', both for MinGW and Visual\nStudio. It looks like the environment was transfered just fine, only the\n*lookup* by getenv() was case-insensitive. This means we would just have\nto supply a POSIX conformant getenv() for sh-i18n--envsubst.\n\nI can write one, no problem; and, Ævar, I'm awfully sorry for sending you\nin the wrong direction.\n\n-- Hannes\n"},{"id":"168774","messageId":"BANLkTiku4RuY=3CCSxsbSgWgVna5UL9Qww@mail.gmail.com","threadId":"27459","inReplyTo":"4DDE6AC9.9090003@viscovery.net","subject":"Re: [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-05-26T15:16:04Z","receivedAt":"2011-05-26T15:16:04Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, May 26, 2011 at 16:59, Johannes Sixt <j.sixt@viscovery.net> wrote:\n\n> I can write one, no problem; and, Ævar, I'm awfully sorry for sending you\n> in the wrong direction.\n\nThat's very nice. Having a compat/getenv.c to solve this would be great.\n\nI look forward to seeing it. Thanks for writing it, since I can't test\nstuff on Windows.\n"}]}