{"thread":{"id":"9811","subject":"very slow cherry-pick'ing (old-2.6-bkcvs tree)","startedAt":"2007-09-06T23:51:49Z","lastAt":"2007-09-07T07:27:21Z","messageCount":3,"participants":["Erez Zadok","Shawn O. Pearce","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"52821","messageId":"200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu","threadId":"9811","inReplyTo":null,"subject":"very slow cherry-pick'ing (old-2.6-bkcvs tree)","fromName":"Erez Zadok","fromEmail":"ezk@cs.sunysb.edu","sentAt":"2007-09-06T23:51:49Z","receivedAt":"2007-09-06T23:51:49Z","isPatch":false,"sender":{"key":"ezk@cs.sunysb.edu","avatar":null},"body":"Our group maintains Unionfs on the latest -rc kernel, but we also maintain\nseveral backports going all the way to 2.6.9.  Once we complete the\ndevelopment and testing of a feature/fix in -latest, we cherry-pick those\ncommits to older backports, and test those.  When I cherry-pick from -latest\nto my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when\nI cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is\nthere anything I can do to inspect what's going on and perhaps speed up the\ncherry-picking process?\n\nSome info:\n\nMy 2.6.{18,19,20,21,22} trees were cloned from\n\n   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.<N>.y.git\n\nMy 2.6.9 tree, however, was cloned from\n\n   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/old-2.6-bkcvs.git\n\nafter which, I truncated the tree (git-reset) to Linus commit which read\n\"Linux 2.6.9-final\".\n\nBTW, I first git-clone --bare to my git server, and then I clone from it to\nmy test machine.\n\nBTW2, I do git-repack and prune-packed every week.\n\nThanks,\nErez.\n"},{"id":"52844","messageId":"20070907044223.GW18160@spearce.org","threadId":"9811","inReplyTo":"200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu","subject":"Re: very slow cherry-pick'ing (old-2.6-bkcvs tree)","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-09-07T04:42:23Z","receivedAt":"2007-09-07T04:42:23Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Erez Zadok <ezk@cs.sunysb.edu> wrote:\n> Our group maintains Unionfs on the latest -rc kernel, but we also maintain\n> several backports going all the way to 2.6.9.  Once we complete the\n> development and testing of a feature/fix in -latest, we cherry-pick those\n> commits to older backports, and test those.  When I cherry-pick from -latest\n> to my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when\n> I cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is\n> there anything I can do to inspect what's going on and perhaps speed up the\n> cherry-picking process?\n\nI'm guessing its due to rename detection.\n\ngit-cherry-pick is implemented in terms of git-merge-recursive,\nwhich always does rename detection when files are deleted or added.\nThis can take some considerable time if there's a lot of files that\nhave been added/deleted.\n\nWhat would probably be faster would be to dump the patches in\nquestion using git-format-patch and then apply them using git-am.\nThis bypasses the rename detection as it is using strictly a diff\nand an apply.\n\n-- \nShawn.\n"},{"id":"52867","messageId":"46E0FD59.2060406@eudaptics.com","threadId":"9811","inReplyTo":"200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu","subject":"Re: very slow cherry-pick'ing (old-2.6-bkcvs tree)","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-09-07T07:27:21Z","receivedAt":"2007-09-07T07:27:21Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Erez Zadok schrieb:\n> Our group maintains Unionfs on the latest -rc kernel, but we also maintain\n> several backports going all the way to 2.6.9.  Once we complete the\n> development and testing of a feature/fix in -latest, we cherry-pick those\n> commits to older backports, and test those.  When I cherry-pick from -latest\n> to my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when\n> I cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is\n> there anything I can do to inspect what's going on and perhaps speed up the\n> cherry-picking process?\n> \n> Some info:\n> \n> My 2.6.{18,19,20,21,22} trees were cloned from\n> \n>    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.<N>.y.git\n> \n> My 2.6.9 tree, however, was cloned from\n> \n>    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/old-2.6-bkcvs.git\n> \n> after which, I truncated the tree (git-reset) to Linus commit which read\n> \"Linux 2.6.9-final\".\n\nI *think* that the reason for this is that those repositories don't have any \ncommits in common (but I don't have clones to verify my claim). Since \ncherry-pick does merge-recursive, it tries to find a suitable merge base, \nbut since there is no history in common, it walks both histories all the way \ndown only to find that there is no possible merge base.\n\nYou could improve the situation if you graft the histories together:\n\n   echo $first_commit_in_2.6.12 $suitable_commit_in_bkcvs > .git/info/grafts\n\n-- Hannes\n"}]}