From 8ef1c7c77d3e5950a839d9ae348827fa288a9a11 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Fri, 14 Jul 2006 00:47:23 -0400 Subject: Record rebase changes as 'rebase' in the reflog. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- git-am.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-am.sh') diff --git a/git-am.sh b/git-am.sh index db9a20a811..3a129e0021 100755 --- a/git-am.sh +++ b/git-am.sh @@ -91,6 +91,7 @@ fall_back_3way () { } prec=4 +rloga=am dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws= resolvemsg= while case "$#" in 0) break;; esac @@ -130,6 +131,9 @@ do --resolvemsg=*) resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;; + --reflog-action=*) + rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`; shift ;; + --) shift; break ;; -*) @@ -413,7 +417,7 @@ do parent=$(git-rev-parse --verify HEAD) && commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") && echo Committed: $commit && - git-update-ref -m "am: $SUBJECT" HEAD $commit $parent || + git-update-ref -m "$rloga: $SUBJECT" HEAD $commit $parent || stop_here $this if test -x "$GIT_DIR"/hooks/post-applypatch -- cgit v1.3 From cbd64afbb3b1ad5433585ac71d94bd0c63270e38 Mon Sep 17 00:00:00 2001 From: Lukas Sandström Date: Wed, 19 Jul 2006 22:28:00 +0200 Subject: git-am: Don't accept an mbox on stdin of we already have a .dotest directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It makes no sense to accept an mbox via stdin when we won't accept it on the commandline. The patch helps the following scenario: # git init-db "add file1 with content" # git checkout -b apply "edit file1 && commit" # git checkout -b conflict master "edit file1 && commit" # git checkout -b ok master "add file2" # git checkout apply # git format-patch -k -3 master..conflict | git am -k -3 => git-am fails with a conflict message # git reset --hard # git format-patch -k -3 master..ok | git am -k -3 => git am fails with the same conflict message as above, => since it's trying to apply the old .dotest directory With the patch it complains about an old .dotest directory instead. Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- git-am.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'git-am.sh') diff --git a/git-am.sh b/git-am.sh index 3a129e0021..04f0119435 100755 --- a/git-am.sh +++ b/git-am.sh @@ -156,8 +156,10 @@ fi if test -d "$dotest" then - test ",$#," = ",0," || - die "previous dotest directory $dotest still exists but mbox given." + if test ",$#," != ",0," || ! tty -s + then + die "previous dotest directory $dotest still exists but mbox given." + fi resume=yes else # Make sure we are not given --skip nor --resolved -- cgit v1.3