Re: [PATCH gitweb] Visually indicating patch size with horizontal bars
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Oct 28, 2005, 02:38 UTC
- Message-ID
- <Pine.LNX.4.64.0510271933140.4664@g5.osdl.org>
- In-Reply-To
- <46a038f90510271816i26389d5cqe136f515007ca057@mail.gmail.com>
On Fri, 28 Oct 2005, Martin Langhoff wrote:
Show 7 quoted lines
> > On 10/28/05, Junio C Hamano <junkio@cox.net> wrote: > > > which is pretty slow. Any suggestions? > > > > * do we really want to know the number of lines? > > What about both? And sugar (rename detection) on top! ;-)
Well, if you do full copy detection (and break detection), then git-diff-tree will actually have effectively calculated the size of the diff of each file. It just doesn't print them (well, it does a percentage for the renames/copies).
So you could make git-diff-tree tell you how big the patch was, without actually generating a patch at all. It will be quite a bit more expensive than just a plain "git-diff-tree -r --name-only", but if you cache the result is might be quite acceptable.
Caching the result might be as simple as just telling the caching web-server that the result is static and never changes - no need to cache things inside of gitweb itself. Just set expiration to "never".
Anybody wants to add a new output format to git-diff-tree that outputs how big the changes are in absolute terms (rather than the "similarity index", which is obviously relative to the original size of the file in question)?
Linus