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

Re: git merge performance problem..

From
Junio C Hamano <junkio@cox.net>
Date
Jul 16, 2006, 04:24 UTC
Message-ID
<7vlkqukwhb.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v7j2eme3u.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 16 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes:
>
>> Junio, I think there is something wrong with git-merge. It sometimes takes 
>> up to ten seconds, and it's stuck at the
>>
>> 	git-show-branch --independent "$head" "$@"
>>
>> call.
>>
>> I don't know quite what that thing is even meant to do (we do already know 
>> the parents, why do we do something special here?) but even apart from 
>> that, the whole thing must be doing something seriously wrong, since it 
>> takes so long. Does it check the whole commit history?
>
> The code is to cull redundant parents primarily in octopus and
> is not strictly necessary.

Wrong. The commit log says it was to remove redundant parents; I think this as a reaction after seeing a few incorrectly made merge commits in the kernel archive.

> ..., but in your case you never do an octopus so
> that would be the other branch head) to see what is going on
> please?

Disregard this request please. I see a few commits that this step takes a long time to process in the kernel archive. The last merge before you left to Ottawa was one of them.

b5032a5 48ce8b0

I do not think we need to do the --independent check there especially for two-head cases because we have already done fast-forward and up-to-date tests when we get there, so let's revert that part from commit 6ea2334.

-- >8 --
diff --git a/git-merge.sh b/git-merge.sh
index 24e3b50..ee41077 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -314,7 +314,11 @@ # If we have a resulting tree, that mean
 # auto resolved the merge cleanly.
 if test '' != "$result_tree"
 then
-    parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
+    parents="-p $head"
+    for remote
+    do
+	parents="$parents -p $remote"
+    done
     result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
     finish "$result_commit" "Merge $result_commit, made by $wt_strategy."
     dropsave
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 6 in “git merge performance problem..”
  1. Linus TorvaldsJul 15, 2006
  2. Junio C HamanoJul 16, 2006
  3. Junio C HamanoJul 16, 2006
  4. Linus TorvaldsJul 16, 2006
  5. Junio C HamanoJul 16, 2006
  6. Linus TorvaldsJul 16, 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.