From: Junio C Hamano Date: Fri, 19 Aug 2011 05:07:54 +0000 (-0700) Subject: Merge branch 'ma/am-exclude' X-Git-Tag: v1.7.7-rc0~20 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d8308c79fc2cae2d1891f92b9e0f9ec0361fe7df?ds=inline;hp=-c Merge branch 'ma/am-exclude' * ma/am-exclude: am: Document new --exclude= option am: pass exclude down to apply --- d8308c79fc2cae2d1891f92b9e0f9ec0361fe7df diff --combined git-am.sh index 65924246d0,4ea2f2fe0e..57150eb7ba --- a/git-am.sh +++ b/git-am.sh @@@ -22,6 -22,7 +22,7 @@@ whitespace= pass it through git-app ignore-space-change pass it through git-apply ignore-whitespace pass it through git-apply directory= pass it through git-apply + exclude= pass it through git-apply C= pass it through git-apply p= pass it through git-apply patch-format= format the patch(es) are in @@@ -37,14 -38,13 +38,14 @@@ rerere-autoupdate update the index wit rebasing* (internal use for git-rebase)" . git-sh-setup +. git-sh-i18n prefix=$(git rev-parse --show-prefix) set_reflog_action am require_work_tree cd_to_toplevel 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 then @@@ -89,11 -89,8 +90,11 @@@ safe_to_abort () then return 0 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 } @@@ -102,9 -99,9 +103,9 @@@ stop_here_user_resolve () printf '%s\n' "$resolvemsg" stop_here $1 fi - echo "When you have resolved this problem run \"$cmdline --resolved\"." - echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"." - echo "To restore the original branch and stop patching run \"$cmdline --abort\"." + eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\". +If you would prefer to skip this patch, instead run \"\$cmdline --skip\". +To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo stop_here $1 } @@@ -118,7 -115,7 +119,7 @@@ go_next () cannot_fallback () { echo "$1" - echo "Cannot fall back to three-way merge." + gettext "Cannot fall back to three-way merge."; echo exit 1 } @@@ -133,7 -130,7 +134,7 @@@ fall_back_3way () "$dotest/patch" && GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \ 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... if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \ @@@ -142,8 -139,8 +143,8 @@@ mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base" mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index" else - cannot_fallback "Did you hand edit your patch? -It does not apply to blobs recorded in its index." + cannot_fallback "$(gettext "Did you hand edit your patch? +It does not apply to blobs recorded in its index.")" fi test -f "$dotest/patch-merge-index" && @@@ -151,7 -148,7 +152,7 @@@ orig_tree=$(cat "$dotest/patch-merge-base") && 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, # orig_tree may be wildly different from ours, but his_tree @@@ -258,7 -255,7 +259,7 @@@ split_patches () stgit-series) if test $# -ne 1 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 series_dir=`dirname "$1"` series_file="$1" @@@ -310,9 -307,9 +311,9 @@@ ;; *) 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 - clean_abort "Patch format detection failed." + clean_abort "$(gettext "Patch format detection failed.")" fi ;; esac @@@ -362,11 -359,11 +363,11 @@@ d --rebasing) rebasing=t threeway=t keep=t scissors=f no_inbody_headers=t ;; -d|--dotest) - die "-d option is no longer supported. Do not use." + die "$(gettext "-d option is no longer supported. Do not use.")" ;; --resolvemsg) shift; resolvemsg=$1 ;; - --whitespace|--directory) + --whitespace|--directory|--exclude) git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;; -C|-p) git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;; @@@ -425,12 -422,12 +426,12 @@@ the false ;; 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 case "$skip,$abort" in t,t) - die "Please make up your mind. --skip or --abort?" + die "$(gettext "Please make up your mind. --skip or --abort?")" ;; t,) git rerere clear @@@ -457,7 -454,7 +458,7 @@@ else # Make sure we are not given --skip, --resolved, nor --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. mkdir -p "$dotest" || exit @@@ -511,8 -508,6 +512,8 @@@ fi fi +git update-index -q --refresh + case "$resolved" in '') case "$HAS_HEAD" in @@@ -524,7 -519,7 +525,7 @@@ if test "$files" then 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 esac @@@ -613,9 -608,9 +614,9 @@@ d go_next && continue test -s "$dotest/patch" || { - echo "Patch is empty. Was it split wrong?" - echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"." - echo "To restore the original branch and stop patching run \"$cmdline --abort\"." + eval_gettext "Patch is empty. Was it split wrong? +If you would prefer to skip this patch, instead run \"\$cmdline --skip\". +To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo stop_here $this } rm -f "$dotest/original-commit" "$dotest/author-script" @@@ -650,7 -645,7 +651,7 @@@ if test -z "$GIT_AUTHOR_EMAIL" 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 fi @@@ -697,18 -692,15 +698,18 @@@ if test "$interactive" = t then 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 while test "$action" = again do - echo "Commit Body is:" + gettext "Commit Body is:"; echo echo "--------------------------" cat "$dotest/final-commit" 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 case "$reply" in [yY]*) action=yes ;; @@@ -744,7 -736,7 +745,7 @@@ stop_here $this fi - say "Applying: $FIRSTLINE" + say "$(eval_gettext "Applying: \$FIRSTLINE")" case "$resolved" in '') @@@ -765,16 -757,16 +766,16 @@@ # working tree. resolved= git diff-index --quiet --cached HEAD -- && { - echo "No changes - did you forget to use 'git add'?" - echo "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." + gettext "No changes - did you forget to use 'git add'? +If there is nothing left to stage, chances are that something else +already introduced the same changes; you might want to skip this patch."; echo stop_here_user_resolve $this } unmerged=$(git ls-files -u) if test -n "$unmerged" then - echo "You still have unmerged paths in your index" - echo "did you forget to use 'git add'?" + gettext "You still have unmerged paths in your index +did you forget to use 'git add'?"; echo stop_here_user_resolve $this fi apply_status=0 @@@ -789,7 -781,7 +790,7 @@@ # Applying the patch to an earlier tree and merging the # result may have produced the same tree as ours. git diff-index --quiet --cached HEAD -- && { - say No changes -- Patch already applied. + say "$(gettext "No changes -- Patch already applied.")" go_next continue } @@@ -799,7 -791,7 +800,7 @@@ fi if test $apply_status != 0 then - printf 'Patch failed at %s %s\n' "$msgnum" "$FIRSTLINE" + eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo stop_here_user_resolve $this fi @@@ -815,7 -807,7 +816,7 @@@ GIT_AUTHOR_DATE= fi 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" then