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

Re: GSoC draft proposal: Line-level history browser

From
Bo Yang <struggleyb.nku@gmail.com>
Date
Mar 22, 2010, 07:31 UTC
Message-ID
<41f08ee11003220031p6fda651eycff2641df10864da@mail.gmail.com>
In-Reply-To
<7vhbo8syyf.fsf@alter.siamese.dyndns.org>
On Mon, Mar 22, 2010 at 1:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 27 quoted lines
> Bo Yang <struggleyb.nku@gmail.com> writes:
>
>> The 'blame' way is very good if we only support one line range. But if
>> we want to support multiple line ranges, I don't think it is suitable
>> for that case. Anyway, how can I specify multi-ranges which refers to
>> multiple files at multiple revision and multiple line ranges using
>> above syntax?
>
> I would sort of see you may want to be able to say "explain lines 10 thru
> 15 of config.h and lines 100-115 of hello.c that appear in v1.2.0", but I
> think it is a total nonsense to ask for "ll 10-15 of config.h in v1.2.0
> and ll 110-115 of hello.c in v1.0.0".  After all they never existed in the
> same revision (otherwise you would have said "ll 7-13 of config.h and ll
> 110-115 of hello.c that appear in v1.0.0").  So I would reject the
> SVN-like "rev@" in the first place.
>
> While I don't seriously buy "multiple files" either, if that is really
> needed, I could be pursuaded with  "log -- path1:10-15 path2:1-7", or
> "log -L path1:10-15 -Lpath2:1-7 -- path1 path2" or something similarly
> ugly like these, but that is not how we generally name things, and it
> probably shouldn't be a new option to "log" anymore.
>
> On the other hand, multiple ranges in a single file is something that
> may be quite reasonable, e.g.
>
>  $ git log -L10-15 -L200-210 -- Makefile
>  $ git log -L'*/^#ifdef WINDOWS/,/^#endif \/\* WINDOWS \/\*/' -- config.h
Yeah, maybe one file multiple ranges is most rationale.
> As I already said, I wouldn't be so worried about multiple-range feature,
> but I would be worried about the usefulness of this feature, even for the
> case to track a single range of a single file, starting from one given
> revision.

I am sorry, but I did not catch up you here. You worried about the usefulness of the multi-range feature or the line level history browser?

I think tracking a single range of a single file, starting from one given revision is useful when the line of history split on some point. This can let users focus on a single line of history using this feature.

Show 17 quoted lines
>When you want to know where the first few lines of Makefile
> came from, and if blame says the first line came from 2731d048, that
> really means that between the revision you started digging from and the
> found revision, there is no commit that touched that particular line, but
> equally importantly, that before that found revision, there wasn't a
> corresponding line in that file---blame stopped exactly because there is
> nobody before that found revision that the line can be blamed on.
>
> So implementing "git log -L1,10 -- Makefile" might be just the matter of
> doing something like:
>
>  1. Run "git blame -L1,10 -- Makefile";
>  2. Note the commits that appear in the output;
>  3. Topologically sort these commits;
>  4. Run "git show <the result of that toposort>"
>
> which is not very satisfying.

Yes, this is not satisfying. But as I understand, the line level history browser will do more than just this. It will not stop on 'step 4', it can follow the change history recursively and deeply, to find more. I think this is useful when we focus just one a range of code and want to know how it become into such a now condition.

Anyway, it is not a bad thing too add a new convenient feature to a daily tool. :)

Regards! Bo

Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 54 in “GSoC draft proposal: Line-level history browser”
  1. Bo YangMar 20, 2010
  2. Johannes SchindelinMar 20, 2010
  3. Bo YangMar 20, 2010
  4. Junio C HamanoMar 20, 2010
  5. Bo YangMar 21, 2010
  6. Johannes SchindelinMar 20, 2010
  7. Bo YangMar 21, 2010
  8. Alex RiesenMar 20, 2010
  9. Junio C HamanoMar 20, 2010
  10. Bo YangMar 21, 2010
  11. A Large Angry SCMMar 20, 2010
  12. Bo YangMar 21, 2010
  13. A Large Angry SCMMar 21, 2010
  14. Bo YangMar 22, 2010
  15. Junio C HamanoMar 22, 2010
  16. Bo YangMar 22, 2010
  17. Junio C HamanoMar 22, 2010
  18. Bo YangMar 22, 2010
  19. Junio C HamanoMar 22, 2010
  20. Bo YangMar 22, 2010
  21. Jonathan NiederMar 22, 2010
  22. Bo YangMar 23, 2010
  23. Jakub NarebskiMar 23, 2010
  24. Bo YangMar 23, 2010
  25. Jakub NarebskiMar 23, 2010
  26. Bo YangMar 23, 2010
  27. Jakub NarebskiMar 23, 2010
  28. Bo YangMar 23, 2010
  29. Jonathan NiederMar 23, 2010
  30. A Large Angry SCMMar 23, 2010
  31. Bo YangMar 24, 2010
  32. Peter KjellerstedtMar 23, 2010
  33. Jonathan NiederMar 23, 2010
  34. Bo YangMar 24, 2010
  35. Jonathan NiederMar 24, 2010
  36. Alex RiesenMar 22, 2010
  37. Johannes SchindelinMar 22, 2010
  38. Bo YangMar 22, 2010
  39. Jakub NarebskiMar 22, 2010
  40. Johannes SchindelinMar 22, 2010
  41. Sverre RabbelierMar 22, 2010
  42. Johannes SchindelinMar 22, 2010
  43. Sverre RabbelierMar 22, 2010
  44. Johannes SchindelinMar 22, 2010
  45. Bo YangMar 23, 2010
  46. Bo YangMar 23, 2010
  47. Bo YangMar 29, 2010
  48. Thomas RastMar 29, 2010
  49. Bo YangMar 30, 2010
  50. Michael J GruberMar 30, 2010
  51. Michael J GruberMar 30, 2010
  52. Bo YangMar 30, 2010
  53. Jakub NarebskiMar 30, 2010
  54. Bo YangMar 30, 2010

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.