Merge branch 'ab/i18n-scripts' into next
* ab/i18n-scripts: (48 commits) i18n: git-bisect bisect_next_check "You need to" message i18n: git-bisect [Y/n] messages i18n: git-bisect bisect_replay + $1 messages i18n: git-bisect bisect_reset + $1 messages i18n: git-bisect bisect_run + $@ messages i18n: git-bisect die + eval_gettext messages i18n: git-bisect die + gettext messages i18n: git-bisect echo + eval_gettext message i18n: git-bisect echo + gettext messages i18n: git-bisect gettext + echo message i18n: git-bisect add git-sh-i18n i18n: git-stash drop_stash say/die messages i18n: git-stash "unknown option" message i18n: git-stash die + eval_gettext $1 messages i18n: git-stash die + eval_gettext $* messages i18n: git-stash die + eval_gettext messages i18n: git-stash die + gettext messages i18n: git-stash say + gettext messages i18n: git-stash echo + gettext message i18n: git-stash add git-sh-i18n ...
This commit is contained in:
commit
61f44720a9
77
git-am.sh
77
git-am.sh
@ -37,13 +37,14 @@ rerere-autoupdate update the index with reused conflict resolution if possible
|
|||||||
rebasing* (internal use for git-rebase)"
|
rebasing* (internal use for git-rebase)"
|
||||||
|
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
. git-sh-i18n
|
||||||
prefix=$(git rev-parse --show-prefix)
|
prefix=$(git rev-parse --show-prefix)
|
||||||
set_reflog_action am
|
set_reflog_action am
|
||||||
require_work_tree
|
require_work_tree
|
||||||
cd_to_toplevel
|
cd_to_toplevel
|
||||||
|
|
||||||
git var GIT_COMMITTER_IDENT >/dev/null ||
|
git var GIT_COMMITTER_IDENT >/dev/null ||
|
||||||
die "You need to set your committer info first"
|
die "$(gettext "You need to set your committer info first")"
|
||||||
|
|
||||||
if git rev-parse --verify -q HEAD >/dev/null
|
if git rev-parse --verify -q HEAD >/dev/null
|
||||||
then
|
then
|
||||||
@ -88,8 +89,11 @@ safe_to_abort () {
|
|||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
echo >&2 "You seem to have moved HEAD since the last 'am' failure."
|
(
|
||||||
echo >&2 "Not rewinding to ORIG_HEAD"
|
gettext "You seem to have moved HEAD since the last 'am' failure.
|
||||||
|
Not rewinding to ORIG_HEAD" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,9 +102,9 @@ stop_here_user_resolve () {
|
|||||||
printf '%s\n' "$resolvemsg"
|
printf '%s\n' "$resolvemsg"
|
||||||
stop_here $1
|
stop_here $1
|
||||||
fi
|
fi
|
||||||
echo "When you have resolved this problem run \"$cmdline --resolved\"."
|
eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\".
|
||||||
echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"."
|
If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
|
||||||
echo "To restore the original branch and stop patching run \"$cmdline --abort\"."
|
To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
|
||||||
|
|
||||||
stop_here $1
|
stop_here $1
|
||||||
}
|
}
|
||||||
@ -114,7 +118,7 @@ go_next () {
|
|||||||
|
|
||||||
cannot_fallback () {
|
cannot_fallback () {
|
||||||
echo "$1"
|
echo "$1"
|
||||||
echo "Cannot fall back to three-way merge."
|
gettext "Cannot fall back to three-way merge."; echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +133,7 @@ fall_back_3way () {
|
|||||||
"$dotest/patch" &&
|
"$dotest/patch" &&
|
||||||
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
||||||
git write-tree >"$dotest/patch-merge-base+" ||
|
git write-tree >"$dotest/patch-merge-base+" ||
|
||||||
cannot_fallback "Repository lacks necessary blobs to fall back on 3-way merge."
|
cannot_fallback "$(gettext "Repository lacks necessary blobs to fall back on 3-way merge.")"
|
||||||
|
|
||||||
say Using index info to reconstruct a base tree...
|
say Using index info to reconstruct a base tree...
|
||||||
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
||||||
@ -138,8 +142,8 @@ fall_back_3way () {
|
|||||||
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
|
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
|
||||||
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
|
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
|
||||||
else
|
else
|
||||||
cannot_fallback "Did you hand edit your patch?
|
cannot_fallback "$(gettext "Did you hand edit your patch?
|
||||||
It does not apply to blobs recorded in its index."
|
It does not apply to blobs recorded in its index.")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -f "$dotest/patch-merge-index" &&
|
test -f "$dotest/patch-merge-index" &&
|
||||||
@ -147,7 +151,7 @@ It does not apply to blobs recorded in its index."
|
|||||||
orig_tree=$(cat "$dotest/patch-merge-base") &&
|
orig_tree=$(cat "$dotest/patch-merge-base") &&
|
||||||
rm -fr "$dotest"/patch-merge-* || exit 1
|
rm -fr "$dotest"/patch-merge-* || exit 1
|
||||||
|
|
||||||
say Falling back to patching base and 3-way merge...
|
say "$(gettext "Falling back to patching base and 3-way merge...")"
|
||||||
|
|
||||||
# This is not so wrong. Depending on which base we picked,
|
# This is not so wrong. Depending on which base we picked,
|
||||||
# orig_tree may be wildly different from ours, but his_tree
|
# orig_tree may be wildly different from ours, but his_tree
|
||||||
@ -254,7 +258,7 @@ split_patches () {
|
|||||||
stgit-series)
|
stgit-series)
|
||||||
if test $# -ne 1
|
if test $# -ne 1
|
||||||
then
|
then
|
||||||
clean_abort "Only one StGIT patch series can be applied at once"
|
clean_abort "$(gettext "Only one StGIT patch series can be applied at once")"
|
||||||
fi
|
fi
|
||||||
series_dir=`dirname "$1"`
|
series_dir=`dirname "$1"`
|
||||||
series_file="$1"
|
series_file="$1"
|
||||||
@ -306,9 +310,9 @@ split_patches () {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test -n "$parse_patch" ; then
|
if test -n "$parse_patch" ; then
|
||||||
clean_abort "Patch format $patch_format is not supported."
|
clean_abort "$(eval_gettext "Patch format \$patch_format is not supported.")"
|
||||||
else
|
else
|
||||||
clean_abort "Patch format detection failed."
|
clean_abort "$(gettext "Patch format detection failed.")"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -358,7 +362,7 @@ do
|
|||||||
--rebasing)
|
--rebasing)
|
||||||
rebasing=t threeway=t keep=t scissors=f no_inbody_headers=t ;;
|
rebasing=t threeway=t keep=t scissors=f no_inbody_headers=t ;;
|
||||||
-d|--dotest)
|
-d|--dotest)
|
||||||
die "-d option is no longer supported. Do not use."
|
die "$(gettext "-d option is no longer supported. Do not use.")"
|
||||||
;;
|
;;
|
||||||
--resolvemsg)
|
--resolvemsg)
|
||||||
shift; resolvemsg=$1 ;;
|
shift; resolvemsg=$1 ;;
|
||||||
@ -421,12 +425,12 @@ then
|
|||||||
false
|
false
|
||||||
;;
|
;;
|
||||||
esac ||
|
esac ||
|
||||||
die "previous rebase directory $dotest still exists but mbox given."
|
die "$(eval_gettext "previous rebase directory \$dotest still exists but mbox given.")"
|
||||||
resume=yes
|
resume=yes
|
||||||
|
|
||||||
case "$skip,$abort" in
|
case "$skip,$abort" in
|
||||||
t,t)
|
t,t)
|
||||||
die "Please make up your mind. --skip or --abort?"
|
die "$(gettext "Please make up your mind. --skip or --abort?")"
|
||||||
;;
|
;;
|
||||||
t,)
|
t,)
|
||||||
git rerere clear
|
git rerere clear
|
||||||
@ -453,7 +457,7 @@ then
|
|||||||
else
|
else
|
||||||
# Make sure we are not given --skip, --resolved, nor --abort
|
# Make sure we are not given --skip, --resolved, nor --abort
|
||||||
test "$skip$resolved$abort" = "" ||
|
test "$skip$resolved$abort" = "" ||
|
||||||
die "Resolve operation not in progress, we are not resuming."
|
die "$(gettext "Resolve operation not in progress, we are not resuming.")"
|
||||||
|
|
||||||
# Start afresh.
|
# Start afresh.
|
||||||
mkdir -p "$dotest" || exit
|
mkdir -p "$dotest" || exit
|
||||||
@ -518,7 +522,7 @@ case "$resolved" in
|
|||||||
if test "$files"
|
if test "$files"
|
||||||
then
|
then
|
||||||
test -n "$HAS_HEAD" && : >"$dotest/dirtyindex"
|
test -n "$HAS_HEAD" && : >"$dotest/dirtyindex"
|
||||||
die "Dirty index: cannot apply patches (dirty: $files)"
|
die "$(eval_gettext "Dirty index: cannot apply patches (dirty: \$files)")"
|
||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -607,9 +611,9 @@ do
|
|||||||
go_next && continue
|
go_next && continue
|
||||||
|
|
||||||
test -s "$dotest/patch" || {
|
test -s "$dotest/patch" || {
|
||||||
echo "Patch is empty. Was it split wrong?"
|
eval_gettext "Patch is empty. Was it split wrong?
|
||||||
echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"."
|
If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
|
||||||
echo "To restore the original branch and stop patching run \"$cmdline --abort\"."
|
To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
|
||||||
stop_here $this
|
stop_here $this
|
||||||
}
|
}
|
||||||
rm -f "$dotest/original-commit" "$dotest/author-script"
|
rm -f "$dotest/original-commit" "$dotest/author-script"
|
||||||
@ -644,7 +648,7 @@ do
|
|||||||
|
|
||||||
if test -z "$GIT_AUTHOR_EMAIL"
|
if test -z "$GIT_AUTHOR_EMAIL"
|
||||||
then
|
then
|
||||||
echo "Patch does not have a valid e-mail address."
|
gettext "Patch does not have a valid e-mail address."; echo
|
||||||
stop_here $this
|
stop_here $this
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -691,15 +695,18 @@ do
|
|||||||
if test "$interactive" = t
|
if test "$interactive" = t
|
||||||
then
|
then
|
||||||
test -t 0 ||
|
test -t 0 ||
|
||||||
die "cannot be interactive without stdin connected to a terminal."
|
die "$(gettext "cannot be interactive without stdin connected to a terminal.")"
|
||||||
action=again
|
action=again
|
||||||
while test "$action" = again
|
while test "$action" = again
|
||||||
do
|
do
|
||||||
echo "Commit Body is:"
|
gettext "Commit Body is:"; echo
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
cat "$dotest/final-commit"
|
cat "$dotest/final-commit"
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
printf "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
|
# TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
|
||||||
|
# in your translation. The program will only accept English
|
||||||
|
# input at this point.
|
||||||
|
gettext "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
|
||||||
read reply
|
read reply
|
||||||
case "$reply" in
|
case "$reply" in
|
||||||
[yY]*) action=yes ;;
|
[yY]*) action=yes ;;
|
||||||
@ -735,7 +742,7 @@ do
|
|||||||
stop_here $this
|
stop_here $this
|
||||||
fi
|
fi
|
||||||
|
|
||||||
say "Applying: $FIRSTLINE"
|
say "$(eval_gettext "Applying: \$FIRSTLINE")"
|
||||||
|
|
||||||
case "$resolved" in
|
case "$resolved" in
|
||||||
'')
|
'')
|
||||||
@ -756,16 +763,16 @@ do
|
|||||||
# working tree.
|
# working tree.
|
||||||
resolved=
|
resolved=
|
||||||
git diff-index --quiet --cached HEAD -- && {
|
git diff-index --quiet --cached HEAD -- && {
|
||||||
echo "No changes - did you forget to use 'git add'?"
|
gettext "No changes - did you forget to use 'git add'?
|
||||||
echo "If there is nothing left to stage, chances are that something else"
|
If there is nothing left to stage, chances are that something else
|
||||||
echo "already introduced the same changes; you might want to skip this patch."
|
already introduced the same changes; you might want to skip this patch."; echo
|
||||||
stop_here_user_resolve $this
|
stop_here_user_resolve $this
|
||||||
}
|
}
|
||||||
unmerged=$(git ls-files -u)
|
unmerged=$(git ls-files -u)
|
||||||
if test -n "$unmerged"
|
if test -n "$unmerged"
|
||||||
then
|
then
|
||||||
echo "You still have unmerged paths in your index"
|
gettext "You still have unmerged paths in your index
|
||||||
echo "did you forget to use 'git add'?"
|
did you forget to use 'git add'?"; echo
|
||||||
stop_here_user_resolve $this
|
stop_here_user_resolve $this
|
||||||
fi
|
fi
|
||||||
apply_status=0
|
apply_status=0
|
||||||
@ -780,7 +787,7 @@ do
|
|||||||
# Applying the patch to an earlier tree and merging the
|
# Applying the patch to an earlier tree and merging the
|
||||||
# result may have produced the same tree as ours.
|
# result may have produced the same tree as ours.
|
||||||
git diff-index --quiet --cached HEAD -- && {
|
git diff-index --quiet --cached HEAD -- && {
|
||||||
say No changes -- Patch already applied.
|
say "$(gettext "No changes -- Patch already applied.")"
|
||||||
go_next
|
go_next
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -790,7 +797,7 @@ do
|
|||||||
fi
|
fi
|
||||||
if test $apply_status != 0
|
if test $apply_status != 0
|
||||||
then
|
then
|
||||||
printf 'Patch failed at %s %s\n' "$msgnum" "$FIRSTLINE"
|
eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo
|
||||||
stop_here_user_resolve $this
|
stop_here_user_resolve $this
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -806,7 +813,7 @@ do
|
|||||||
GIT_AUTHOR_DATE=
|
GIT_AUTHOR_DATE=
|
||||||
fi
|
fi
|
||||||
parent=$(git rev-parse --verify -q HEAD) ||
|
parent=$(git rev-parse --verify -q HEAD) ||
|
||||||
say >&2 "applying to an empty history"
|
say >&2 "$(gettext "applying to an empty history")"
|
||||||
|
|
||||||
if test -n "$committer_date_is_author_date"
|
if test -n "$committer_date_is_author_date"
|
||||||
then
|
then
|
||||||
|
113
git-bisect.sh
113
git-bisect.sh
@ -28,6 +28,7 @@ Please use "git help bisect" to get the full man page.'
|
|||||||
|
|
||||||
OPTIONS_SPEC=
|
OPTIONS_SPEC=
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
. git-sh-i18n
|
||||||
require_work_tree
|
require_work_tree
|
||||||
|
|
||||||
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
|
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
|
||||||
@ -35,10 +36,16 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
|
|||||||
|
|
||||||
bisect_autostart() {
|
bisect_autostart() {
|
||||||
test -s "$GIT_DIR/BISECT_START" || {
|
test -s "$GIT_DIR/BISECT_START" || {
|
||||||
echo >&2 'You need to start by "git bisect start"'
|
(
|
||||||
|
gettext "You need to start by \"git bisect start\"" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
if test -t 0
|
if test -t 0
|
||||||
then
|
then
|
||||||
echo >&2 -n 'Do you want me to do it for you [Y/n]? '
|
# TRANSLATORS: Make sure to include [Y] and [n] in your
|
||||||
|
# translation. The program will only accept English input
|
||||||
|
# at this point.
|
||||||
|
gettext "Do you want me to do it for you [Y/n]? " >&2
|
||||||
read yesno
|
read yesno
|
||||||
case "$yesno" in
|
case "$yesno" in
|
||||||
[Nn]*)
|
[Nn]*)
|
||||||
@ -57,7 +64,7 @@ bisect_start() {
|
|||||||
#
|
#
|
||||||
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) ||
|
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) ||
|
||||||
head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
|
head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
|
||||||
die "Bad HEAD - I need a HEAD"
|
die "$(gettext "Bad HEAD - I need a HEAD")"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check if we are bisecting.
|
# Check if we are bisecting.
|
||||||
@ -76,11 +83,11 @@ bisect_start() {
|
|||||||
# cogito usage, and cogito users should understand
|
# cogito usage, and cogito users should understand
|
||||||
# it relates to cg-seek.
|
# it relates to cg-seek.
|
||||||
[ -s "$GIT_DIR/head-name" ] &&
|
[ -s "$GIT_DIR/head-name" ] &&
|
||||||
die "won't bisect on seeked tree"
|
die "$(gettext "won't bisect on seeked tree")"
|
||||||
start_head="${head#refs/heads/}"
|
start_head="${head#refs/heads/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "Bad HEAD - strange symbolic ref"
|
die "$(gettext "Bad HEAD - strange symbolic ref")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@ -110,7 +117,7 @@ bisect_start() {
|
|||||||
*)
|
*)
|
||||||
rev=$(git rev-parse -q --verify "$arg^{commit}") || {
|
rev=$(git rev-parse -q --verify "$arg^{commit}") || {
|
||||||
test $has_double_dash -eq 1 &&
|
test $has_double_dash -eq 1 &&
|
||||||
die "'$arg' does not appear to be a valid revision"
|
die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case $bad_seen in
|
case $bad_seen in
|
||||||
@ -155,7 +162,7 @@ bisect_write() {
|
|||||||
case "$state" in
|
case "$state" in
|
||||||
bad) tag="$state" ;;
|
bad) tag="$state" ;;
|
||||||
good|skip) tag="$state"-"$rev" ;;
|
good|skip) tag="$state"-"$rev" ;;
|
||||||
*) die "Bad bisect_write argument: $state" ;;
|
*) die "$(eval_gettext "Bad bisect_write argument: \$state")" ;;
|
||||||
esac
|
esac
|
||||||
git update-ref "refs/bisect/$tag" "$rev" || exit
|
git update-ref "refs/bisect/$tag" "$rev" || exit
|
||||||
echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
|
echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
|
||||||
@ -183,7 +190,7 @@ bisect_skip() {
|
|||||||
do
|
do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
*..*)
|
*..*)
|
||||||
revs=$(git rev-list "$arg") || die "Bad rev input: $arg" ;;
|
revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;;
|
||||||
*)
|
*)
|
||||||
revs=$(git rev-parse --sq-quote "$arg") ;;
|
revs=$(git rev-parse --sq-quote "$arg") ;;
|
||||||
esac
|
esac
|
||||||
@ -197,10 +204,10 @@ bisect_state() {
|
|||||||
state=$1
|
state=$1
|
||||||
case "$#,$state" in
|
case "$#,$state" in
|
||||||
0,*)
|
0,*)
|
||||||
die "Please call 'bisect_state' with at least one argument." ;;
|
die "$(gettext "Please call 'bisect_state' with at least one argument.")" ;;
|
||||||
1,bad|1,good|1,skip)
|
1,bad|1,good|1,skip)
|
||||||
rev=$(git rev-parse --verify HEAD) ||
|
rev=$(git rev-parse --verify HEAD) ||
|
||||||
die "Bad rev input: HEAD"
|
die "$(gettext "Bad rev input: HEAD")"
|
||||||
bisect_write "$state" "$rev"
|
bisect_write "$state" "$rev"
|
||||||
check_expected_revs "$rev" ;;
|
check_expected_revs "$rev" ;;
|
||||||
2,bad|*,good|*,skip)
|
2,bad|*,good|*,skip)
|
||||||
@ -209,13 +216,13 @@ bisect_state() {
|
|||||||
for rev in "$@"
|
for rev in "$@"
|
||||||
do
|
do
|
||||||
sha=$(git rev-parse --verify "$rev^{commit}") ||
|
sha=$(git rev-parse --verify "$rev^{commit}") ||
|
||||||
die "Bad rev input: $rev"
|
die "$(eval_gettext "Bad rev input: \$rev")"
|
||||||
eval="$eval bisect_write '$state' '$sha'; "
|
eval="$eval bisect_write '$state' '$sha'; "
|
||||||
done
|
done
|
||||||
eval "$eval"
|
eval "$eval"
|
||||||
check_expected_revs "$@" ;;
|
check_expected_revs "$@" ;;
|
||||||
*,bad)
|
*,bad)
|
||||||
die "'git bisect bad' can take only one argument." ;;
|
die "$(gettext "'git bisect bad' can take only one argument.")" ;;
|
||||||
*)
|
*)
|
||||||
usage ;;
|
usage ;;
|
||||||
esac
|
esac
|
||||||
@ -238,25 +245,38 @@ bisect_next_check() {
|
|||||||
t,,good)
|
t,,good)
|
||||||
# have bad but not good. we could bisect although
|
# have bad but not good. we could bisect although
|
||||||
# this is less optimum.
|
# this is less optimum.
|
||||||
echo >&2 'Warning: bisecting only with a bad commit.'
|
(
|
||||||
|
gettext "Warning: bisecting only with a bad commit." &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
if test -t 0
|
if test -t 0
|
||||||
then
|
then
|
||||||
printf >&2 'Are you sure [Y/n]? '
|
# TRANSLATORS: Make sure to include [Y] and [n] in your
|
||||||
|
# translation. The program will only accept English input
|
||||||
|
# at this point.
|
||||||
|
gettext "Are you sure [Y/n]? " >&2
|
||||||
read yesno
|
read yesno
|
||||||
case "$yesno" in [Nn]*) exit 1 ;; esac
|
case "$yesno" in [Nn]*) exit 1 ;; esac
|
||||||
fi
|
fi
|
||||||
: bisect without good...
|
: bisect without good...
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
THEN=''
|
|
||||||
test -s "$GIT_DIR/BISECT_START" || {
|
if test -s "$GIT_DIR/BISECT_START"
|
||||||
echo >&2 'You need to start by "git bisect start".'
|
then
|
||||||
THEN='then '
|
(
|
||||||
}
|
gettext "You need to give me at least one good and one bad revisions.
|
||||||
echo >&2 'You '$THEN'need to give me at least one good' \
|
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
|
||||||
'and one bad revisions.'
|
echo
|
||||||
echo >&2 '(You can use "git bisect bad" and' \
|
) >&2
|
||||||
'"git bisect good" for that.)'
|
else
|
||||||
|
(
|
||||||
|
gettext "You need to start by \"git bisect start\".
|
||||||
|
You then need to give me at least one good and one bad revisions.
|
||||||
|
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
|
fi
|
||||||
exit 1 ;;
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -307,13 +327,15 @@ bisect_visualize() {
|
|||||||
|
|
||||||
bisect_reset() {
|
bisect_reset() {
|
||||||
test -s "$GIT_DIR/BISECT_START" || {
|
test -s "$GIT_DIR/BISECT_START" || {
|
||||||
echo "We are not bisecting."
|
gettext "We are not bisecting."; echo
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case "$#" in
|
case "$#" in
|
||||||
0) branch=$(cat "$GIT_DIR/BISECT_START") ;;
|
0) branch=$(cat "$GIT_DIR/BISECT_START") ;;
|
||||||
1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null ||
|
1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null || {
|
||||||
die "'$1' is not a valid commit"
|
invalid="$1"
|
||||||
|
die "$(eval_gettext "'\$invalid' is not a valid commit")"
|
||||||
|
}
|
||||||
branch="$1" ;;
|
branch="$1" ;;
|
||||||
*)
|
*)
|
||||||
usage ;;
|
usage ;;
|
||||||
@ -321,8 +343,8 @@ bisect_reset() {
|
|||||||
if git checkout "$branch" -- ; then
|
if git checkout "$branch" -- ; then
|
||||||
bisect_clean_state
|
bisect_clean_state
|
||||||
else
|
else
|
||||||
die "Could not check out original HEAD '$branch'." \
|
die "$(eval_gettext "Could not check out original HEAD '\$branch'.
|
||||||
"Try 'git bisect reset <commit>'."
|
Try 'git bisect reset <commit>'.")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,8 +367,9 @@ bisect_clean_state() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bisect_replay () {
|
bisect_replay () {
|
||||||
test "$#" -eq 1 || die "No logfile given"
|
file="$1"
|
||||||
test -r "$1" || die "cannot read $1 for replaying"
|
test "$#" -eq 1 || die "$(gettext "No logfile given")"
|
||||||
|
test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")"
|
||||||
bisect_reset
|
bisect_reset
|
||||||
while read git bisect command rev
|
while read git bisect command rev
|
||||||
do
|
do
|
||||||
@ -362,9 +385,9 @@ bisect_replay () {
|
|||||||
good|bad|skip)
|
good|bad|skip)
|
||||||
bisect_write "$command" "$rev" ;;
|
bisect_write "$command" "$rev" ;;
|
||||||
*)
|
*)
|
||||||
die "?? what are you talking about?" ;;
|
die "$(gettext "?? what are you talking about?")" ;;
|
||||||
esac
|
esac
|
||||||
done <"$1"
|
done <"$file"
|
||||||
bisect_auto_next
|
bisect_auto_next
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,14 +396,18 @@ bisect_run () {
|
|||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
echo "running $@"
|
command="$@"
|
||||||
|
eval_gettext "running \$command"; echo
|
||||||
"$@"
|
"$@"
|
||||||
res=$?
|
res=$?
|
||||||
|
|
||||||
# Check for really bad run error.
|
# Check for really bad run error.
|
||||||
if [ $res -lt 0 -o $res -ge 128 ]; then
|
if [ $res -lt 0 -o $res -ge 128 ]; then
|
||||||
echo >&2 "bisect run failed:"
|
(
|
||||||
echo >&2 "exit code $res from '$@' is < 0 or >= 128"
|
eval_gettext "bisect run failed:
|
||||||
|
exit code \$res from '\$command' is < 0 or >= 128" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
exit $res
|
exit $res
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -402,18 +429,24 @@ bisect_run () {
|
|||||||
|
|
||||||
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
|
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
|
||||||
> /dev/null; then
|
> /dev/null; then
|
||||||
echo >&2 "bisect run cannot continue any more"
|
(
|
||||||
|
gettext "bisect run cannot continue any more" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
exit $res
|
exit $res
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $res -ne 0 ]; then
|
if [ $res -ne 0 ]; then
|
||||||
echo >&2 "bisect run failed:"
|
(
|
||||||
echo >&2 "'bisect_state $state' exited with error code $res"
|
eval_gettext "bisect run failed:
|
||||||
|
'bisect_state \$state' exited with error code \$res" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
exit $res
|
exit $res
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null; then
|
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null; then
|
||||||
echo "bisect run success"
|
gettext "bisect run success"; echo
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -421,7 +454,7 @@ bisect_run () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bisect_log () {
|
bisect_log () {
|
||||||
test -s "$GIT_DIR/BISECT_LOG" || die "We are not bisecting."
|
test -s "$GIT_DIR/BISECT_LOG" || die "$(gettext "We are not bisecting.")"
|
||||||
cat "$GIT_DIR/BISECT_LOG"
|
cat "$GIT_DIR/BISECT_LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
git-pull.sh
34
git-pull.sh
@ -9,6 +9,7 @@ LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEA
|
|||||||
SUBDIRECTORY_OK=Yes
|
SUBDIRECTORY_OK=Yes
|
||||||
OPTIONS_SPEC=
|
OPTIONS_SPEC=
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
. git-sh-i18n
|
||||||
set_reflog_action "pull $*"
|
set_reflog_action "pull $*"
|
||||||
require_work_tree
|
require_work_tree
|
||||||
cd_to_toplevel
|
cd_to_toplevel
|
||||||
@ -17,20 +18,20 @@ cd_to_toplevel
|
|||||||
die_conflict () {
|
die_conflict () {
|
||||||
git diff-index --cached --name-status -r --ignore-submodules HEAD --
|
git diff-index --cached --name-status -r --ignore-submodules HEAD --
|
||||||
if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
|
if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
|
||||||
die "Pull is not possible because you have unmerged files.
|
die "$(gettext "Pull is not possible because you have unmerged files.
|
||||||
Please, fix them up in the work tree, and then use 'git add/rm <file>'
|
Please, fix them up in the work tree, and then use 'git add/rm <file>'
|
||||||
as appropriate to mark resolution, or use 'git commit -a'."
|
as appropriate to mark resolution, or use 'git commit -a'.")"
|
||||||
else
|
else
|
||||||
die "Pull is not possible because you have unmerged files."
|
die "$(gettext "Pull is not possible because you have unmerged files.")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
die_merge () {
|
die_merge () {
|
||||||
if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
|
if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
|
||||||
die "You have not concluded your merge (MERGE_HEAD exists).
|
die "$(gettext "You have not concluded your merge (MERGE_HEAD exists).
|
||||||
Please, commit your changes before you can merge."
|
Please, commit your changes before you can merge.")"
|
||||||
else
|
else
|
||||||
die "You have not concluded your merge (MERGE_HEAD exists)."
|
die "$(gettext "You have not concluded your merge (MERGE_HEAD exists).")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ test true = "$rebase" && {
|
|||||||
# On an unborn branch
|
# On an unborn branch
|
||||||
if test -f "$GIT_DIR/index"
|
if test -f "$GIT_DIR/index"
|
||||||
then
|
then
|
||||||
die "updating an unborn branch with changes added to the index"
|
die "$(gettext "updating an unborn branch with changes added to the index")"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
require_clean_work_tree "pull with rebase" "Please commit or stash them."
|
require_clean_work_tree "pull with rebase" "Please commit or stash them."
|
||||||
@ -216,17 +217,20 @@ then
|
|||||||
# $orig_head commit, but we are merging into $curr_head.
|
# $orig_head commit, but we are merging into $curr_head.
|
||||||
# First update the working tree to match $curr_head.
|
# First update the working tree to match $curr_head.
|
||||||
|
|
||||||
echo >&2 "Warning: fetch updated the current branch head."
|
(
|
||||||
echo >&2 "Warning: fast-forwarding your working tree from"
|
eval_gettext "Warning: fetch updated the current branch head.
|
||||||
echo >&2 "Warning: commit $orig_head."
|
Warning: fast-forwarding your working tree from
|
||||||
|
Warning: commit \$orig_head." &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
git update-index -q --refresh
|
git update-index -q --refresh
|
||||||
git read-tree -u -m "$orig_head" "$curr_head" ||
|
git read-tree -u -m "$orig_head" "$curr_head" ||
|
||||||
die 'Cannot fast-forward your working tree.
|
die "$(eval_gettext "Cannot fast-forward your working tree.
|
||||||
After making sure that you saved anything precious from
|
After making sure that you saved anything precious from
|
||||||
$ git diff '$orig_head'
|
$ git diff \$orig_head
|
||||||
output, run
|
output, run
|
||||||
$ git reset --hard
|
$ git reset --hard
|
||||||
to recover.'
|
to recover.")"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -241,11 +245,11 @@ case "$merge_head" in
|
|||||||
?*' '?*)
|
?*' '?*)
|
||||||
if test -z "$orig_head"
|
if test -z "$orig_head"
|
||||||
then
|
then
|
||||||
die "Cannot merge multiple branches into empty head"
|
die "$(gettext "Cannot merge multiple branches into empty head")"
|
||||||
fi
|
fi
|
||||||
if test true = "$rebase"
|
if test true = "$rebase"
|
||||||
then
|
then
|
||||||
die "Cannot rebase onto multiple branches"
|
die "$(gettext "Cannot rebase onto multiple branches")"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
81
git-stash.sh
81
git-stash.sh
@ -14,6 +14,7 @@ SUBDIRECTORY_OK=Yes
|
|||||||
OPTIONS_SPEC=
|
OPTIONS_SPEC=
|
||||||
START_DIR=`pwd`
|
START_DIR=`pwd`
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
. git-sh-i18n
|
||||||
require_work_tree
|
require_work_tree
|
||||||
cd_to_toplevel
|
cd_to_toplevel
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ no_changes () {
|
|||||||
clear_stash () {
|
clear_stash () {
|
||||||
if test $# != 0
|
if test $# != 0
|
||||||
then
|
then
|
||||||
die "git stash clear with parameters is unimplemented"
|
die "$(gettext "git stash clear with parameters is unimplemented")"
|
||||||
fi
|
fi
|
||||||
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
|
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
|
||||||
then
|
then
|
||||||
@ -61,7 +62,7 @@ create_stash () {
|
|||||||
then
|
then
|
||||||
head=$(git rev-list --oneline -n 1 HEAD --)
|
head=$(git rev-list --oneline -n 1 HEAD --)
|
||||||
else
|
else
|
||||||
die "You do not have the initial commit yet"
|
die "$(gettext "You do not have the initial commit yet")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if branch=$(git symbolic-ref -q HEAD)
|
if branch=$(git symbolic-ref -q HEAD)
|
||||||
@ -76,7 +77,7 @@ create_stash () {
|
|||||||
i_tree=$(git write-tree) &&
|
i_tree=$(git write-tree) &&
|
||||||
i_commit=$(printf 'index on %s\n' "$msg" |
|
i_commit=$(printf 'index on %s\n' "$msg" |
|
||||||
git commit-tree $i_tree -p $b_commit) ||
|
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"
|
if test -z "$patch_mode"
|
||||||
then
|
then
|
||||||
@ -90,7 +91,7 @@ create_stash () {
|
|||||||
git write-tree &&
|
git write-tree &&
|
||||||
rm -f "$TMPindex"
|
rm -f "$TMPindex"
|
||||||
) ) ||
|
) ) ||
|
||||||
die "Cannot save the current worktree state"
|
die "$(gettext "Cannot save the current worktree state")"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -103,14 +104,14 @@ create_stash () {
|
|||||||
|
|
||||||
# state of the working tree
|
# state of the working tree
|
||||||
w_tree=$(GIT_INDEX_FILE="$TMP-index" git write-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" &&
|
git diff-tree -p HEAD $w_tree > "$TMP-patch" &&
|
||||||
test -s "$TMP-patch" ||
|
test -s "$TMP-patch" ||
|
||||||
die "No changes selected"
|
die "$(gettext "No changes selected")"
|
||||||
|
|
||||||
rm -f "$TMP-index" ||
|
rm -f "$TMP-index" ||
|
||||||
die "Cannot remove temporary index (can't happen)"
|
die "$(gettext "Cannot remove temporary index (can't happen)")"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -123,7 +124,7 @@ create_stash () {
|
|||||||
fi
|
fi
|
||||||
w_commit=$(printf '%s\n' "$stash_msg" |
|
w_commit=$(printf '%s\n' "$stash_msg" |
|
||||||
git commit-tree $w_tree -p $b_commit -p $i_commit) ||
|
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 () {
|
save_stash () {
|
||||||
@ -151,8 +152,19 @@ save_stash () {
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "error: unknown option for 'stash save': $1"
|
option="$1"
|
||||||
echo " To provide a message, use git stash save -- '$1'"
|
# 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
|
||||||
|
# up the second line with however many characters the
|
||||||
|
# translation of "error: " takes in your language. E.g. in
|
||||||
|
# English this is:
|
||||||
|
#
|
||||||
|
# $ 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
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -167,11 +179,11 @@ save_stash () {
|
|||||||
git update-index -q --refresh
|
git update-index -q --refresh
|
||||||
if no_changes
|
if no_changes
|
||||||
then
|
then
|
||||||
say 'No local changes to save'
|
say "$(gettext "No local changes to save")"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
test -f "$GIT_DIR/logs/$ref_stash" ||
|
test -f "$GIT_DIR/logs/$ref_stash" ||
|
||||||
clear_stash || die "Cannot initialize stash"
|
clear_stash || die "$(gettext "Cannot initialize stash")"
|
||||||
|
|
||||||
create_stash "$stash_msg"
|
create_stash "$stash_msg"
|
||||||
|
|
||||||
@ -179,7 +191,7 @@ save_stash () {
|
|||||||
: >>"$GIT_DIR/logs/$ref_stash"
|
: >>"$GIT_DIR/logs/$ref_stash"
|
||||||
|
|
||||||
git update-ref -m "$stash_msg" $ref_stash $w_commit ||
|
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"
|
say Saved working directory and index state "$stash_msg"
|
||||||
|
|
||||||
if test -z "$patch_mode"
|
if test -z "$patch_mode"
|
||||||
@ -192,7 +204,7 @@ save_stash () {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
git apply -R < "$TMP-patch" ||
|
git apply -R < "$TMP-patch" ||
|
||||||
die "Cannot remove worktree changes"
|
die "$(gettext "Cannot remove worktree changes")"
|
||||||
|
|
||||||
if test "$keep_index" != "t"
|
if test "$keep_index" != "t"
|
||||||
then
|
then
|
||||||
@ -287,18 +299,21 @@ parse_flags_and_rev()
|
|||||||
|
|
||||||
case $# in
|
case $# in
|
||||||
0)
|
0)
|
||||||
have_stash || die "No stash found."
|
have_stash || die "$(gettext "No stash found.")"
|
||||||
set -- ${ref_stash}@{0}
|
set -- ${ref_stash}@{0}
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "Too many revisions specified: $REV"
|
die "$(eval_gettext "Too many revisions specified: \$REV")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || die "$1 is not valid reference"
|
REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || {
|
||||||
|
reference="$1"
|
||||||
|
die "$(eval_gettext "\$reference is not valid reference")"
|
||||||
|
}
|
||||||
|
|
||||||
i_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) &&
|
i_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) &&
|
||||||
set -- $(git rev-parse $REV $REV^1 $REV: $REV^1: $REV^2: 2>/dev/null) &&
|
set -- $(git rev-parse $REV $REV^1 $REV: $REV^1: $REV^2: 2>/dev/null) &&
|
||||||
@ -320,7 +335,10 @@ is_stash_like()
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_stash_like() {
|
assert_stash_like() {
|
||||||
is_stash_like "$@" || die "'$*' is not a stash-like commit"
|
is_stash_like "$@" || {
|
||||||
|
args="$*"
|
||||||
|
die "$(eval_gettext "'\$args' is not a stash-like commit")"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is_stash_ref() {
|
is_stash_ref() {
|
||||||
@ -328,18 +346,21 @@ is_stash_ref() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_stash_ref() {
|
assert_stash_ref() {
|
||||||
is_stash_ref "$@" || die "'$*' is not a stash reference"
|
is_stash_ref "$@" || {
|
||||||
|
args="$*"
|
||||||
|
die "$(eval_gettext "'\$args' is not a stash reference")"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_stash () {
|
apply_stash () {
|
||||||
|
|
||||||
assert_stash_like "$@"
|
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
|
# current index state
|
||||||
c_tree=$(git write-tree) ||
|
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=
|
unstashed_index_tree=
|
||||||
if test -n "$INDEX_OPTION" && test "$b_tree" != "$i_tree" &&
|
if test -n "$INDEX_OPTION" && test "$b_tree" != "$i_tree" &&
|
||||||
@ -347,9 +368,9 @@ apply_stash () {
|
|||||||
then
|
then
|
||||||
git diff-tree --binary $s^2^..$s^2 | git apply --cached
|
git diff-tree --binary $s^2^..$s^2 | git apply --cached
|
||||||
test $? -ne 0 &&
|
test $? -ne 0 &&
|
||||||
die 'Conflicts in index. Try without --index.'
|
die "$(gettext "Conflicts in index. Try without --index.")"
|
||||||
unstashed_index_tree=$(git write-tree) ||
|
unstashed_index_tree=$(git write-tree) ||
|
||||||
die 'Could not save index tree'
|
die "$(gettext "Could not save index tree")"
|
||||||
git reset
|
git reset
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -375,7 +396,7 @@ apply_stash () {
|
|||||||
git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" &&
|
git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" &&
|
||||||
git read-tree --reset $c_tree &&
|
git read-tree --reset $c_tree &&
|
||||||
git update-index --add --stdin <"$a" ||
|
git update-index --add --stdin <"$a" ||
|
||||||
die "Cannot unstage modified files"
|
die "$(gettext "Cannot unstage modified files")"
|
||||||
rm -f "$a"
|
rm -f "$a"
|
||||||
fi
|
fi
|
||||||
squelch=
|
squelch=
|
||||||
@ -389,7 +410,10 @@ apply_stash () {
|
|||||||
status=$?
|
status=$?
|
||||||
if test -n "$INDEX_OPTION"
|
if test -n "$INDEX_OPTION"
|
||||||
then
|
then
|
||||||
echo >&2 'Index was not unstashed.'
|
(
|
||||||
|
gettext "Index was not unstashed." &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
fi
|
fi
|
||||||
exit $status
|
exit $status
|
||||||
fi
|
fi
|
||||||
@ -406,14 +430,15 @@ drop_stash () {
|
|||||||
assert_stash_ref "$@"
|
assert_stash_ref "$@"
|
||||||
|
|
||||||
git reflog delete --updateref --rewrite "${REV}" &&
|
git reflog delete --updateref --rewrite "${REV}" &&
|
||||||
say "Dropped ${REV} ($s)" || die "${REV}: Could not drop stash entry"
|
say "$(eval_gettext "Dropped \${REV} (\$s)")" ||
|
||||||
|
die "$(eval_gettext "\${REV}: Could not drop stash entry")"
|
||||||
|
|
||||||
# clear_stash if we just dropped the last 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
|
git rev-parse --verify "$ref_stash@{0}" > /dev/null 2>&1 || clear_stash
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_to_branch () {
|
apply_to_branch () {
|
||||||
test -n "$1" || die 'No branch name specified'
|
test -n "$1" || die "$(gettext "No branch name specified")"
|
||||||
branch=$1
|
branch=$1
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
@ -484,7 +509,7 @@ branch)
|
|||||||
case $# in
|
case $# in
|
||||||
0)
|
0)
|
||||||
save_stash &&
|
save_stash &&
|
||||||
say '(To restore them type "git stash apply")'
|
say "$(gettext "(To restore them type \"git stash apply\")")"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
|
@ -14,6 +14,7 @@ USAGE="[--quiet] add [-b branch] [-f|--force] [--reference <repository>] [--] <r
|
|||||||
or: $dashless [--quiet] sync [--] [<path>...]"
|
or: $dashless [--quiet] sync [--] [<path>...]"
|
||||||
OPTIONS_SPEC=
|
OPTIONS_SPEC=
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
. git-sh-i18n
|
||||||
. git-parse-remote
|
. git-parse-remote
|
||||||
require_work_tree
|
require_work_tree
|
||||||
|
|
||||||
@ -34,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=/
|
||||||
@ -52,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
|
||||||
;;
|
;;
|
||||||
@ -104,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"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,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")"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -201,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
|
||||||
|
|
||||||
@ -218,13 +219,16 @@ 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
|
||||||
echo >&2 "The following path is ignored by one of your .gitignore files:" &&
|
(
|
||||||
echo >&2 $path &&
|
eval_gettext "The following path is ignored by one of your .gitignore files:
|
||||||
echo >&2 "Use -f if you really want to add it."
|
\$path
|
||||||
|
Use -f if you really want to add it." &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -233,9 +237,9 @@ cmd_add()
|
|||||||
then
|
then
|
||||||
if test -d "$path"/.git -o -f "$path"/.git
|
if test -d "$path"/.git -o -f "$path"/.git
|
||||||
then
|
then
|
||||||
echo "Adding existing repo at '$path' to the index"
|
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
|
||||||
@ -258,16 +262,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'")"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -305,7 +309,7 @@ cmd_foreach()
|
|||||||
do
|
do
|
||||||
if test -e "$path"/.git
|
if test -e "$path"/.git
|
||||||
then
|
then
|
||||||
say "Entering '$prefix$path'"
|
say "$(eval_gettext "Entering '\$prefix\$path'")"
|
||||||
name=$(module_name "$path")
|
name=$(module_name "$path")
|
||||||
(
|
(
|
||||||
prefix="$prefix$path/"
|
prefix="$prefix$path/"
|
||||||
@ -317,7 +321,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
|
||||||
}
|
}
|
||||||
@ -360,7 +364,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
|
||||||
@ -370,14 +374,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,8 +464,8 @@ cmd_update()
|
|||||||
# Only mention uninitialized submodules when its
|
# Only mention uninitialized submodules when its
|
||||||
# path have been specified
|
# path have been specified
|
||||||
test "$#" != "0" &&
|
test "$#" != "0" &&
|
||||||
say "Submodule path '$path' not initialized" &&
|
say "$(eval_gettext "Submodule path '\$path' not initialized
|
||||||
say "Maybe you want to use 'update --init'?"
|
Maybe you want to use 'update --init'?")"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -473,7 +477,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"
|
||||||
@ -497,7 +501,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?
|
||||||
@ -510,30 +514,29 @@ cmd_update()
|
|||||||
case "$update_module" in
|
case "$update_module" in
|
||||||
rebase)
|
rebase)
|
||||||
command="git rebase"
|
command="git rebase"
|
||||||
action="rebase"
|
die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$path'")"
|
||||||
msg="rebased onto"
|
say_msg="$(eval_gettext "Submodule path '\$path': rebased into '\$sha1'")"
|
||||||
;;
|
;;
|
||||||
merge)
|
merge)
|
||||||
command="git merge"
|
command="git merge"
|
||||||
action="merge"
|
die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$path'")"
|
||||||
msg="merged in"
|
say_msg="$(eval_gettext "Submodule path '\$path': merged in '\$sha1'")"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
command="git checkout $subforce -q"
|
command="git checkout $subforce -q"
|
||||||
action="checkout"
|
die_msg="$(eval_gettext "Unable to checkout '\$sha1' in submodule path '\$path'")"
|
||||||
msg="checked out"
|
say_msg="$(eval_gettext "Submodule path '\$path': checked out '\$sha1'")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
(clear_local_git_env; cd "$path" && $command "$sha1") ||
|
(clear_local_git_env; cd "$path" && $command "$sha1") || die $die_msg
|
||||||
die "Unable to $action '$sha1' in submodule path '$path'"
|
say $say_msg
|
||||||
say "Submodule path '$path': $msg '$sha1'"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
@ -617,7 +620,7 @@ cmd_summary() {
|
|||||||
if [ -n "$files" ]
|
if [ -n "$files" ]
|
||||||
then
|
then
|
||||||
test -n "$cached" &&
|
test -n "$cached" &&
|
||||||
die "--cached cannot be used with --files"
|
die "$(gettext -- "--cached cannot be used with --files")"
|
||||||
diff_cmd=diff-files
|
diff_cmd=diff-files
|
||||||
head=
|
head=
|
||||||
fi
|
fi
|
||||||
@ -657,7 +660,10 @@ cmd_summary() {
|
|||||||
;; # removed
|
;; # removed
|
||||||
*)
|
*)
|
||||||
# unexpected type
|
# unexpected type
|
||||||
echo >&2 "unexpected mode $mod_dst"
|
(
|
||||||
|
eval_gettext "unexpected mode \$mod_dst" &&
|
||||||
|
echo
|
||||||
|
) >&2
|
||||||
continue ;;
|
continue ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@ -675,13 +681,13 @@ cmd_summary() {
|
|||||||
total_commits=
|
total_commits=
|
||||||
case "$missing_src,$missing_dst" in
|
case "$missing_src,$missing_dst" in
|
||||||
t,)
|
t,)
|
||||||
errmsg=" Warn: $name doesn't contain commit $sha1_src"
|
errmsg="$(eval_gettext " Warn: \$name doesn't contain commit \$sha1_src")"
|
||||||
;;
|
;;
|
||||||
,t)
|
,t)
|
||||||
errmsg=" Warn: $name doesn't contain commit $sha1_dst"
|
errmsg="$(eval_gettext " Warn: \$name doesn't contain commit \$sha1_dst")"
|
||||||
;;
|
;;
|
||||||
t,t)
|
t,t)
|
||||||
errmsg=" Warn: $name doesn't contain commits $sha1_src and $sha1_dst"
|
errmsg="$(eval_gettext " Warn: \$name doesn't contain commits \$sha1_src and \$sha1_dst")"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
errmsg=
|
errmsg=
|
||||||
@ -706,11 +712,13 @@ cmd_summary() {
|
|||||||
sha1_abbr_dst=$(echo $sha1_dst | cut -c1-7)
|
sha1_abbr_dst=$(echo $sha1_dst | cut -c1-7)
|
||||||
if test $status = T
|
if test $status = T
|
||||||
then
|
then
|
||||||
|
blob="$(gettext "blob")"
|
||||||
|
submodule="$(gettext "submodule")"
|
||||||
if test $mod_dst = 160000
|
if test $mod_dst = 160000
|
||||||
then
|
then
|
||||||
echo "* $name $sha1_abbr_src(blob)->$sha1_abbr_dst(submodule)$total_commits:"
|
echo "* $name $sha1_abbr_src($blob)->$sha1_abbr_dst($submodule)$total_commits:"
|
||||||
else
|
else
|
||||||
echo "* $name $sha1_abbr_src(submodule)->$sha1_abbr_dst(blob)$total_commits:"
|
echo "* $name $sha1_abbr_src($submodule)->$sha1_abbr_dst($blob)$total_commits:"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "* $name $sha1_abbr_src...$sha1_abbr_dst$total_commits:"
|
echo "* $name $sha1_abbr_src...$sha1_abbr_dst$total_commits:"
|
||||||
@ -742,9 +750,9 @@ cmd_summary() {
|
|||||||
done |
|
done |
|
||||||
if test -n "$for_status"; then
|
if test -n "$for_status"; then
|
||||||
if [ -n "$files" ]; then
|
if [ -n "$files" ]; then
|
||||||
echo "# Submodules changed but not updated:"
|
gettext "# Submodules changed but not updated:"; echo
|
||||||
else
|
else
|
||||||
echo "# Submodule changes to be committed:"
|
gettext "# Submodule changes to be committed:"; echo
|
||||||
fi
|
fi
|
||||||
echo "#"
|
echo "#"
|
||||||
sed -e 's|^|# |' -e 's|^# $|#|'
|
sed -e 's|^|# |' -e 's|^# $|#|'
|
||||||
@ -830,7 +838,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
|
||||||
}
|
}
|
||||||
@ -874,7 +882,7 @@ cmd_sync()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
say "Synchronizing submodule url for '$name'"
|
say "$(eval_gettext "Synchronizing submodule url for '\$name'")"
|
||||||
git config submodule."$name".url "$url"
|
git config submodule."$name".url "$url"
|
||||||
|
|
||||||
if test -e "$path"/.git
|
if test -e "$path"/.git
|
||||||
|
@ -465,7 +465,7 @@ test_expect_success 'am newline in subject' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
|
sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
|
||||||
git am <patchnl >output.out 2>&1 &&
|
git am <patchnl >output.out 2>&1 &&
|
||||||
grep "^Applying: second \\\n foo$" output.out
|
test_i18ngrep "^Applying: second \\\n foo$" output.out
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'am -q is quiet' '
|
test_expect_success 'am -q is quiet' '
|
||||||
|
@ -45,8 +45,9 @@ do
|
|||||||
|
|
||||||
test_expect_success "am$with3 --skip continue after failed am$with3" '
|
test_expect_success "am$with3 --skip continue after failed am$with3" '
|
||||||
test_must_fail git am$with3 --skip >output &&
|
test_must_fail git am$with3 --skip >output &&
|
||||||
test "$(grep "^Applying" output)" = "Applying: 6" &&
|
test_i18ngrep "^Applying" output >output.applying &&
|
||||||
test_cmp file-2-expect file-2 &&
|
test_i18ngrep "^Applying: 6$" output.applying &&
|
||||||
|
test_i18ncmp file-2-expect file-2 &&
|
||||||
test ! -f .git/MERGE_RR
|
test ! -f .git/MERGE_RR
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ test_expect_success 'submodule add to .gitignored path fails' '
|
|||||||
git add --force .gitignore &&
|
git add --force .gitignore &&
|
||||||
git commit -m"Ignore everything" &&
|
git commit -m"Ignore everything" &&
|
||||||
! git submodule add "$submodurl" submod >actual 2>&1 &&
|
! git submodule add "$submodurl" submod >actual 2>&1 &&
|
||||||
test_cmp expect actual
|
test_i18ncmp expect actual
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ test_expect_success 'update --init' '
|
|||||||
|
|
||||||
git submodule update init > update.out &&
|
git submodule update init > update.out &&
|
||||||
cat update.out &&
|
cat update.out &&
|
||||||
grep "not initialized" update.out &&
|
test_i18ngrep "not initialized" update.out &&
|
||||||
! test -d init/.git &&
|
! test -d init/.git &&
|
||||||
|
|
||||||
git submodule update --init init &&
|
git submodule update --init init &&
|
||||||
|
@ -128,7 +128,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --cached' "
|
|||||||
< Add foo5
|
< Add foo5
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
test_cmp actual expected
|
test_i18ncmp actual expected
|
||||||
"
|
"
|
||||||
|
|
||||||
test_expect_success 'typechanged submodule(submodule->blob), --files' "
|
test_expect_success 'typechanged submodule(submodule->blob), --files' "
|
||||||
@ -138,7 +138,7 @@ test_expect_success 'typechanged submodule(submodule->blob), --files' "
|
|||||||
> Add foo5
|
> Add foo5
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
test_cmp actual expected
|
test_i18ncmp actual expected
|
||||||
"
|
"
|
||||||
|
|
||||||
rm -rf sm1 &&
|
rm -rf sm1 &&
|
||||||
@ -149,7 +149,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
|
|||||||
* sm1 $head4(submodule)->$head5(blob):
|
* sm1 $head4(submodule)->$head5(blob):
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
test_cmp actual expected
|
test_i18ncmp actual expected
|
||||||
"
|
"
|
||||||
|
|
||||||
rm -f sm1 &&
|
rm -f sm1 &&
|
||||||
@ -162,7 +162,7 @@ test_expect_success 'nonexistent commit' "
|
|||||||
Warn: sm1 doesn't contain commit $head4_full
|
Warn: sm1 doesn't contain commit $head4_full
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
test_cmp actual expected
|
test_i18ncmp actual expected
|
||||||
"
|
"
|
||||||
|
|
||||||
commit_file
|
commit_file
|
||||||
@ -173,7 +173,7 @@ test_expect_success 'typechanged submodule(blob->submodule)' "
|
|||||||
> Add foo7
|
> Add foo7
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
test_cmp expected actual
|
test_i18ncmp expected actual
|
||||||
"
|
"
|
||||||
|
|
||||||
commit_file sm1 &&
|
commit_file sm1 &&
|
||||||
@ -228,7 +228,7 @@ EOF
|
|||||||
|
|
||||||
test_expect_success '--for-status' "
|
test_expect_success '--for-status' "
|
||||||
git submodule summary --for-status HEAD^ >actual &&
|
git submodule summary --for-status HEAD^ >actual &&
|
||||||
test_cmp actual - <<EOF
|
test_i18ncmp actual - <<EOF
|
||||||
# Submodule changes to be committed:
|
# Submodule changes to be committed:
|
||||||
#
|
#
|
||||||
# * sm1 $head6...0000000:
|
# * sm1 $head6...0000000:
|
||||||
|
@ -90,7 +90,7 @@ test_expect_success 'submodule update does not fetch already present commits' '
|
|||||||
(cd super &&
|
(cd super &&
|
||||||
git submodule update > ../actual 2> ../actual.err
|
git submodule update > ../actual 2> ../actual.err
|
||||||
) &&
|
) &&
|
||||||
test_cmp expected actual &&
|
test_i18ncmp expected actual &&
|
||||||
! test -s actual.err
|
! test -s actual.err
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ test_expect_success 'test basic "submodule foreach" usage' '
|
|||||||
git config foo.bar zar &&
|
git config foo.bar zar &&
|
||||||
git submodule foreach "git config --file \"\$toplevel/.git/config\" foo.bar"
|
git submodule foreach "git config --file \"\$toplevel/.git/config\" foo.bar"
|
||||||
) &&
|
) &&
|
||||||
test_cmp expect actual
|
test_i18ncmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'setup nested submodules' '
|
test_expect_success 'setup nested submodules' '
|
||||||
@ -158,7 +158,7 @@ test_expect_success 'test messages from "foreach --recursive"' '
|
|||||||
cd clone2 &&
|
cd clone2 &&
|
||||||
git submodule foreach --recursive "true" > ../actual
|
git submodule foreach --recursive "true" > ../actual
|
||||||
) &&
|
) &&
|
||||||
test_cmp expect actual
|
test_i18ncmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat > expect <<EOF
|
cat > expect <<EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user