Skip to content
go-libfossil Check-in [ada7aadbb5]
Login

Check-in [ada7aadbb5]

Overview
Comment:fix(annotate): credit lines the way fossil annotate does (#256, #257) (#259)

Annotate aligned each version with its parent using its own LCS, so where a line repeats (blank lines, braces) it could pick a different copy as the new one than fossil does, crediting the line to another check-in. It also trimmed every trailing newline, dropping trailing blank lines.

Annotate now uses a port of fossil's line diff (break_into_lines, diff_all, longestCommonSequence and the rest of diff.c that annotation uses), hash included, since the hash orders the candidates and so decides ties. Like fossil's annotate, it diffs each older version against the starting one and credits a line to the version just newer than the first ancestor that lacks it. This also drops the table the size of both versions that the old LCS allocated at every step.

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ada7aadbb51eec359bd995d285f3cf3b5305326b148a0e0f3216e33b793ca2a8
User & Date: [email protected] on 2026-10-09 14:47:55.000
Other Links: manifest | tags
Context
2026-10-09
15:15
Clone and sync exchanges follow the sync draft (#255) (#260)

* fix(sync): clone and sync exchanges follow the sync draft (#255)

* docs(changelog): clone and sync exchanges follow the sync draft (#255)

* fix(sync): fail unfinished clones; ask for held phantoms once (#255 review) check-in: e46a6c3f60 user: [email protected] tags: trunk

14:47
fix(annotate): credit lines the way fossil annotate does (#256, #257) (#259)

Annotate aligned each version with its parent using its own LCS, so where a line repeats (blank lines, braces) it could pick a different copy as the new one than fossil does, crediting the line to another check-in. It also trimmed every trailing newline, dropping trailing blank lines.

Annotate now uses a port of fossil's line diff (break_into_lines, diff_all, longestCommonSequence and the rest of diff.c that annotation uses), hash included, since the hash orders the candidates and so decides ties. Like fossil's annotate, it diffs each older version against the starting one and credits a line to the version just newer than the first ancestor that lacks it. This also drops the table the size of both versions that the old LCS allocated at every step. check-in: ada7aadbb5 user: [email protected] tags: trunk

14:25
fix(annotate): credit lines through the start-version mapping (#253) (#254)

Past the first parent, walkParentChain wrote each line's attribution by its index in an older version, so lines were credited to the wrong check-in and an older version longer than the start panicked. Carry each compared line's start-version index through the walk and stop following lines that no longer match. check-in: a63adf1dcf user: [email protected] tags: trunk

Changes