From mboxrd@z Thu Jan  1 00:00:00 1970
From: Erez Zadok <ezk@cs.sunysb.edu>
Subject: very slow cherry-pick'ing (old-2.6-bkcvs tree)
Date: Thu, 6 Sep 2007 19:51:49 -0400
Message-ID: <200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu>
Cc: ezk@cs.sunysb.edu
To: git@vger.kernel.org
X-From: git-owner@vger.kernel.org Fri Sep 07 01:52:03 2007
Return-path: <git-owner@vger.kernel.org>
Envelope-to: gcvg-git@gmane.org
Received: from vger.kernel.org ([209.132.176.167])
	by lo.gmane.org with esmtp (Exim 4.50)
	id 1ITR8j-0008PG-Sf
	for gcvg-git@gmane.org; Fri, 07 Sep 2007 01:52:02 +0200
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S932658AbXIFXv4 (ORCPT <rfc822;gcvg-git@m.gmane.org>);
	Thu, 6 Sep 2007 19:51:56 -0400
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964781AbXIFXv4
	(ORCPT <rfc822;git-outgoing>); Thu, 6 Sep 2007 19:51:56 -0400
Received: from filer.fsl.cs.sunysb.edu ([130.245.126.2]:35610 "EHLO
	filer.fsl.cs.sunysb.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S932657AbXIFXvz (ORCPT <rfc822;git@vger.kernel.org>);
	Thu, 6 Sep 2007 19:51:55 -0400
Received: from agora.fsl.cs.sunysb.edu (agora.fsl.cs.sunysb.edu [130.245.126.12])
	by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.1) with ESMTP id l86Npm5L023168;
	Thu, 6 Sep 2007 19:51:48 -0400
Received: from agora.fsl.cs.sunysb.edu (localhost.localdomain [127.0.0.1])
	by agora.fsl.cs.sunysb.edu (8.13.8/8.13.8) with ESMTP id l86Npn1s004810;
	Thu, 6 Sep 2007 19:51:49 -0400
Received: (from ezk@localhost)
	by agora.fsl.cs.sunysb.edu (8.13.8/8.12.8/Submit) id l86NpnAK004807;
	Thu, 6 Sep 2007 19:51:49 -0400
X-MailKey: Erez_Zadok
Sender: git-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: git@vger.kernel.org
Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/57950>

Our group maintains Unionfs on the latest -rc kernel, but we also maintain
several backports going all the way to 2.6.9.  Once we complete the
development and testing of a feature/fix in -latest, we cherry-pick those
commits to older backports, and test those.  When I cherry-pick from -latest
to my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when
I cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is
there anything I can do to inspect what's going on and perhaps speed up the
cherry-picking process?

Some info:

My 2.6.{18,19,20,21,22} trees were cloned from

   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.<N>.y.git

My 2.6.9 tree, however, was cloned from

   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/old-2.6-bkcvs.git

after which, I truncated the tree (git-reset) to Linus commit which read
"Linux 2.6.9-final".

BTW, I first git-clone --bare to my git server, and then I clone from it to
my test machine.

BTW2, I do git-repack and prune-packed every week.

Thanks,
Erez.

From mboxrd@z Thu Jan  1 00:00:00 1970
From: "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: very slow cherry-pick'ing (old-2.6-bkcvs tree)
Date: Fri, 7 Sep 2007 00:42:23 -0400
Message-ID: <20070907044223.GW18160@spearce.org>
References: <200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Cc: git@vger.kernel.org
To: Erez Zadok <ezk@cs.sunysb.edu>
X-From: git-owner@vger.kernel.org Fri Sep 07 06:42:45 2007
Return-path: <git-owner@vger.kernel.org>
Envelope-to: gcvg-git@gmane.org
Received: from vger.kernel.org ([209.132.176.167])
	by lo.gmane.org with esmtp (Exim 4.50)
	id 1ITVfv-0001J1-Fv
	for gcvg-git@gmane.org; Fri, 07 Sep 2007 06:42:35 +0200
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1751421AbXIGEm2 (ORCPT <rfc822;gcvg-git@m.gmane.org>);
	Fri, 7 Sep 2007 00:42:28 -0400
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751316AbXIGEm2
	(ORCPT <rfc822;git-outgoing>); Fri, 7 Sep 2007 00:42:28 -0400
Received: from corvette.plexpod.net ([64.38.20.226]:57853 "EHLO
	corvette.plexpod.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1751249AbXIGEm1 (ORCPT <rfc822;git@vger.kernel.org>);
	Fri, 7 Sep 2007 00:42:27 -0400
Received: from [74.70.48.173] (helo=asimov.home.spearce.org)
	by corvette.plexpod.net with esmtpa (Exim 4.68)
	(envelope-from <spearce@spearce.org>)
	id 1ITVfm-0001HW-1N; Fri, 07 Sep 2007 00:42:26 -0400
Received: by asimov.home.spearce.org (Postfix, from userid 1000)
	id 568AD20FBAE; Fri,  7 Sep 2007 00:42:24 -0400 (EDT)
Content-Disposition: inline
In-Reply-To: <200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu>
User-Agent: Mutt/1.5.11
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - corvette.plexpod.net
X-AntiAbuse: Original Domain - vger.kernel.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - spearce.org
Sender: git-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: git@vger.kernel.org
Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/57973>

Erez Zadok <ezk@cs.sunysb.edu> wrote:
> Our group maintains Unionfs on the latest -rc kernel, but we also maintain
> several backports going all the way to 2.6.9.  Once we complete the
> development and testing of a feature/fix in -latest, we cherry-pick those
> commits to older backports, and test those.  When I cherry-pick from -latest
> to my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when
> I cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is
> there anything I can do to inspect what's going on and perhaps speed up the
> cherry-picking process?

I'm guessing its due to rename detection.

git-cherry-pick is implemented in terms of git-merge-recursive,
which always does rename detection when files are deleted or added.
This can take some considerable time if there's a lot of files that
have been added/deleted.

What would probably be faster would be to dump the patches in
question using git-format-patch and then apply them using git-am.
This bypasses the rename detection as it is using strictly a diff
and an apply.

-- 
Shawn.

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Johannes Sixt <j.sixt@eudaptics.com>
Subject: Re: very slow cherry-pick'ing (old-2.6-bkcvs tree)
Date: Fri, 07 Sep 2007 09:27:21 +0200
Message-ID: <46E0FD59.2060406@eudaptics.com>
References: <200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Git Mailing List <git@vger.kernel.org>
To: Erez Zadok <ezk@cs.sunysb.edu>
X-From: git-owner@vger.kernel.org Fri Sep 07 09:27:31 2007
Return-path: <git-owner@vger.kernel.org>
Envelope-to: gcvg-git@gmane.org
Received: from vger.kernel.org ([209.132.176.167])
	by lo.gmane.org with esmtp (Exim 4.50)
	id 1ITYFV-0006Bi-Vu
	for gcvg-git@gmane.org; Fri, 07 Sep 2007 09:27:30 +0200
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756720AbXIGH1Z (ORCPT <rfc822;gcvg-git@m.gmane.org>);
	Fri, 7 Sep 2007 03:27:25 -0400
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932694AbXIGH1Y
	(ORCPT <rfc822;git-outgoing>); Fri, 7 Sep 2007 03:27:24 -0400
Received: from lilzmailso02.liwest.at ([212.33.55.13]:54148 "EHLO
	lilzmailso02.liwest.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1756245AbXIGH1Y (ORCPT <rfc822;git@vger.kernel.org>);
	Fri, 7 Sep 2007 03:27:24 -0400
Received: from cm56-163-160.liwest.at ([86.56.163.160] helo=linz.eudaptics.com)
	by lilzmailso02.liwest.at with esmtpa (Exim 4.66)
	(envelope-from <j.sixt@eudaptics.com>)
	id 1ITYFO-0007yR-HQ; Fri, 07 Sep 2007 09:27:22 +0200
Received: from [192.168.1.42] (J6T.linz.viscovery [192.168.1.42])
	by linz.eudaptics.com (Postfix) with ESMTP
	id 0D22654D; Fri,  7 Sep 2007 09:27:22 +0200 (CEST)
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
In-Reply-To: <200709062351.l86NpnAK004807@agora.fsl.cs.sunysb.edu>
X-Spam-Score: 1.3 (+)
X-Spam-Report: ALL_TRUSTED=-1.8, AWL=-0.355, BAYES_99=3.5
Sender: git-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: git@vger.kernel.org
Archived-At: <http://permalink.gmane.org/gmane.comp.version-control.git/57996>

Erez Zadok schrieb:
> Our group maintains Unionfs on the latest -rc kernel, but we also maintain
> several backports going all the way to 2.6.9.  Once we complete the
> development and testing of a feature/fix in -latest, we cherry-pick those
> commits to older backports, and test those.  When I cherry-pick from -latest
> to my 2.6.{22,21,20,19,18} repositories, it works reasonably fast.  But when
> I cherry-pick to my 2.6.9 tree, it runs about 20 times slower!  Why?  Is
> there anything I can do to inspect what's going on and perhaps speed up the
> cherry-picking process?
> 
> Some info:
> 
> My 2.6.{18,19,20,21,22} trees were cloned from
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.<N>.y.git
> 
> My 2.6.9 tree, however, was cloned from
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/old-2.6-bkcvs.git
> 
> after which, I truncated the tree (git-reset) to Linus commit which read
> "Linux 2.6.9-final".

I *think* that the reason for this is that those repositories don't have any 
commits in common (but I don't have clones to verify my claim). Since 
cherry-pick does merge-recursive, it tries to find a suitable merge base, 
but since there is no history in common, it walks both histories all the way 
down only to find that there is no possible merge base.

You could improve the situation if you graft the histories together:

   echo $first_commit_in_2.6.12 $suitable_commit_in_bkcvs > .git/info/grafts

-- Hannes

