Re: [fossil-users] Is there a way to see history (e.g., annotate) for a single line of code?
On Aug 1, 2017, at 12:45 PM, Warren Young wrote: > > ...somewhat prone to reporting false differences. And once it’s latched onto > a false difference, it is likely to go off on a useless tangent, chasing > changes to a line you don’t care about. I guess you could use the “bloodhound algorithm:” at the point where the line moves and changes, stop the output and make the user give you a new line number and checkin ID, as with a bloodhound who has lost the scent running around until he finds the scent trail again. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Is there a way to see history (e.g., annotate) for a single line of code?
On Aug 1, 2017, at 6:44 AM, Richard Hipp wrote: > > On 8/1/17, Tony Papadimitriou wrote: >> When doing ‘annotate’ on a certain file version I see the most recent commit >> responsible for each line in the file. That’s great! >> >> However, if I want to know which previous commits (history) touched one >> specific line, is there some way to do this? > > There is not. Can you suggest an algorithm for computing it? There’s a straightforward algorithm that is not very useful: 1. Get the change history for the file the same way as with “fossil finfo”. 2. Using a modified version of the “fossil diff” algorithm, detect whether the given numbered line has changed between each pair of checkins. Print the checkin ID and new line content if so. 3. Get next checkin ID up the timeline and go to 2. The thing is, that’s only useful if the line specified hasn’t shifted up or down in the file between checkins. If the OP wants Fossil to somehow track the movement of lines up and down within the file while also detecting changes in that line, I think you’d have to modify step 2 to use a fuzzy diff, causing this new feature to give fuzzy output. That is, if the user says $ fossil annotate --line 1234 it would first do a diff between the current checkout version and the prior checkin on that branch, then use the diff algorithm’s information to guess how many lines up or down the line has moved within that prior checkin. If the line is unchanged, that’s pretty easy, but if it’s moved *and* changed, Fossil will have to guess based on how many lines were added or removed prior to the diff point. I think that would be more useful, though somewhat prone to reporting false differences. And once it’s latched onto a false difference, it is likely to go off on a useless tangent, chasing changes to a line you don’t care about. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Is there a way to see history (e.g., annotate) for a single line of code?
On 8/1/17, Tony Papadimitriou wrote: > When doing ‘annotate’ on a certain file version I see the most recent commit > responsible for each line in the file. That’s great! > > However, if I want to know which previous commits (history) touched one > specific line, is there some way to do this? There is not. Can you suggest an algorithm for computing it? Another thing that is needed: Given an historical check-in, I sometimes want to see the annotation going forwards in time. In other words, for some historical check-in, I want to see the next change for each line in the file. This is tricky because of the way the change graph is constructed. It is easy to go back in time since every check-in has a well-defined primary parent. But going forwards in time is hard because a single check-in can have an arbitrary number of children, and so it is difficult to know which child path to follow. -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] Is there a way to see history (e.g., annotate) for a single line of code?
When doing ‘annotate’ on a certain file version I see the most recent commit responsible for each line in the file. That’s great! However, if I want to know which previous commits (history) touched one specific line, is there some way to do this? Thanks. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users