Thread (19 messages) flat view 19 messages, 6 authors, 2016-06-15

Re: GSoC draft proposal: Line-level history browser

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:48:27

Hi,

On Sat, 20 Mar 2010, Bo Yang wrote:
I am very interested in the project 'Line-level history browser', after 
some days consideration, now I made up a draft of my proposal, I think 
it is helpful to send it to the list before submitting it. Could you 
please give me some advise?
I like it very much already! You obviously put in a substantial amount of 
time to learn intricate details about the way Git operates, and what is 
already available.

And you also provided a patch (unrelated to line-level history browser), 
so you proved that you actually cloned Git, and that you can actually 
patch it and use Git itself to send a patch to this list.

Very good.

Just a few constructive criticisms (inlined):
This project will add a new utility for git called 'git line-log'. It 
can trace the history of any line range of certain file at any revision.
I think that that might be good for starters, but one could imagine that 
an integration into "git log" might be even better, so that gitk can use 
this without any further changes.
For simplity, users can run the command like: ' git line-log 
builtin/diff.c 6..8 ', he will get the change history of code between 
line 6 and line 8 of the diff.c file.
It would be good if the code looked harder after failing with the simple 
strategy, such as looking for code removed in other files, fuzzy matching 
(optional), and looking for code duplication (i.e. literal copying, or 
slightly modified copying).

The fuzzy matching might be necessary to catch things like a Java class 
moving from one file into another (and changing its name): the first line 
changes, but not completely.
After reading some libxdiff document and code, I find that libxdiff 
output all the diff blocks as string into a memory file.
Almost.

Just have a look at the word-level diff (--color-words):

http://repo.or.cz/w/git/dscho.git/blob/bc1ed6aafd9ee4937559535c66c8bddf1864bec6:/diff.c#l382

You will see that there is a function fn_out_diff_words_aux(), which is 
passed to xdi_diff_outf(). That latter function calls xdiff such that the 
former function receives a complete line at a time. And this is what I 
would suggest doing in the line-level log, too.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help