git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Junio C Hamano <junio@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH 2/2] t3412: use log|name-rev instead of log --graph
Date: Fri, 30 Jan 2009 23:47:01 +0100	[thread overview]
Message-ID: <1233355621-4783-2-git-send-email-trast@student.ethz.ch> (raw)
In-Reply-To: <1233355621-4783-1-git-send-email-trast@student.ethz.ch>

Replace all 'git log --graph' calls for history verification with the
combination of 'git log ...| git name-rev' first introduced by a6c7a27
(rebase -i: correctly remember --root flag across --continue,
2009-01-26).  This should be less susceptible to format changes than
the --graph code.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t3412-rebase-root.sh |   65 ++++++++++++++++++++++++++++-------------------
 1 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 8a9154a..57a3cad 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -10,6 +10,12 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
 GIT_EDITOR=:
 export GIT_EDITOR
 
+log_with_names () {
+	git rev-list --topo-order --parents --pretty="tformat:%s" HEAD |
+	git name-rev --stdin --name-only --refs=refs/heads/$1
+}
+
+
 test_expect_success 'prepare repository' '
 	test_commit 1 A &&
 	test_commit 2 A &&
@@ -102,21 +108,25 @@ test_expect_success 'set up merge history' '
 	git merge side
 '
 
-sed 's/#/ /g' > expect-side <<'EOF'
-*   Merge branch 'side' into other
-|\##
-| * 5
-* | 4
-|/##
-* 3
-* 2
-* 1
+cat > expect-side <<'EOF'
+commit work6 work6~1 work6^2
+Merge branch 'side' into other
+commit work6^2 work6~2
+5
+commit work6~1 work6~2
+4
+commit work6~2 work6~3
+3
+commit work6~3 work6~4
+2
+commit work6~4
+1
 EOF
 
 test_expect_success 'rebase -i -p with merge' '
 	git checkout -b work6 other &&
 	git rebase -i -p --root --onto master &&
-	git log --graph --topo-order --pretty=tformat:"%s" > rebased6 &&
+	log_with_names work6 > rebased6 &&
 	test_cmp expect-side rebased6
 '
 
@@ -129,25 +139,29 @@ test_expect_success 'set up second root and merge' '
 	git merge third
 '
 
-sed 's/#/ /g' > expect-third <<'EOF'
-*   Merge branch 'third' into other
-|\##
-| * 6
-* |   Merge branch 'side' into other
-|\ \##
-| * | 5
-* | | 4
-|/ /##
-* | 3
-|/##
-* 2
-* 1
+cat > expect-third <<'EOF'
+commit work7 work7~1 work7^2
+Merge branch 'third' into other
+commit work7^2 work7~4
+6
+commit work7~1 work7~2 work7~1^2
+Merge branch 'side' into other
+commit work7~1^2 work7~3
+5
+commit work7~2 work7~3
+4
+commit work7~3 work7~4
+3
+commit work7~4 work7~5
+2
+commit work7~5
+1
 EOF
 
 test_expect_success 'rebase -i -p with two roots' '
 	git checkout -b work7 other &&
 	git rebase -i -p --root --onto master &&
-	git log --graph --topo-order --pretty=tformat:"%s" > rebased7 &&
+	log_with_names work7 > rebased7 &&
 	test_cmp expect-third rebased7
 '
 
@@ -263,8 +277,7 @@ test_expect_success 'fix the conflict' '
 
 test_expect_success 'rebase -i -p --root with conflict (second part)' '
 	git rebase --continue &&
-	git rev-list --topo-order --parents --pretty="tformat:%s" HEAD |
-	git name-rev --stdin --name-only --refs=refs/heads/conflict3 >out &&
+	log_with_names conflict3 >out &&
 	test_cmp expect-conflict-p out
 '
 
-- 
1.6.1.2.464.g6066

  reply	other threads:[~2009-01-30 22:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 23:31 [PATCH 0/2] rebase -i --root cleanups Johannes Schindelin
2009-01-25 23:31 ` [PATCH 1/2] rebase -i --root: simplify code Johannes Schindelin
2009-01-25 23:49   ` Thomas Rast
2009-01-25 23:53     ` Thomas Rast
2009-01-26  5:54       ` Junio C Hamano
2009-01-26  9:05         ` [PATCH] rebase -i: correctly remember --root flag across --continue Thomas Rast
2009-01-26 20:47           ` Junio C Hamano
2009-01-26 21:05           ` Junio C Hamano
2009-01-26 21:09             ` Jeff King
2009-01-26 21:12               ` Jeff King
2009-01-26 21:28             ` Thomas Rast
2009-01-27  0:29               ` Junio C Hamano
2009-01-26 21:49             ` Junio C Hamano
2009-01-30 22:43               ` Thomas Rast
2009-01-30 22:47                 ` [PATCH 1/2] t3412: clean up GIT_EDITOR usage Thomas Rast
2009-01-30 22:47                   ` Thomas Rast [this message]
2009-02-01 22:24                   ` Johannes Schindelin
2009-02-02  8:39                     ` Thomas Rast
2009-01-26  0:44     ` [PATCH 1/2] rebase -i --root: simplify code Johannes Schindelin
2009-01-25 23:32 ` [PATCH 2/2] rebase -i --root: fix check for number of arguments Johannes Schindelin
2009-01-26  0:07   ` Thomas Rast
2009-01-26  0:49     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1233355621-4783-2-git-send-email-trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=junio@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).