Re: [PATCH gitk 0/4] gitk support for git log -L
From: Thomas Rast <hidden>
Date: 2016-06-15 22:58:27
Paul Mackerras [off-list ref] writes:
Hi Thomas, On Wed, Jul 31, 2013 at 03:17:41PM +0200, Thomas Rast wrote:quoted
Jens Lehmann [off-list ref] writes:quoted
Am 29.07.2013 21:37, schrieb Thomas Rast:quoted
Thomas Rast [off-list ref] writes:quoted
Thomas Rast [off-list ref] writes:quoted
Now that git log -L has hit master, I figure it's time to discuss the corresponding change to gitk.
[...]
One thing I worry about is having gitk storing in memory not just the history graph but also all the diffs (assuming I have understood correctly what you're doing). Gitk's memory consumption is already pretty large. However, I can't see an alternative at this point.
I don't think there is one. log -L is pretty much an "all or nothing" thing at this point. I suppose if we really found that the diffs are regularly too big to be manageable for gitk, we could invent a porcelain mode where 'log -L' just prints the detected commits and corresponding line ranges, and then have a new option to diff-tree to let it again filter that range. But note that ordinary 'git log -L' also buffers the entire set of diffs within less. The memory consumption of gitk to hold the same diffs in memory should be only a small factor of what less uses in the same scenario. Furthermore, users will typically ask for a small region of code (one function, or some such), so the diffs themselves are usually quite small, nowhere near the size of the full commit diffs.
quoted
Unfortunately it's turning out to be harder than I hoped. gitk runs the arguments through git-rev-parse, which only knows that -n gets an unstuck argument. Consequently, gitk accepts an unstuck -n but only stuck forms of -S and -G.Excuse my ignorance, but what do you mean by "stuck" vs. "unstuck"?
Whether the option value is a separate argument in argv, or directly
stuck to the option.
stuck: gitk -L:foo:main.c
unstuck: gitk -L :foo:main.c
Existing gitk chokes on 'gitk -S foo', but works with 'git -Sfoo'.
--
Thomas Rast
trast@{inf,student}.ethz.ch