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

[PATCH] Additional merge-base tests

From
A Large Angry SCM <gitzilla@gmail.com>
Date
Jul 4, 2006, 03:55 UTC
Message-ID
<44A9E6AE.10508@gmail.com>
Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
---
This demonstrates a problem with git-merge-base.
 t6010-merge-base.sh |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+)
diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index 1dce123..9a815bd 100755
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
@@ -44,6 +44,31 @@ A=$(doit 1 A $B)
 G=$(doit 7 G $B $E)
 H=$(doit 8 H $A $F)
 
+# Setup for second test set
+#
+#   PL  PR
+#  /  \/  \
+# L2  C2  R2
+# |   |   |
+# L1  C1  R1
+# |   |   |
+# L0  C0  R0
+#   \ |  /
+#     S
+
+S=$(doit  0 S)
+C0=$(doit -3 C0 $S)
+L0=$(doit  2 L0 $S)
+R0=$(doit  2 R0 $S)
+C1=$(doit -2 C1 $C0)
+L1=$(doit  3 L1 $L0)
+R1=$(doit  3 R1 $R0)
+C2=$(doit -1 C2 $C1)
+L2=$(doit  4 L2 $L1)
+R2=$(doit  4 R2 $R1)
+PL=$(doit  1 PL $L2 $C2)
+PR=$(doit  1 PR $C2 $R2)
+
 test_expect_success 'compute merge-base (single)' \
     'MB=$(git-merge-base G H) &&
      expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
@@ -56,4 +81,12 @@ test_expect_success 'compute merge-base 
     'MB=$(git-show-branch --merge-base G H) &&
      expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
 
+test_expect_success 'compute merge-base (single)' \
+    'MB=$(git-merge-base PL PR) &&
+     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/C2"'
+
+test_expect_success 'compute merge-base (all)' \
+    'MB=$(git-merge-base --all PL PR) &&
+     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/C2"'
+
 test_done
Next: Junio C Hamano
Message 1 of 26 in “Additional merge-base tests”
  1. Additional merge-base testsA Large Angry SCM, Jul 4, 2006
  2. Junio C HamanoJul 4, 2006
  3. A Large Angry SCMJul 4, 2006
  4. Junio C HamanoJul 4, 2006
  5. Junio C HamanoJul 4, 2006
  6. Johannes SchindelinJul 4, 2006
  7. Junio C HamanoJul 4, 2006
  8. Jakub NarebskiJul 4, 2006
  9. Johannes SchindelinJul 4, 2006
  10. Johannes SchindelinJul 4, 2006
  11. A Large Angry SCMJul 4, 2006
  12. Junio C HamanoJul 4, 2006
  13. Johannes SchindelinJul 4, 2006
  14. Junio C HamanoJul 4, 2006
  15. A Large Angry SCMJul 4, 2006
  16. Jakub NarebskiJul 4, 2006
  17. Junio C HamanoJul 4, 2006
  18. A Large Angry SCMJul 5, 2006
  19. Junio C HamanoJul 5, 2006
  20. Johannes SchindelinJul 5, 2006
  21. A Large Angry SCMJul 5, 2006
  22. Johannes SchindelinJul 5, 2006
  23. Josef WeidendorferJul 5, 2006
  24. A Large Angry SCMJul 5, 2006
  25. A Large Angry SCMJul 4, 2006
  26. Junio C HamanoJul 5, 2006

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.