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

[PATCH v2 1/2] git-p4: ensure complex branches are cloned correctly

From
Joachim Kuebart via GitGitGadget <gitgitgadget@gmail.com>
Date
May 5, 2021, 11:56 UTC
Message-ID
<0ee0b7b55691a8923c7fd1610adfe8854163dcfc.1620215786.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1013.v2.git.git.1620215786.gitgitgadget@gmail.com>
From: Joachim Kuebart <joachim.kuebart@gmail.com>

When importing a branch from p4, git-p4 searches the history of the parent branch for the branch point. The test for the complex branch structure ensures all files have the expected contents, but doesn't examine the branch structure.

Check for the correct branch structure by making sure that the initial commit on each branch is empty. This ensures that the initial commit's parent is indeed the correct branch-off point.

Signed-off-by: Joachim Kuebart <joachim.kuebart@gmail.com>
---
 t/t9801-git-p4-branch.sh | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index ff94c3f17df1..50a6f8bad5c5 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -294,11 +294,13 @@ test_expect_success 'git p4 clone complex branches' '
 		test_path_is_file file3 &&
 		grep update file2 &&
 		git reset --hard p4/depot/branch4 &&
+		git diff-tree --quiet HEAD &&
 		test_path_is_file file1 &&
 		test_path_is_file file2 &&
 		test_path_is_missing file3 &&
 		! grep update file2 &&
 		git reset --hard p4/depot/branch5 &&
+		git diff-tree --quiet HEAD &&
 		test_path_is_file file1 &&
 		test_path_is_file file2 &&
 		test_path_is_file file3 &&
-- 
gitgitgadget
Previous: Joachim Kuebart via GitGitGadgetNext: Joachim Kuebart via GitGitGadget
Message 9 of 10 in “git-p4: speed up search for branch parent”
  1. git-p4: speed up search for branch parentJoachim Kuebart via GitGitGadget, Apr 28, 2021
  2. Junio C HamanoApr 29, 2021
  3. Joachim KuebartApr 29, 2021
  4. Luke DiamandApr 29, 2021
  5. Junio C HamanoApr 29, 2021
  6. Joachim KuebartApr 29, 2021
  7. Joachim KuebartApr 29, 2021
  8. 0/2 git-p4: speed up search for branch parentJoachim Kuebart via GitGitGadget, May 5, 2021
  9. 1/2 git-p4: ensure complex branches are cloned correctlyJoachim Kuebart via GitGitGadget, May 5, 2021
  10. 2/2 git-p4: speed up search for branch parentJoachim Kuebart via GitGitGadget, May 5, 2021

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.