[PATCH 4/6] i18n win32: add git-stash eval_gettext variable prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 git-stash.sh |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index c72ba49..e925e27 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -153,6 +153,7 @@ save_stash () {
 			;;
 		-*)
 			option="$1"
+			GIT_I18N_VARIABLE_option=$option
 			# 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
@@ -163,8 +164,8 @@ save_stash () {
 			#    $ git stash save --blah-blah 2>&1 | head -n 2
 			#    error: unknown option for 'stash save': --blah-blah
 			#           To provide a message, use git stash save -- '--blah-blah'
-			eval_gettext "$("error: unknown option for 'stash save': \$option
-       To provide a message, use git stash save -- '\$option'")"; echo
+			eval_gettext "$("error: unknown option for 'stash save': \$GIT_I18N_VARIABLE_option
+       To provide a message, use git stash save -- '\$GIT_I18N_VARIABLE_option'")"; echo
 			usage
 			;;
 		*)
@@ -306,13 +307,14 @@ parse_flags_and_rev()
 			:
 		;;
 		*)
-			die "$(eval_gettext "Too many revisions specified: \$REV")"
+			GIT_I18N_VARIABLE_REV=$REV
+			die "$(eval_gettext "Too many revisions specified: \$GIT_I18N_VARIABLE_REV")"
 		;;
 	esac
 
 	REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || {
-		reference="$1"
-		die "$(eval_gettext "\$reference is not valid reference")"
+		GIT_I18N_VARIABLE_reference="$1"
+		die "$(eval_gettext "\$GIT_I18N_VARIABLE_reference is not valid reference")"
 	}
 
 	i_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) &&
@@ -336,8 +338,8 @@ is_stash_like()
 
 assert_stash_like() {
 	is_stash_like "$@" || {
-		args="$*"
-		die "$(eval_gettext "'\$args' is not a stash-like commit")"
+		GIT_I18N_VARIABLE_args="$*"
+		die "$(eval_gettext "'\$GIT_I18N_VARIABLE_args' is not a stash-like commit")"
 	}
 }
 
@@ -347,8 +349,8 @@ is_stash_ref() {
 
 assert_stash_ref() {
 	is_stash_ref "$@" || {
-		args="$*"
-		die "$(eval_gettext "'\$args' is not a stash reference")"
+		GIT_I18N_VARIABLE_args="$*"
+		die "$(eval_gettext "'\$GIT_I18N_VARIABLE_args' is not a stash reference")"
 	}
 }
 
@@ -429,9 +431,11 @@ pop_stash() {
 drop_stash () {
 	assert_stash_ref "$@"
 
+	GIT_I18N_VARIABLE_REV=$REV
+	GIT_I18N_VARIABLE_s=$s
 	git reflog delete --updateref --rewrite "${REV}" &&
-		say "$(eval_gettext "Dropped \${REV} (\$s)")" ||
-		die "$(eval_gettext "\${REV}: Could not drop stash entry")"
+		say "$(eval_gettext "Dropped \$GIT_I18N_VARIABLE_REV (\$GIT_I18N_VARIABLE_s)")" ||
+		die "$(eval_gettext "\$GIT_I18N_VARIABLE_REV: Could not drop stash entry")"
 
 	# clear_stash if we just dropped the last stash entry
 	git rev-parse --verify "$ref_stash@{0}" > /dev/null 2>&1 || clear_stash
-- 
1.7.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]