git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] rebase -m: Fix incorrect short-logs of already applied commits.
@ 2007-09-01  7:25 Johannes Sixt
  2007-09-01  9:01 ` Junio C Hamano
  2007-09-01 12:11 ` Robin Rosenberg
  0 siblings, 2 replies; 15+ messages in thread
From: Johannes Sixt @ 2007-09-01  7:25 UTC (permalink / raw)
  To: Junio Hamano; +Cc: git

When a topic branch is rebased, some of whose commits are already
cherry-picked upstream:

    o--X--A--B--Y    <- master
     \
      A--B--Z        <- topic

then 'git rebase -m master' would report:

    Already applied: 0001 Y
    Already applied: 0002 Y

With this fix it reports the expected:

    Already applied: 0001 A
    Already applied: 0002 B

As an added bonus, this change also avoids 'echo' of a commit message,
which might contain escapements.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 git-rebase.sh |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index cbafa14..9cf0056 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,20 +59,23 @@ continue_merge () {
 		die "$RESOLVEMSG"
 	fi
 
+	cmt=`cat $dotest/current`
 	if ! git diff-index --quiet HEAD
 	then
-		if ! git-commit -C "`cat $dotest/current`"
+		if ! git-commit -C "$cmt"
 		then
 			echo "Commit failed, please do not call \"git commit\""
 			echo "directly, but instead do one of the following: "
 			die "$RESOLVEMSG"
 		fi
-		printf "Committed: %0${prec}d" $msgnum
+		printf "Committed: %0${prec}d " $msgnum
+		git rev-list --pretty=oneline -1 HEAD | \
+			sed 's/^[a-f0-9]\+ //'
 	else
-		printf "Already applied: %0${prec}d" $msgnum
+		printf "Already applied: %0${prec}d " $msgnum
+		git rev-list --pretty=oneline -1 "$cmt" | \
+			sed 's/^[a-f0-9]\+ //'
 	fi
-	echo ' '`git rev-list --pretty=oneline -1 HEAD | \
-				sed 's/^[a-f0-9]\+ //'`
 
 	prev_head=`git rev-parse HEAD^0`
 	# save the resulting commit so we can read-tree on it later
-- 
1.5.3.rc6.55.ga005

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-09-05 18:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-01  7:25 [PATCH] rebase -m: Fix incorrect short-logs of already applied commits Johannes Sixt
2007-09-01  9:01 ` Junio C Hamano
2007-09-01  9:05   ` [PATCH] rebase--interactive: do not use one-or-more (\+) in sed Junio C Hamano
2007-09-01 22:24     ` Johannes Schindelin
2007-09-02  6:53     ` David Kastrup
2007-09-02  7:02       ` Junio C Hamano
2007-09-02  7:20         ` David Kastrup
2007-09-02 13:39         ` Simon 'corecode' Schubert
2007-09-02 14:20           ` Johannes Schindelin
2007-09-02 17:07       ` Nix
2007-09-05 17:54         ` Benoit SIGOURE
2007-09-05 18:06           ` Nix
2007-09-01  9:20   ` [PATCH] rebase -m: Fix incorrect short-logs of already applied commits David Kastrup
2007-09-01 12:06   ` Johannes Sixt
2007-09-01 12:11 ` Robin Rosenberg

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).