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

Re: [PATCH v8 4/5] Implement line-history search (git log -L)

From
Thomas Rast <trast@student.ethz.ch>
Date
Mar 1, 2013, 08:49 UTC
Message-ID
<87vc9b1p48.fsf@pctrast.inf.ethz.ch>
In-Reply-To
<7vmwuogjsm.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Overall, I like this better than the "log --follow" hack; as the
>> revision traversal is done without any pathspec when being "careful
>> and slow" (aka -M), you do not suffer from the "just use a singleton
>> pathspec globally regardless of what other history paths are being
>> traversed" limitation of "log --follow".
>>
>> The patch series certainly is interesting.
>
> Having said that, I notice that "careful and slow" is just "too slow
> to be usable" even on a small tree like ours.  Try running
>
>     $ git log -M -L:get_name:builtin/describe.c
>
> and see how long you have to wait until you hit the first line of
> output.

I'll dig some more. It *should* be essentially the following times taken together:

  $ time git log --raw -M --topo-order >/dev/null
  real    0m5.448s
  user    0m4.599s
  sys     0m0.794s
  $ time git log -L:get_name:builtin/describe.c >/dev/null
  real    0m0.832s
  user    0m0.796s
  sys     0m0.032s
  $ time git log -L:get_name:builtin-describe.c 81b50f3ce40^ >/dev/null
  real    0m0.489s
  user    0m0.465s
  sys     0m0.022s

So I'm losing a factor of about 4 somewhere, which I can't explain right now.

It could be improved further if --follow was fixed, because then the first step should be much faster than diffing *all* the trees.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Junio C HamanoNext: Thomas Rast
Message 18 of 21 in “git log -L”
  1. 0/5 git log -LThomas Rast, Feb 28, 2013
  2. 1/5 Refactor parse_locThomas Rast, Feb 28, 2013
  3. Junio C HamanoFeb 28, 2013
  4. Thomas RastFeb 28, 2013
  5. 2/5 blame: introduce $ as "end of file" in -L syntaxThomas Rast, Feb 28, 2013
  6. Junio C HamanoFeb 28, 2013
  7. Junio C HamanoMar 12, 2013
  8. Thomas RastMar 13, 2013
  9. Junio C HamanoMar 13, 2013
  10. 3/5 Export rewrite_parents() for 'log -L'Thomas Rast, Feb 28, 2013
  11. Junio C HamanoFeb 28, 2013
  12. 4/5 Implement line-history search (git log -L)Thomas Rast, Feb 28, 2013
  13. Junio C HamanoFeb 28, 2013
  14. Thomas RastFeb 28, 2013
  15. Junio C HamanoFeb 28, 2013
  16. Thomas RastFeb 28, 2013
  17. Junio C HamanoFeb 28, 2013
  18. Thomas RastMar 1, 2013
  19. Thomas RastMar 1, 2013
  20. 5/5 log -L: :pattern:file syntax to find by funcnameThomas Rast, Feb 28, 2013
  21. Junio C HamanoFeb 28, 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.