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

[PATCH 2/2] t6010: add test to git merge-base --all --octopus

From
Василий Макаров <einmalfel@gmail.com>
Date
Dec 28, 2013, 11:04 UTC
Message-ID
<CABEtfDFRYkbVsJc2SZcCPwyUBAN=3dMv9yoYuoRce4c7VBxrkg@mail.gmail.com>
And here is the test:
with git 1.8.5.2 this test don't pass because of git merge-base may
return duplicates and incorrect set of bases (not best common
ancestors)
---
 t/t6010-merge-base.sh | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index f80bba8..8652c12 100755
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
@@ -230,4 +230,43 @@ test_expect_success 'criss-cross merge-base for
octopus-step' '
  test_cmp expected.sorted actual.sorted
 '

+test_expect_success 'merge-base --octopus --all for complex tree' '
+ # Best common ancestor for JE, JAA and JDD is JC
+ #             JE
+ #            / |
+ #           /  |
+ #          /   |
+ #  JAA    /    |
+ #   |\   /     |
+ #   | \  | JDD |
+ #   |  \ |/ |  |
+ #   |   JC JD  |
+ #   |    | /|  |
+ #   |    |/ |  |
+ #  JA    |  |  |
+ #   |\  /|  |  |
+ #   | JB |  |  |
+ #   \  \ | /   /
+ #    \__\|/___/
+ #        J
+ test_commit J &&
+ test_commit JB &&
+ git reset --hard J &&
+ test_commit JC &&
+ git reset --hard J &&
+ test_commit JTEMP1 &&
+ test_merge JA JB &&
+ test_merge JAA JC &&
+ git reset --hard J &&
+ test_commit JTEMP2 &&
+ test_merge JD JB &&
+ test_merge JDD JC &&
+ git reset --hard J &&
+ test_commit JTEMP3 &&
+ test_merge JE JC &&
+ git rev-parse JC > expected &&
+ git merge-base --all --octopus JAA JDD JE > actual &&
+ test_cmp expected actual
+'
+
 test_done
-- 
1.8.3.1
Message 1 of 1 in “t6010: add test to git merge-base --all --octopus”
  1. 2/2 t6010: add test to git merge-base --all --octopusВасилий Макаров, Dec 28, 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.