i18n: git-submodule die + eval_gettext messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8f3f2c44c5
commit
497ee87245
@ -35,7 +35,7 @@ resolve_relative_url ()
|
|||||||
{
|
{
|
||||||
remote=$(get_default_remote)
|
remote=$(get_default_remote)
|
||||||
remoteurl=$(git config "remote.$remote.url") ||
|
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"
|
url="$1"
|
||||||
remoteurl=${remoteurl%/}
|
remoteurl=${remoteurl%/}
|
||||||
sep=/
|
sep=/
|
||||||
@ -53,7 +53,7 @@ resolve_relative_url ()
|
|||||||
sep=:
|
sep=:
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "cannot strip one component off url '$remoteurl'"
|
die "$(eval_gettext "cannot strip one component off url '\$remoteurl'")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -105,7 +105,7 @@ module_name()
|
|||||||
name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
|
name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
|
||||||
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
|
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
|
||||||
test -z "$name" &&
|
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"
|
echo "$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ module_clone()
|
|||||||
else
|
else
|
||||||
git-clone -n "$url" "$path"
|
git-clone -n "$url" "$path"
|
||||||
fi ||
|
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
|
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
|
esac
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ cmd_add()
|
|||||||
s|/*$||
|
s|/*$||
|
||||||
')
|
')
|
||||||
git ls-files --error-unmatch "$path" > /dev/null 2>&1 &&
|
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
|
if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
@ -236,7 +236,7 @@ cmd_add()
|
|||||||
then
|
then
|
||||||
eval_gettext "Adding existing repo at '\$path' to the index"; echo
|
eval_gettext "Adding existing repo at '\$path' to the index"; echo
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
case "$repo" in
|
case "$repo" in
|
||||||
@ -259,16 +259,16 @@ cmd_add()
|
|||||||
'') git checkout -f -q ;;
|
'') git checkout -f -q ;;
|
||||||
?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
|
?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
|
||||||
esac
|
esac
|
||||||
) || die "Unable to checkout submodule '$path'"
|
) || die "$(eval_gettext "Unable to checkout submodule '\$path'")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git add $force "$path" ||
|
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".path "$path" &&
|
||||||
git config -f .gitmodules submodule."$path".url "$repo" &&
|
git config -f .gitmodules submodule."$path".url "$repo" &&
|
||||||
git add --force .gitmodules ||
|
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" "$@"
|
cmd_foreach "--recursive" "$@"
|
||||||
fi
|
fi
|
||||||
) ||
|
) ||
|
||||||
die "Stopping at '$path'; script returned non-zero status."
|
die "$(eval_gettext "Stopping at '\$path'; script returned non-zero status.")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@ cmd_init()
|
|||||||
|
|
||||||
url=$(git config -f .gitmodules submodule."$name".url)
|
url=$(git config -f .gitmodules submodule."$name".url)
|
||||||
test -z "$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
|
# Possibly a url relative to parent
|
||||||
case "$url" in
|
case "$url" in
|
||||||
@ -371,14 +371,14 @@ cmd_init()
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
git config submodule."$name".url "$url" ||
|
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)"
|
upd="$(git config -f .gitmodules submodule."$name".update)"
|
||||||
test -z "$upd" ||
|
test -z "$upd" ||
|
||||||
git config submodule."$name".update "$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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ cmd_update()
|
|||||||
else
|
else
|
||||||
subsha1=$(clear_local_git_env; cd "$path" &&
|
subsha1=$(clear_local_git_env; cd "$path" &&
|
||||||
git rev-parse --verify HEAD) ||
|
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
|
fi
|
||||||
|
|
||||||
if ! test -z "$update"
|
if ! test -z "$update"
|
||||||
@ -498,7 +498,7 @@ cmd_update()
|
|||||||
(clear_local_git_env; cd "$path" &&
|
(clear_local_git_env; cd "$path" &&
|
||||||
((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
|
((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
|
||||||
test -z "$rev") || git-fetch)) ||
|
test -z "$rev") || git-fetch)) ||
|
||||||
die "Unable to fetch in submodule path '$path'"
|
die "$(eval_gettext "Unable to fetch in submodule path '\$path'")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Is this something we just cloned?
|
# Is this something we just cloned?
|
||||||
@ -534,7 +534,7 @@ cmd_update()
|
|||||||
if test -n "$recursive"
|
if test -n "$recursive"
|
||||||
then
|
then
|
||||||
(clear_local_git_env; cd "$path" && eval cmd_update "$orig_flags") ||
|
(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
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -834,7 +834,7 @@ cmd_status()
|
|||||||
cd "$path" &&
|
cd "$path" &&
|
||||||
eval cmd_status "$orig_args"
|
eval cmd_status "$orig_args"
|
||||||
) ||
|
) ||
|
||||||
die "Failed to recurse into submodule path '$path'"
|
die "$(eval_gettext "Failed to recurse into submodule path '\$path'")"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user