[PATCH 2/2] Record rebase changes as 'rebase' in the reflog.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 git-am.sh     |    6 +++++-
 git-rebase.sh |    9 ++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index db9a20a..3a129e0 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
diff --git a/git-rebase.sh b/git-rebase.sh
index 6d06665..14d7ed9 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -131,7 +131,8 @@ do
 			finish_rb_merge
 			exit
 		fi
-		git-am --resolved --3way --resolvemsg="$RESOLVEMSG"
+		git-am --resolved --3way --resolvemsg="$RESOLVEMSG" \
+			--reflog-action=rebase
 		exit
 		;;
 	--skip)
@@ -150,7 +151,8 @@ do
 			finish_rb_merge
 			exit
 		fi
-		git-am -3 --skip --resolvemsg="$RESOLVEMSG"
+		git-am -3 --skip --resolvemsg="$RESOLVEMSG" \
+			--reflog-action=rebase
 		exit
 		;;
 	--abort)
@@ -288,7 +290,8 @@ fi
 if test -z "$do_merge"
 then
 	git-format-patch -k --stdout --full-index "$upstream"..ORIG_HEAD |
-	git-am --binary -3 -k --resolvemsg="$RESOLVEMSG"
+	git-am --binary -3 -k --resolvemsg="$RESOLVEMSG" \
+		--reflog-action=rebase
 	exit $?
 fi
 
-- 
1.4.1.gd3d5

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]