From: Junio C Hamano Date: Wed, 21 May 2008 21:27:59 +0000 (-0700) Subject: Merge branch 'maint-1.5.4' into maint X-Git-Tag: v1.5.5.2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/008442f5e798e511cc0cd5d9443552b0d107d558?hp=-c Merge branch 'maint-1.5.4' into maint * maint-1.5.4: git-am: fix typo in usage message doc/git-daemon: s/uploadarchive/uploadarch/ --- 008442f5e798e511cc0cd5d9443552b0d107d558 diff --combined git-am.sh index 75886a8f2f,4dce87bdff..b48096ec20 --- a/git-am.sh +++ b/git-am.sh @@@ -2,16 -2,15 +2,16 @@@ # # Copyright (c) 2005, 2006 Junio C Hamano +SUBDIRECTORY_OK=Yes OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ git-am [options] |... git-am [options] --resolved git-am [options] --skip -- -d,dotest= use and not .dotest +d,dotest= (removed -- do not use) i,interactive run interactively - b,binary pass --allo-binary-replacement to git-apply + b,binary pass --allow-binary-replacement to git-apply 3,3way allow fall back on 3way merging if needed s,signoff add a Signed-off-by line to the commit message u,utf8 recode into utf8 (default) @@@ -21,14 -20,11 +21,14 @@@ C= pass it through git-app p= pass it through git-apply resolvemsg= override error message when patch failure occurs r,resolved to be used after a patch failure -skip skip the current patch" +skip skip the current patch +rebasing (internal use for git-rebase)" . git-sh-setup +prefix=$(git rev-parse --show-prefix) set_reflog_action am require_work_tree +cd_to_toplevel git var GIT_COMMITTER_IDENT >/dev/null || exit @@@ -51,6 -47,10 +51,6 @@@ stop_here_user_resolve () then cmdline="$cmdline -3" fi - if test '.dotest' != "$dotest" - then - cmdline="$cmdline -d=$dotest" - fi echo "When you have resolved this problem run \"$cmdline --resolved\"." echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"." @@@ -118,8 -118,7 +118,8 @@@ It does not apply to blobs recorded in } prec=4 -dotest=.dotest sign= utf8=t keep= skip= interactive= resolved= binary= +dotest=".dotest" +sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= resolvemsg= resume= git_apply_opt= @@@ -144,11 -143,8 +144,11 @@@ d resolved=t ;; --skip) skip=t ;; + --rebasing) + rebasing=t threeway=t keep=t binary=t ;; -d|--dotest) - shift; dotest=$1;; + die "-d option is no longer supported. Do not use." + ;; --resolvemsg) shift; resolvemsg=$1 ;; --whitespace) @@@ -184,7 -180,7 +184,7 @@@ the 0,) # No file input but without resume parameters; catch # user error to feed us a patch from standard input - # when there is already .dotest. This is somewhat + # when there is already $dotest. This is somewhat # unreliable -- stdin could be /dev/null for example # and the caller did not intend to feed us a patch but # wanted to continue unattended. @@@ -204,24 -200,6 +204,24 @@@ els # Start afresh. mkdir -p "$dotest" || exit + if test -n "$prefix" && test $# != 0 + then + first=t + for arg + do + test -n "$first" && { + set x + first= + } + case "$arg" in + /*) + set "$@" "$arg" ;; + *) + set "$@" "$prefix$arg" ;; + esac + done + shift + fi git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" || { rm -fr "$dotest" exit 1 @@@ -236,12 -214,6 +236,12 @@@ echo "$utf8" >"$dotest/utf8" echo "$keep" >"$dotest/keep" echo 1 >"$dotest/next" + if test -n "$rebasing" + then + : >"$dotest/rebasing" + else + : >"$dotest/applying" + fi fi case "$resolved" in @@@ -327,20 -299,11 +327,20 @@@ d echo "Patch is empty. Was it split wrong?" stop_here $this } - SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" - case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac - - (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | - git stripspace > "$dotest/msg-clean" + if test -f "$dotest/rebasing" && + commit=$(sed -e 's/^From \([0-9a-f]*\) .*/\1/' \ + -e q "$dotest/$msgnum") && + test "$(git cat-file -t "$commit")" = commit + then + git cat-file commit "$commit" | + sed -e '1,/^$/d' >"$dotest/msg-clean" + else + SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" + case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac + + (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") | + git stripspace > "$dotest/msg-clean" + fi ;; esac @@@ -363,7 -326,7 +363,7 @@@ LAST_SIGNED_OFF_BY=` sed -ne '/^Signed-off-by: /p' \ "$dotest/msg-clean" | - tail -n 1 + sed -ne '$p' ` ADD_SIGNOFF=` test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {