From: Chris Shoemaker Date: Thu, 27 Oct 2005 23:48:13 GMT Subject: Re: [PATCH gitweb] Visually indicating patch size with horizontal bars Message-ID: <20051027234813.GA512@pe.Belkin> In-Reply-To: <7vfyqm1uvx.fsf@assigned-by-dhcp.cox.net> On Thu, Oct 27, 2005 at 03:02:10PM -0700, Junio C Hamano wrote: > Chris Shoemaker writes: > > > If anyone thinks this is a good feature, then please tell me an > > efficient way to get some heuristic of the patch size. > > > > Right now, I'm using: > > > > GIT_DIFF_OPTS='-U 0' $gitbin/git-diff-tree -p $hash | wc -l > > > > which is pretty slow. Any suggestions? > > * do we really want to know the number of lines? sometimes the > number of pahts that are affected is more useful than number > of lines when assessing the damage, which can be done with > 'git-diff-tree --name-only'. That only shows the top-level names, so when 100s of files changes in a subdir it looks just like one entry. It's ok when there's no subdirs, but it just doesn't work when 95% of the code is under, e.g. src/. > > * cache the result -- they never change. True. Maybe gitk and gitweb can share a cache containing the tree diffs. Or maybe git-core can cache tree diffs? > > An interesting question is what to do with merges, but probably > we can just ignore it for now. It's trivial to, e.g. use a different image for merges, maybe based on # of parents? But, in general, is there interest in a visual indicator of commit size and/or type in gitweb? -chris