Re: [PATCH (GIT-GUI,GITK) 6/8] gitk: Port new encoding logic from git-gui.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
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).

> +				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
> +	}
> +}

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux