git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t3400 (rebase): add failing test for a peculiar rev spec

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 18, 2013, 08:52 UTC
Message-ID
<1366275155-26244-1-git-send-email-artagnon@gmail.com>

'git rebase' does not recognize revisions specified as :/text. This is because the attempts to rev-parse ${REV}^0, which fails in this case. Add a test to document this failure.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 Okay, so I'm not sure what the right fix for this is.
 - The :/text syntax seems to be broken in the first place, as it
   can't be combined with ^ or @.  I'd like to be able to say
   {:/bardery}^1, or even {:/foomery}^{/communist mule}.  Why
   shouldn't I be allowed to do this?
 - The failure occurs in git-rebase.sh:403.  Is it using the ^0 only
   to make sure that the revision specified is a commit?  Surely,
   there'a a better way to do this?
 Can someone point me in the right direction?
 t/t3400-rebase.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index f6cc102..42ca1e0 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 :/text' '
+	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 "<>")
 '
-- 
1.8.2.1.423.g4fb5c0a.dirty
Next: Junio C Hamano
Message 1 of 6 in “t3400 (rebase): add failing test for a peculiar rev spec”
  1. t3400 (rebase): add failing test for a peculiar rev specRamkumar Ramachandra, Apr 18, 2013
  2. Junio C HamanoApr 18, 2013
  3. Ramkumar RamachandraApr 19, 2013
  4. Junio C HamanoApr 19, 2013
  5. Junio C HamanoApr 19, 2013
  6. Junio C HamanoApr 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.