git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 32/48] i18n: git-stash die + gettext messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 8, 2011, 12:21 UTC
Message-ID
<1304857280-14773-33-git-send-email-avarab@gmail.com>
In-Reply-To
<1304857280-14773-1-git-send-email-avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-stash.sh |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index cf22c90..bd394fd 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -40,7 +40,7 @@ no_changes () {
 clear_stash () {
 	if test $# != 0
 	then
-		die "git stash clear with parameters is unimplemented"
+		die "$(gettext "git stash clear with parameters is unimplemented")"
 	fi
 	if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
 	then
@@ -62,7 +62,7 @@ create_stash () {
 	then
 		head=$(git rev-list --oneline -n 1 HEAD --)
 	else
-		die "You do not have the initial commit yet"
+		die "$(gettext "You do not have the initial commit yet")"
 	fi
 
 	if branch=$(git symbolic-ref -q HEAD)
@@ -77,7 +77,7 @@ create_stash () {
 	i_tree=$(git write-tree) &&
 	i_commit=$(printf 'index on %s\n' "$msg" |
 		git commit-tree $i_tree -p $b_commit) ||
-		die "Cannot save the current index state"
+		die "$(gettext "Cannot save the current index state")"
 
 	if test -z "$patch_mode"
 	then
@@ -91,7 +91,7 @@ create_stash () {
 			git write-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 tree
 		w_tree=$(GIT_INDEX_FILE="$TMP-index" git write-tree) ||
-		die "Cannot save the current worktree state"
+		die "$(gettext "Cannot save the current worktree state")"
 
 		git diff-tree -p HEAD $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 () {
 	fi
 	w_commit=$(printf '%s\n' "$stash_msg" |
 		git commit-tree $w_tree -p $b_commit -p $i_commit) ||
-		die "Cannot record working tree state"
+		die "$(gettext "Cannot record working tree state")"
 }
 
 save_stash () {
@@ -172,7 +172,7 @@ save_stash () {
 		exit 0
 	fi
 	test -f "$GIT_DIR/logs/$ref_stash" ||
-		clear_stash || die "Cannot initialize stash"
+		clear_stash || die "$(gettext "Cannot initialize stash")"
 
 	create_stash "$stash_msg"
 
@@ -180,7 +180,7 @@ save_stash () {
 	: >>"$GIT_DIR/logs/$ref_stash"
 
 	git update-ref -m "$stash_msg" $ref_stash $w_commit ||
-		die "Cannot save the current status"
+		die "$(gettext "Cannot save the current status")"
 	say Saved working directory and index state "$stash_msg"
 
 	if test -z "$patch_mode"
@@ -193,7 +193,7 @@ save_stash () {
 		fi
 	else
 		git apply -R < "$TMP-patch" ||
-		die "Cannot remove worktree changes"
+		die "$(gettext "Cannot remove worktree changes")"
 
 		if test "$keep_index" != "t"
 		then
@@ -288,7 +288,7 @@ parse_flags_and_rev()
 
 	case $# in
 		0)
-			have_stash || die "No stash found."
+			have_stash || die "$(gettext "No stash found.")"
 			set -- ${ref_stash}@{0}
 		;;
 		1)
@@ -336,11 +336,11 @@ apply_stash () {
 
 	assert_stash_like "$@"
 
-	git update-index -q --refresh || die 'unable to refresh index'
+	git update-index -q --refresh || die "$(gettext "unable to refresh index")"
 
 	# current index state
 	c_tree=$(git write-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=
 	if test -n "$INDEX_OPTION" && test "$b_tree" != "$i_tree" &&
@@ -348,9 +348,9 @@ apply_stash () {
 	then
 		git diff-tree --binary $s^2^..$s^2 | git apply --cached
 		test $? -ne 0 &&
-			die 'Conflicts in index. Try without --index.'
+			die "$(gettext "Conflicts in index. Try without --index.")"
 		unstashed_index_tree=$(git write-tree) ||
-			die 'Could not save index tree'
+			die "$(gettext "Could not save index tree")"
 		git reset
 	fi
 
@@ -376,7 +376,7 @@ apply_stash () {
 			git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" &&
 			git read-tree --reset $c_tree &&
 			git update-index --add --stdin <"$a" ||
-				die "Cannot unstage modified files"
+				die "$(gettext "Cannot unstage modified files")"
 			rm -f "$a"
 		fi
 		squelch=
@@ -414,7 +414,7 @@ drop_stash () {
 }
 
 apply_to_branch () {
-	test -n "$1" || die 'No branch name specified'
+	test -n "$1" || die "$(gettext "No branch name specified")"
 	branch=$1
 	shift 1
 
-- 
1.7.4.4
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 41 of 59 in “i18n: Add shell script translations (depends on infrastructure)”
  1. 00/48 i18n: Add shell script translations (depends on infrastructure)Ævar Arnfjörð Bjarmason, May 8, 2011
  2. 01/48 i18n: git-am add git-sh-i18nÆvar Arnfjörð Bjarmason, May 8, 2011
  3. 02/48 i18n: git-am one-line gettext $msg; echoÆvar Arnfjörð Bjarmason, May 8, 2011
  4. 03/48 i18n: git-am multi-line getttext $msg; echoÆvar Arnfjörð Bjarmason, May 8, 2011
  5. 04/48 i18n: git-am eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  6. 05/48 i18n: git-am echo + gettext messageÆvar Arnfjörð Bjarmason, May 8, 2011
  7. 06/48 i18n: git-am die messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  8. 07/48 i18n: git-am cannot_fallback messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  9. 08/48 i18n: git-am clean_abort messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  10. 09/48 i18n: git-am "Apply?" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  11. 10/48 i18n: git-am "Falling back" say messageÆvar Arnfjörð Bjarmason, May 8, 2011
  12. 11/48 i18n: git-am core say messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  13. 12/48 i18n: git-am printf(1) message to eval_gettextÆvar Arnfjörð Bjarmason, May 8, 2011
  14. 13/48 i18n: git-pull add git-sh-i18nÆvar Arnfjörð Bjarmason, May 8, 2011
  15. 14/48 i18n: git-pull die messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  16. 15/48 i18n: git-pull eval_gettext + die messageÆvar Arnfjörð Bjarmason, May 8, 2011
  17. 16/48 i18n: git-pull eval_gettext + warning messageÆvar Arnfjörð Bjarmason, May 8, 2011
  18. Bernhard R. LinkMay 8, 2011
  19. Junio C HamanoMay 8, 2011
  20. 17/48 i18n: git-submodule add git-sh-i18nÆvar Arnfjörð Bjarmason, May 8, 2011
  21. 18/48 i18n: git-submodule echo + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  22. 19/48 i18n: git-submodule say + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  23. 20/48 i18n: git-submodule die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  24. Johannes SixtMay 12, 2011
  25. Ævar Arnfjörð BjarmasonMay 12, 2011
  26. Johannes SixtMay 12, 2011
  27. Ævar Arnfjörð BjarmasonMay 13, 2011
  28. Erik Faye-LundMay 13, 2011
  29. Ævar Arnfjörð BjarmasonMay 13, 2011
  30. 21/48 i18n: git-submodule $update_module say + die messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  31. 22/48 i18n: git-submodule "cached cannot be used" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  32. 23/48 i18n: git-submodule "Submodule change[...]" messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  33. 24/48 i18n: git-submodule $errmsg messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  34. 25/48 i18n: git-submodule "Entering [...]" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  35. 26/48 i18n: git-submodule "[...] path is ignored" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  36. 27/48 i18n: git-submodule "path not initialized" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  37. 28/48 i18n: git-submodule "blob" and "submodule" messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  38. 29/48 i18n: git-stash add git-sh-i18nÆvar Arnfjörð Bjarmason, May 8, 2011
  39. 30/48 i18n: git-stash echo + gettext messageÆvar Arnfjörð Bjarmason, May 8, 2011
  40. 31/48 i18n: git-stash say + gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  41. 32/48 i18n: git-stash die + gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  42. 33/48 i18n: git-stash die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  43. 34/48 i18n: git-stash die + eval_gettext $* messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  44. 35/48 i18n: git-stash die + eval_gettext $1 messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  45. 36/48 i18n: git-stash "unknown option" messageÆvar Arnfjörð Bjarmason, May 8, 2011
  46. Motiejus JakštysMay 8, 2011
  47. Ævar Arnfjörð BjarmasonMay 8, 2011
  48. 37/48 i18n: git-stash drop_stash say/die messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  49. 38/48 i18n: git-bisect add git-sh-i18nÆvar Arnfjörð Bjarmason, May 8, 2011
  50. 39/48 i18n: git-bisect gettext + echo messageÆvar Arnfjörð Bjarmason, May 8, 2011
  51. 40/48 i18n: git-bisect echo + gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  52. 41/48 i18n: git-bisect echo + eval_gettext messageÆvar Arnfjörð Bjarmason, May 8, 2011
  53. 42/48 i18n: git-bisect die + gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  54. 43/48 i18n: git-bisect die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  55. 44/48 i18n: git-bisect bisect_run + $@ messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  56. 45/48 i18n: git-bisect bisect_reset + $1 messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  57. 46/48 i18n: git-bisect bisect_replay + $1 messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  58. 47/48 i18n: git-bisect [Y/n] messagesÆvar Arnfjörð Bjarmason, May 8, 2011
  59. 48/48 i18n: git-bisect bisect_next_check "You need to" messageÆvar Arnfjörð Bjarmason, May 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.