From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/3] t/rebase: add failing tests for a peculiar revision
Date: Thu, 13 Jun 2013 23:46:00 +0530 [thread overview]
Message-ID: <1371147362-26962-2-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1371147362-26962-1-git-send-email-artagnon@gmail.com>
The following commands fail, even if :/quuxery resolves to a perfectly
valid commit:
$ git rebase :/quuxery
$ git rebase -i :/quuxery
This is because rebase [-i] attempts to rev-parse ${REV}^0 to verify
that the given revision resolves to a commit. Add tests to document
these failures.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
t/t3400-rebase.sh | 8 ++++++++
t/t3404-rebase-interactive.sh | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index b58fa1a..890f159 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -88,6 +88,14 @@ test_expect_success 'rebase fast-forward to master' '
test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
'
+test_expect_failure 'rebase against revision specified as :/quuxery' '
+ git checkout my-topic-branch^ &&
+ sha1=$(git rev-parse ":/Add B") &&
+ git rebase $sha1 &&
+ git checkout my-topic-branch^ &&
+ git rebase ":/Add B"
+'
+
test_expect_success 'the rebase operation should not have destroyed author information' '
! (git log | grep "Author:" | grep "<>")
'
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 79e8d3c..ca4ee92 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -947,4 +947,12 @@ test_expect_success 'rebase -i respects core.commentchar' '
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
'
+test_expect_failure 'rebase -i against revision specified as :/quuxery' '
+ git checkout branch1 &&
+ sha1=$(git rev-parse ":/J") &&
+ git rebase $sha1 &&
+ git checkout branch1 &&
+ git rebase ":/J"
+'
+
test_done
--
1.8.3.1.381.g31c8856.dirty
next prev parent reply other threads:[~2013-06-13 18:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 18:15 [PATCH 0/3] Support :/quuxery in rebase (early preview) Ramkumar Ramachandra
2013-06-13 18:16 ` Ramkumar Ramachandra [this message]
2013-06-13 18:16 ` [PATCH 2/3] sh-setup: add new peel_committish() helper Ramkumar Ramachandra
2013-06-13 18:16 ` [PATCH 3/3] rebase: use peel_committish() where appropriate Ramkumar Ramachandra
-- strict thread matches above, loose matches on Subject: below --
2013-06-14 13:17 [PATCH 0/3] Get rebase to work with :/foomery committish Ramkumar Ramachandra
2013-06-14 13:17 ` [PATCH 1/3] t/rebase: add failing tests for a peculiar revision Ramkumar Ramachandra
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371147362-26962-2-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@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.
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).