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

[PATCH v2 20/48] i18n: git-submodule die + eval_gettext messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 21, 2011, 18:44 UTC
Message-ID
<1306003469-22939-21-git-send-email-avarab@gmail.com>
In-Reply-To
<1306003469-22939-1-git-send-email-avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-submodule.sh |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index f193aa6..de5048c 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -35,7 +35,7 @@ resolve_relative_url ()
 {
 	remote=$(get_default_remote)
 	remoteurl=$(git config "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=$( git config -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()
 	else
 		git-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|/*$||
 		')
 	git ls-files --error-unmatch "$path" > /dev/null 2>&1 &&
-	die "'$path' already exists in the index"
+	die "$(eval_gettext "'\$path' already exists in the index")"
 
 	if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
 	then
@@ -236,7 +236,7 @@ cmd_add()
 		then
 			eval_gettext "Adding existing repo at '\$path' to the index"; echo
 		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")"
 		fi
 
 		case "$repo" in
@@ -259,16 +259,16 @@ cmd_add()
 			'') git checkout -f -q ;;
 			?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
 			esac
-		) || die "Unable to checkout submodule '$path'"
+		) || die "$(eval_gettext "Unable to checkout submodule '\$path'")"
 	fi
 
 	git add $force "$path" ||
-	die "Failed to add submodule '$path'"
+	die "$(eval_gettext "Failed to add submodule '\$path'")"
 
 	git config -f .gitmodules submodule."$path".path "$path" &&
 	git config -f .gitmodules submodule."$path".url "$repo" &&
 	git add --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.")"
 		fi
 	done
 }
@@ -361,7 +361,7 @@ cmd_init()
 
 		url=$(git config -f .gitmodules submodule."$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 parent
 		case "$url" in
@@ -371,14 +371,14 @@ cmd_init()
 		esac
 
 		git config submodule."$name".url "$url" ||
-		die "Failed to register url for submodule path '$path'"
+		die "$(eval_gettext "Failed to register url for submodule path '\$path'")"
 
 		upd="$(git config -f .gitmodules submodule."$name".update)"
 		test -z "$upd" ||
 		git config submodule."$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()
 		else
 			subsha1=$(clear_local_git_env; cd "$path" &&
 				git rev-parse --verify HEAD) ||
-			die "Unable to find current revision in submodule path '$path'"
+			die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
 		fi
 
 		if ! test -z "$update"
@@ -498,7 +498,7 @@ cmd_update()
 				(clear_local_git_env; cd "$path" &&
 					((rev=$(git rev-list -n 1 $sha1 --not --all 2>/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()
 		if test -n "$recursive"
 		then
 			(clear_local_git_env; cd "$path" && eval cmd_update "$orig_flags") ||
-			die "Failed to recurse into submodule path '$path'"
+			die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
 		fi
 	done
 }
@@ -834,7 +834,7 @@ cmd_status()
 				cd "$path" &&
 				eval cmd_status "$orig_args"
 			) ||
-			die "Failed to recurse into submodule path '$path'"
+			die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
 		fi
 	done
 }
-- 
1.7.5.1
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 21 of 51 in “i18n: mark core shell programs for translation”
  1. 00/48 i18n: mark core shell programs for translationÆvar Arnfjörð Bjarmason, May 21, 2011
  2. 01/48 i18n: git-am add git-sh-i18nÆvar Arnfjörð Bjarmason, May 21, 2011
  3. 02/48 i18n: git-am one-line gettext $msg; echoÆvar Arnfjörð Bjarmason, May 21, 2011
  4. 03/48 i18n: git-am multi-line getttext $msg; echoÆvar Arnfjörð Bjarmason, May 21, 2011
  5. 04/48 i18n: git-am eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  6. 05/48 i18n: git-am gettext + gettext to stderr messageÆvar Arnfjörð Bjarmason, May 21, 2011
  7. 06/48 i18n: git-am die messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  8. 07/48 i18n: git-am cannot_fallback messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  9. 08/48 i18n: git-am clean_abort messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  10. 09/48 i18n: git-am "Apply?" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  11. 10/48 i18n: git-am "Falling back" say messageÆvar Arnfjörð Bjarmason, May 21, 2011
  12. 11/48 i18n: git-am core say messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  13. 12/48 i18n: git-am printf(1) message to eval_gettextÆvar Arnfjörð Bjarmason, May 21, 2011
  14. 13/48 i18n: git-pull add git-sh-i18nÆvar Arnfjörð Bjarmason, May 21, 2011
  15. 14/48 i18n: git-pull die messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  16. 15/48 i18n: git-pull eval_gettext + die messageÆvar Arnfjörð Bjarmason, May 21, 2011
  17. 16/48 i18n: git-pull eval_gettext + warning messageÆvar Arnfjörð Bjarmason, May 21, 2011
  18. 17/48 i18n: git-submodule add git-sh-i18nÆvar Arnfjörð Bjarmason, May 21, 2011
  19. 18/48 i18n: git-submodule echo + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  20. 19/48 i18n: git-submodule say + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  21. 20/48 i18n: git-submodule die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  22. 21/48 i18n: git-submodule $update_module say + die messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  23. 22/48 i18n: git-submodule "cached cannot be used" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  24. 23/48 i18n: git-submodule "Submodule change[...]" messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  25. 24/48 i18n: git-submodule $errmsg messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  26. 25/48 i18n: git-submodule "Entering [...]" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  27. 26/48 i18n: git-submodule "[...] path is ignored" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  28. 27/48 i18n: git-submodule "path not initialized" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  29. 28/48 i18n: git-submodule "blob" and "submodule" messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  30. 29/48 i18n: git-stash add git-sh-i18nÆvar Arnfjörð Bjarmason, May 21, 2011
  31. 30/48 i18n: git-stash echo + gettext messageÆvar Arnfjörð Bjarmason, May 21, 2011
  32. 31/48 i18n: git-stash say + gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  33. 32/48 i18n: git-stash die + gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  34. 33/48 i18n: git-stash die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  35. 34/48 i18n: git-stash die + eval_gettext $* messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  36. 35/48 i18n: git-stash die + eval_gettext $1 messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  37. 36/48 i18n: git-stash "unknown option" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  38. 37/48 i18n: git-stash drop_stash say/die messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  39. 38/48 i18n: git-bisect add git-sh-i18nÆvar Arnfjörð Bjarmason, May 21, 2011
  40. 39/48 i18n: git-bisect gettext + echo messageÆvar Arnfjörð Bjarmason, May 21, 2011
  41. 40/48 i18n: git-bisect echo + gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  42. 41/48 i18n: git-bisect echo + eval_gettext messageÆvar Arnfjörð Bjarmason, May 21, 2011
  43. 42/48 i18n: git-bisect die + gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  44. 43/48 i18n: git-bisect die + eval_gettext messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  45. 44/48 i18n: git-bisect bisect_run + $@ messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  46. 45/48 i18n: git-bisect bisect_reset + $1 messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  47. 46/48 i18n: git-bisect bisect_replay + $1 messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  48. 47/48 i18n: git-bisect [Y/n] messagesÆvar Arnfjörð Bjarmason, May 21, 2011
  49. 48/48 i18n: git-bisect bisect_next_check "You need to" messageÆvar Arnfjörð Bjarmason, May 21, 2011
  50. Junio C HamanoMay 21, 2011
  51. Ævar Arnfjörð BjarmasonMay 22, 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.