From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbbCKPFf (ORCPT ); Wed, 11 Mar 2015 11:05:35 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:37810 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbbCKPFd (ORCPT ); Wed, 11 Mar 2015 11:05:33 -0400 MIME-Version: 1.0 In-Reply-To: References: <1426072565-22296-1-git-send-email-valentinrothberg@gmail.com> <1426075485.4244.112.camel@x220> From: Valentin Rothberg Date: Wed, 11 Mar 2015 16:04:55 +0100 Message-ID: Subject: Re: [PATCH] checkkconfigsymbols.py: make it Git aware To: Paul Bolle Cc: Greg KH , hengelein Stefan , linux-kernel@vger.kernel.org, Andreas Ruprecht Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It seems that using 'git cat-file blob commit:path' instead of 'git reset --hard commit' + open is much more expensive. The execution time jumps from 3 secs to 3 mins. Paul, how long does your monster run? Maybe I just call it wrong or mess up with caches. Kind regards, Valentin On Wed, Mar 11, 2015 at 3:33 PM, Valentin Rothberg wrote: > On Wed, Mar 11, 2015 at 3:19 PM, Valentin Rothberg > wrote: >> On Wed, Mar 11, 2015 at 1:04 PM, Paul Bolle wrote: >>> On Wed, 2015-03-11 at 12:16 +0100, Valentin Rothberg wrote: >>>> Note that both options require to 'git reset --hard' the user's Git >>>> tree, which can lead to the loss of uncommitted data. >>> >>> My local "800 line perl monster" basically does >>> git ls-tree -r $commit_or_tag >>> >>> which allows you to generate a list of files and their corresponding >>> hashes (it also helps with filtering out symlinks by the way). >>> >>> The you can do >>> git cat-file blob $commit:$path >>> >>> or just >>> git cat-file blob $hash >>> >>> for every file you're interested in and parse the output of that file >>> (in memory, as it were). None of that messes with the current state of >>> the tree you're working on. >> >> That's a good point. I used cat-file once in another script but >> totally forgot its existence, thanks : ) The patch is already queued, >> so I will change the behavior to your suggestion soon. > > Sorry for confusion. This patch is not queued yet. The one that > filters toos/ has been queued : ) > > Valentin