All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Johannes Sixt" <j.sixt@viscovery.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix
Date: Wed, 25 May 2011 23:19:49 +0000	[thread overview]
Message-ID: <1306365594-22061-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1306365594-22061-1-git-send-email-avarab@gmail.com>

Change the eval_gettext() invocations to use the GIT_I18N_VARIABLE_
prefix for variables used in eval_gettext. On Windows environment
variables are case insensitive, so e.g. $PATH clashes with $path. By
using a sufficiently unique prefix we work around that issue.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-am.sh |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index df918bb..02ecf66 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -102,9 +102,11 @@ stop_here_user_resolve () {
 	    printf '%s\n' "$resolvemsg"
 	    stop_here $1
     fi
-    eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\".
-If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
-To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
+
+    GIT_I18N_VARIABLE_cmdline=$cmdline
+    eval_gettext "When you have resolved this problem run \"\$GIT_I18N_VARIABLE_cmdline --resolved\".
+If you would prefer to skip this patch, instead run \"\$GIT_I18N_VARIABLE_cmdline --skip\".
+To restore the original branch and stop patching run \"\$GIT_I18N_VARIABLE_cmdline --abort\"."; echo
 
     stop_here $1
 }
@@ -310,7 +312,8 @@ split_patches () {
 		;;
 	*)
 		if test -n "$parse_patch" ; then
-			clean_abort "$(eval_gettext "Patch format \$patch_format is not supported.")"
+			GIT_I18N_VARIABLE_patch_format=$patch_format
+			clean_abort "$(eval_gettext "Patch format \$GIT_I18N_VARIABLE_patch_format is not supported.")"
 		else
 			clean_abort "$(gettext "Patch format detection failed.")"
 		fi
@@ -407,6 +410,7 @@ fi
 
 if test -d "$dotest"
 then
+	GIT_I18N_VARIABLE_dotest=$dotest
 	case "$#,$skip$resolved$abort" in
 	0,*t*)
 		# Explicit resume command and we do not have file, so
@@ -425,7 +429,7 @@ then
 		false
 		;;
 	esac ||
-	die "$(eval_gettext "previous rebase directory \$dotest still exists but mbox given.")"
+	die "$(eval_gettext "previous rebase directory \$GIT_I18N_VARIABLE_dotest still exists but mbox given.")"
 	resume=yes
 
 	case "$skip,$abort" in
@@ -522,7 +526,8 @@ case "$resolved" in
 	if test "$files"
 	then
 		test -n "$HAS_HEAD" && : >"$dotest/dirtyindex"
-		die "$(eval_gettext "Dirty index: cannot apply patches (dirty: \$files)")"
+		GIT_I18N_VARIABLE_files=$files
+		die "$(eval_gettext "Dirty index: cannot apply patches (dirty: \$GIT_I18N_VARIABLE_files)")"
 	fi
 esac
 
@@ -611,9 +616,10 @@ do
 			go_next && continue
 
 		test -s "$dotest/patch" || {
+			GIT_I18N_VARIABLE_cmdline=$cmdline
 			eval_gettext "Patch is empty.  Was it split wrong?
-If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
-To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
+If you would prefer to skip this patch, instead run \"\$GIT_I18N_VARIABLE_cmdline --skip\".
+To restore the original branch and stop patching run \"\$GIT_I18N_VARIABLE_cmdline --abort\"."; echo
 			stop_here $this
 		}
 		rm -f "$dotest/original-commit" "$dotest/author-script"
@@ -742,7 +748,8 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ec
 		stop_here $this
 	fi
 
-	say "$(eval_gettext "Applying: \$FIRSTLINE")"
+	GIT_I18N_VARIABLE_FIRSTLINE=$FIRSTLINE
+	say "$(eval_gettext "Applying: \$GIT_I18N_VARIABLE_FIRSTLINE")"
 
 	case "$resolved" in
 	'')
@@ -797,7 +804,9 @@ did you forget to use 'git add'?"; echo
 	fi
 	if test $apply_status != 0
 	then
-		eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo
+		GIT_I18N_VARIABLE_msgnum=$msgnum
+		GIT_I18N_VARIABLE_FIRSTLINE=$FIRSTLINE
+		eval_gettext 'Patch failed at $GIT_I18N_VARIABLE_msgnum $GIT_I18N_VARIABLE_FIRSTLINE'; echo
 		stop_here_user_resolve $this
 	fi
 
-- 
1.7.5.1

  reply	other threads:[~2011-05-25 23:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 23:19 [PATCH 0/6] i18n: Windows shellscript support Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` Ævar Arnfjörð Bjarmason [this message]
2011-05-26  6:34   ` [PATCH 1/6] i18n win32: add git-am eval_gettext variable prefix Johannes Sixt
2011-05-26 14:13     ` Junio C Hamano
2011-05-26 14:59       ` Johannes Sixt
2011-05-26 15:16         ` Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` [PATCH 2/6] i18n win32: add git-bisect " Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` [PATCH 3/6] i18n win32: add git-pull " Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` [PATCH 4/6] i18n win32: add git-stash " Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` [PATCH 5/6] i18n win32: add git-submodule " Ævar Arnfjörð Bjarmason
2011-05-25 23:19 ` [PATCH 6/6] i18n win32: add test " Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306365594-22061-2-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.