Repository navigation
fix: keep the pre-rename file history on Git 2.56 - #127
Conversation
- Git 2.56 makes `git log --follow` keep one path per commit, and a commit reached from two history lines takes the path of the line walked last, so the file history lost every entry before a rename when the merge did not detect it - After the lineage query, run the lineage query again on the old path of each followed rename and splice its groups after the rename commit; every query walks the same unpruned topo-order list, so the results match Git 2.55 and earlier - Return null when a continuation query fails, is malformed, or lacks the rename commit, as for the other queries - Add findLineageRename() and spliceLineageContinuation() with unit tests, continuation spawn tests (S52), and a two-step rename chain against a real repository (S53) - Update the S49 spawn order expectations (TC-333, TC-341, TC-343) for the extra continuation query - Verified with Git 2.43.0 and 2.56.0: all tests pass, and TC-350, TC-352 and TC-803 fail on Git 2.56.0 without the fix
- Add S52 (continuation spawn order and failures) and S53 (rename chain on a real repository) to the file history perspectives of src/dataSource.ts - Add S9 (findLineageRename / spliceLineageContinuation) to the src/fileHistory.ts perspectives - Rewrite S49 in English with the updated spawn order of TC-333, TC-341 and TC-343 - Update the dataSource shard manifest and regenerate the root INDEX, which also corrects the stale web/utils.ts counts on main
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Rename lookup and continuation splicing src/fileHistory.ts, tests/src/fileHistory.test.ts, docs/testing/perspectives/src/fileHistory-test.md |
Added helpers to select the next rename and splice continuation groups at its commit. Tests and perspectives cover selection, splice results, missing commits, and unchanged inputs. |
Continuation queries in file-history resolution src/dataSource.ts, tests/src/dataSource.test.ts |
getFileHistory now uses repeated lineage queries for renamed paths. Tests cover recovered history, multiple renames, query counts, and failure outcomes. |
Rename-chain integration and perspective coverage tests/src/dataSource.git.test.ts, docs/testing/perspectives/src/dataSource-test/*, docs/testing/perspectives/INDEX.md |
Added a real-repository rename-chain test. Updated perspective cases, indexes, counts, and reverse-lookup mappings; translated existing S49 cases into English. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant getFileHistory
participant queryFileHistoryLineage
participant Git as Git history query
participant fileHistory as Lineage helpers
getFileHistory->>queryFileHistoryLineage: resolve lineage
queryFileHistoryLineage->>Git: query current path lineage
loop For each detected rename
queryFileHistoryLineage->>fileHistory: find next rename
queryFileHistoryLineage->>Git: query rename old path
queryFileHistoryLineage->>fileHistory: splice continuation at rename commit
end
queryFileHistoryLineage-->>getFileHistory: completed lineage or null
Merge Risk: 
Minimal · previous review d5d65
-
The rename-continuation change is ready to merge after normal checks; no unresolved issue is established.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (4 skipped: 4 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
- When another file was later renamed onto the old path, the continuation from the anchor followed that file and returned null instead of the history (seen in an existing repository; the base branch returned 16 entries) - Accept the continuation only if the rename commit shows the old path in it, and otherwise retry it from the rename commit - Keep starting at the anchor first so edits of the old path on another line stay included (TC-352) - Add TC-804 (S9), TC-805 and TC-806 (S52) and TC-807 (S53), and update TC-796 for the retry
- Continue each source's case sequence and synchronize test names, comments, and perspective references. - Correct the continuation helper signature in the perspectives to match the rename-entry parameter.
Background
Git 2.56 changed
git log --followto keep one path per commit. A commit reached from two history lines now takes the path of the line Git walks last. When a renamed file is merged and the merge does not detect the rename, Highlight File History loses every entry from before the rename. CI fails on runners with Git 2.56.0 (TC-350, TC-352) and passes on 2.55.0 with the same commit.Changes
--followdisables pruning), so the results match Git 2.55 and earlier.Points to review
src/dataSource.ts::queryFileHistoryLineagetests/src/dataSource.git.test.tsTC-352Verification
Summary by CodeRabbit