git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH gitk 0/4] gitk support for git log -L

From
Thomas Rast <trast@inf.ethz.ch>
Date
Aug 19, 2013, 08:21 UTC
Message-ID
<874namay5p.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<20130818115456.GA6772@iris.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
Show 12 quoted lines
> Hi Thomas,
>
> On Wed, Jul 31, 2013 at 03:17:41PM +0200, Thomas Rast wrote:
>> Jens Lehmann <Jens.Lehmann@web.de> writes:
>> 
>> > Am 29.07.2013 21:37, schrieb Thomas Rast:
>> >> Thomas Rast <trast@inf.ethz.ch> writes:
>> >> 
>> >>> Thomas Rast <trast@inf.ethz.ch> writes:
>> >>>
>> >>>> Now that git log -L has hit master, I figure it's time to discuss the
>> >>>> corresponding change to gitk.
[...]
Show 5 quoted lines
>
> 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.

Show 6 quoted lines
>> 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
Previous: Paul MackerrasNext: Junio C Hamano
Message 11 of 42 in “gitk support for git log -L”
  1. 0/4 gitk support for git log -LThomas Rast, Jun 9, 2013
  2. 1/4 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Jun 9, 2013
  3. 2/4 gitk: split out diff part in $commitinfoThomas Rast, Jun 9, 2013
  4. 3/4 gitk: support showing the gathered inline diffsThomas Rast, Jun 9, 2013
  5. 4/4 gitk: recognize -L optionThomas Rast, Jun 9, 2013
  6. Thomas RastJul 23, 2013
  7. Thomas RastJul 29, 2013
  8. Jens LehmannJul 29, 2013
  9. Thomas RastJul 31, 2013
  10. Paul MackerrasAug 18, 2013
  11. Thomas RastAug 19, 2013
  12. Junio C HamanoAug 19, 2013
  13. Thomas RastOct 13, 2013
  14. Jonathan NiederOct 14, 2013
  15. Documentation: revamp gitk(1)Thomas Rast, Oct 20, 2013
  16. 0/7 gitk -LThomas Rast, Oct 29, 2013
  17. 1/7 gitk: support -G option from the command lineThomas Rast, Oct 29, 2013
  18. Junio C HamanoOct 30, 2013
  19. Thomas RastOct 30, 2013
  20. Junio C HamanoOct 30, 2013
  21. 2/7 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Oct 29, 2013
  22. 3/7 gitk: split out diff part in $commitinfoThomas Rast, Oct 29, 2013
  23. 4/7 gitk: support showing the gathered inline diffsThomas Rast, Oct 29, 2013
  24. 5/7 gitk: recognize -L optionThomas Rast, Oct 29, 2013
  25. 6/7 Documentation: put blame/log -L in sticked formThomas Rast, Oct 29, 2013
  26. Junio C HamanoOct 30, 2013
  27. Thomas RastOct 30, 2013
  28. Junio C HamanoOct 30, 2013
  29. Thomas RastOct 30, 2013
  30. Junio C HamanoOct 30, 2013
  31. 0/5 gitk -LThomas Rast, Nov 16, 2013
  32. 1/5 gitk: support -G option from the command lineThomas Rast, Nov 16, 2013
  33. 2/5 gitk: refactor per-line part of getblobdiffline and its supportThomas Rast, Nov 16, 2013
  34. 3/5 gitk: split out diff part in $commitinfoThomas Rast, Nov 16, 2013
  35. 4/5 gitk: support showing the gathered inline diffsThomas Rast, Nov 16, 2013
  36. 5/5 gitk: recognize -L optionThomas Rast, Nov 16, 2013
  37. Paul MackerrasDec 1, 2013
  38. 0/3 Documentation: stuck arguments and gitk log -LThomas Rast, Nov 16, 2013
  39. 1/3 commit-tree: use prefixcmp instead of memcmp(..., N)Thomas Rast, Nov 16, 2013
  40. 2/3 Documentation: convert to --option=arg form where possibleThomas Rast, Nov 16, 2013
  41. 3/3 Documentation/gitk: document -L optionThomas Rast, Nov 16, 2013
  42. 7/7 Documentation/gitk: document -L optionThomas Rast, Oct 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.