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

[GSoC 2010 Update] Please try the initial version of the line level history browser

From
Bo Yang <struggleyb.nku@gmail.com>
Date
Jun 17, 2010, 16:05 UTC
Message-ID
<AANLkTimRGZziLnffQXmzYnNhhE3dE_5Hsp1mxAEmBiIk@mail.gmail.com>
Hi all,
    After 3 weeks of heavy development, I have finally made up a
usable version of line level history browser. Thomas and I have try
some use cases with it indeed generate useful output for us. :) So, I
think it is a good chance to let all of the ones who is interested in
this feature have a try with it, and please give me any advice if any.
    Generally, the code is located at:
ssh://repo.or.cz/srv/git/line.git   phrase2

Yes, this is a tag on 'diff-range' branch, all development is on this branch and phrase1/phrase2 are tags used for 'public testing' version. :)

For the feature itself, it supports a command line syntax: git-log log [rev] -L <s>,<e> -L <s>,<e> <file1> -L <s>,<e> file2. And the multiple ranges case is not fully tested, but mostly works well.

Here are some interesting cases we have run until now. Generally, the
line level history will show users the complete change story of any
line range.
I usually use it for two purpose:
1. Understand code. Many times, when I want to read/modify some lines
of code, the first thing is to try to find out whether my changes has
been considered by other ones. And viewing the whole history of just
these lines( the function contain these lines) is necessary, so ./git
log -L /try_to_find_renames/,/^}/ tree-diff.c and "git log -L '/int
rev_compare_tree/,/^}/' revision.c" helps. :)
2. Find out some code I have delete. :) yes, sometimes, after some
commits, I find the 3 lines deleted the day before yerstoday may be
better than current one. But I really forget what they exactly are
except I know they have appeared in which function. So, run the line
log to find it like. ./git log -L '/void map_lines/,/^}/' line.c to
find it.
And Thomas give some other interesting usecases.
1. Use  "git log -L /common_prefix/,/^}/ dir.c" to replace a series
'git blame; git show' to find what whether the function is buggy.
2. Try 'git log be58e70^ -L /builtin_funcname_pattern/,/^}/ diff.c',
the line level browser will report the 'nontrivial merges' touch the
interesting lines.

So, come on everybody, try it in your way, and tell me your advice, thanks a lot!

Finally, below are the change summary:
 Makefile        |    2 +
 builtin/log.c   |  125 ++++++-
 diff.c          |    6 +-
 diff.h          |   22 +
 diffcore.h      |    3 +
 line.c          | 1210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 line.h          |  120 ++++++
 parse-options.c |   24 +-
 parse-options.h |    5 +
 revision.c      |   16 +-
 revision.h      |   12 +-
 11 files changed, 1534 insertions(+), 11 deletions(-)
And finally, my future plans are:
1. Fix some memory leaks of this verion.
2. Collect advice of this version and improve it.
3. Start to prepare this version to list and submit patches.
-- 
Regards!
Bo
----------------------------
My blog: http://blog.morebits.org
Why Git: http://www.whygitisbetterthanx.com/
Next: Jonathan Nieder
Message 1 of 2 in “[GSoC 2010 Update] Please try the initial version of the line level history browser”
  1. Bo YangJun 17, 2010
  2. Jonathan NiederJun 25, 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.