From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Sixt Subject: Re: [PATCH (GIT-GUI,GITK) 6/8] gitk: Port new encoding logic from git-gui. Date: Mon, 22 Sep 2008 09:46:49 +0200 Message-ID: <48D74D69.4010802@viscovery.net> References: <1221685659-476-1-git-send-email-angavrilov@gmail.com> <48D3A376.30905@viscovery.net> <200809212252.35769.angavrilov@gmail.com> <48D74877.9050607@viscovery.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org, "Shawn O. Pearce" , Paul Mackerras To: Alexander Gavrilov X-From: git-owner@vger.kernel.org Mon Sep 22 09:48:00 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Khg9G-0003kO-Nu for gcvg-git-2@gmane.org; Mon, 22 Sep 2008 09:47:59 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751645AbYIVHqu (ORCPT ); Mon, 22 Sep 2008 03:46:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751733AbYIVHqu (ORCPT ); Mon, 22 Sep 2008 03:46:50 -0400 Received: from lilzmailso02.liwest.at ([212.33.55.13]:30907 "EHLO lilzmailso02.liwest.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbYIVHqt (ORCPT ); Mon, 22 Sep 2008 03:46:49 -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 ) id 1Khg88-0002S8-2f; Mon, 22 Sep 2008 09:46:48 +0200 Received: from [127.0.0.1] (J6T.linz.viscovery [192.168.1.42]) by linz.eudaptics.com (Postfix) with ESMTP id D09496EF; Mon, 22 Sep 2008 09:46:47 +0200 (CEST) User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <48D74877.9050607@viscovery.net> X-Enigmail-Version: 0.95.5 X-Spam-Score: 1.7 (+) X-Spam-Report: ALL_TRUSTED=-1.8, BAYES_99=3.5 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Johannes Sixt schrieb: > Alexander Gavrilov schrieb: >> Subject: [PATCH] gitk: Implement batch lookup and caching of encoding attrs. >> >> When the diff contains thousands of files, calling git-check-attr >> once per file is very slow. With this patch gitk does attribute >> lookup in batches of 30 files while reading the diff file list, >> which leads to a very noticeable speedup. > > This one does not work for me: The correct is not picked up anymore, The correct _encoding_ is not picked up anymore... > neither in Patch mode nor Tree mode. (It works as expected without this > patch.) > >> +proc cache_gitattr {attr pathlist} { >> + global path_attr_cache >> + set newlist {} >> + foreach path $pathlist { >> + if {[info exists path_attr_cache($attr,$path)]} continue >> + lappend newlist $path >> + } >> + while {$newlist ne {}} { >> + set head [lrange $newlist 0 29] >> + set newlist [lrange $newlist 30 end] >> + if {![catch {set rlist [eval exec git check-attr $attr -- $head]}]} { >> + foreach row [split $rlist "\n"] { >> + set cols [split $row :] > > This colon made me nervous (because of the drive-colon combination on > Windows), but as long as you feed relative paths into 'git check-attr', > this should not matter (in my case). This comment does not imply that I debugged this code. I just noticed the colon while reading the patch. >> + set path [lindex $cols 0] >> + set value [join [lrange $cols 2 end] :] >> + if {[string index $path 0] eq "\""} { >> + set path [encoding convertfrom [lindex $path 0]] >> + } >> + set path_attr_cache($attr,$path) $value >> + } >> + } >> + update >> + } >> +}