Skip to content

File history: follow renamed and rewritten files; absent version at the right commit - #95

Merged
baol merged 6 commits into
mainfrom
repo-and-branch-ux
Nov 8, 2026
Merged

baol merged 6 commits into
mainfrom
repo-and-branch-ux

Conversation

@baol

@baol baol commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Two File history fixes from baol/recipes, each reproduced on that repository before the change and validated on it after.

1. Follow a renamed and rewritten file down to 25 % similarity

File history of docs/Pane e pizza/Focaccia con il Bimby.md showed 2 rows. In 935e221 the file was renamed from Focaccia.md and mostly rewritten (27 % alike). That is below Git's 50 % threshold, so even git log --follow stops there. The earlier fix (#93) had only been checked on a pure git mv.

Decision (user): an added file continues the most similar file the same commit deleted, down to 25 %. One constant, RENAME_SIMILARITY_PERCENT, drives both File history (git diff-tree -M25%) and Review (gix rewrites at 0.25).

Validated on the clone: File history lists 7 versions, from 935e221 Renamed ← docs/Pane e pizza/Focaccia.md down to d7fb0bb Added. show 935e221 lists one renamed entry. In the GUI, Review of 935e221 → H shows FILE HISTORY 7.

Acceptance REV-78:

  • a_rewritten_rename_follows_the_most_similar_deleted_file_down_to_25_percent
  • a_new_file_less_than_25_percent_like_a_deleted_one_starts_its_own_versions
  • a_rewritten_rename_reviews_as_a_rename_of_the_most_similar_deleted_file
  • a_renamed_and_rewritten_file_keeps_its_file_history (app)

These fail at 50 % and pass at 25 %. Git scores the fixture R030.

2. The absent version names the commit just before the file

The absent row at the end of File history read 6f2795d Initial commit, the repository's first commit. It should name the commit just before the file was added: d46c131 Update pancakes., the parent of d7fb0bb. An absent state took the commit where the absence began.

It now takes the commit just before the add. After a deletion, it stays the commit that deleted the file.

Validated on the clone: the GUI's FILE HISTORY 7 ends with d46c1310 Update pancakes.

Acceptance REV-79:

  • the_absent_version_before_a_file_is_the_commit_just_before_it_was_added
  • the_absent_version_after_a_deletion_is_the_commit_that_deleted_it
  • the app test above, which now also checks the absent row

These fail without the change.

Checks

fmt, clippy -D warnings, all workspace tests, and the README screenshot --check pass. The branch also carries a no-op merge of the old #93 tip, so it could be pushed without force.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o

FRM-05 is now a GWT acceptance scenario: given Git Good was just
opened, when the folder is not a Git repository and not inside one,
then it opens on the welcome view. The Reopen the last repository
preference, which opened the most recent repository instead and was on
by default, is removed with its launch fallback; an old "reopen_last"
key in settings.json is ignored. FRM-06 covers a launch in a
repository's subfolder, which opens that repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
Reported on baol/recipes: after renaming Focaccia.md, Review of the
rename commit listed the old path as deleted and the new one as added
with every line new, so the file's history looked cut at the rename.

Review now pairs renames as git diff -M does (exact moves and moves
with edits, 50 % similarity), with gix's tree diff in process, read only
when a comparison adds or deletes a file. A rename is one change at the
new path with the old side and old_path/old_path_bytes, marked R in the
file list; File history on it crosses the rename. The CLI's show lists
kind "renamed" with old_path, and --file accepts either path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
Reported on baol/recipes: File history of "Focaccia con il Bimby.md"
stopped at 935e221, where Focaccia.md was renamed and mostly rewritten
(27 % alike, below Git's 50 % rename threshold; git log --follow stops
there too). The earlier rename fix was checked on a pure git mv only.

An added file now continues the most similar file the same commit
deleted, down to 25 % similarity (RENAME_SIMILARITY_PERCENT), in File
history (git diff-tree -M25%) and in Review (gix rewrites at 0.25).
Acceptance REV-78; its four tests fail at 50 % and pass at 25 %. On the
recipes clone File history now lists 7 versions across the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
File history of baol/recipes' Focaccia ended with an absent row at the
repository's first commit (6f2795d Initial commit) instead of the commit
just before the file was added (d46c131 Update pancakes., parent of
d7fb0bb): an absent state took the commit where the absence began.

Before a file first appears its absent version is now the commit just
before the add; after a deletion it stays the deleting commit.
Acceptance REV-79; its tests fail without the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
@baol baol changed the title Follow a renamed and rewritten file down to 25 % similarity File history: follow renamed and rewritten files; absent version at the right commit Nov 8, 2026
@baol
baol merged commit 9a6266b into main Nov 8, 2026
9 checks passed
baol pushed a commit that referenced this pull request Nov 8, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX3sFiNbkTC6gZUVCPGT3o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants