View Ticket
Not logged in
Ticket UUID: f91862eed36716dec2129daf75060e4905cbc409
Title: annotations assign lines to incorrect checkin
Status: Fixed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2011-05-12 01:13:35
Version Found In: 9a63d1f048
Description & Comments:
From the Tk chat:
dgp	I think something is wrong with fossil annotations.
dgp	Looking at http://core.tcl.tk/tcl/ci/4683efaee9ca414d4ff2690ba19b3b7a6d1afaed
dgp	it's a small patch to tclListObj.c.  Introduces only five new lines.
dgp	Then open http://core.tcl.tk/tcl/artifact/31d1cfe5711802cce0d1ac7fa7a48c4c0607a63f
dgp	to see what tclListObj.c created by that checkin looks like.
dgp	Then click the [annotate] link to reach http://core.tcl.tk/tcl/annotate?checkin=4683efaee9ca414d&filename=generic/tclListObj.c
dgp	I would expect to see only those five new lines marked with 4683efaee9 but I see many more than that.
dgp	starting with lines 21 & 22 or so which are nowhere near the patch.
dgp	Conversely, those five new lines are marked with something else
dgp	403736bc07 - which is the same patch, but the checkin applying it to core-8-5-branch.
dgp	I'd have expected annotations to trace back the primary parent links, not the merges.

drh added on 2011-05-12 00:50:48 UTC:
The following is an explanation of the problem; not a solution. I'm still not sure what the correct solution is. The bottom line is that "annotate" or "blame" becomes complicated when you have lots of branching and merging...

Refer to the history graph of the tclListObj.c source file here: http://core.tcl.tk/tcl/finfo?name=generic/tclListObj.c&b=2011-04-28&a=2011-04-24

The current implementation of "annotate" starts with the requested node (31d1cfe5711802cc) and then works downward from there on the same branch to (66e766cf759f85cf) and (52cc348a24f17bca) and so forth. But the five-line change mentioned in the problem statement above comes in from a different branch, specifically from (e25d618ef36a26ce) on the core-8-5-branch. So the five-line change does not appear in the "annotate" output because it is a diff from one branch into another, whereas the current "annotate" only shows changes from versions on the same branch.

It is unclear, yet, whether or not it is desirable to include "annotate" changes from other branches. Perhaps this should be an option on the display. Further research is necessary...


drh added on 2011-05-12 01:13:35 UTC:
I'm no longer able to produce the original problem. I think there was something wrong with the Fossil installed on core.tcl.tk and when I upgraded with the file history display enhancements, that fixed the issue.