Conversation
This resolves three distinct state-sync bugs: * Ensured file paths are compared by normalizing file name casing on case-insensitive filesystems. Otherwise, saving a file could trigger a false rename detection and silently reset the active diff target back to HEAD. * Ensured a save to a file forces GitGutter to re-inject the historical document reference and override Sublime Text's default diff on save. Otherwise, the native mini-diff will fall out of sync with the GitGutter diff. * Ensured the inline phantoms compare to the selected historical commit. Otherwise, the blame annotations default to HEAD and display incorrect historical data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a set of synchronization bugs between GitGutter's historical compare targets and Sublime Text's native
mini_diffengine, ensuring the diff and inline blame stay locked to the user's chosen commit.Root Causes & Fixes
work_tree()triggered false renames, resetting the target to HEAD. Fix: Wrapped theis_renamedcheck inos.path.normcase().set_reference_documentto the git index upon saving a file. Because GitGutter's_git_compared_commitcache remained intact, it silently aborted re-injecting the historical commit. Fix: Addedevents.POST_SAVEto the invalidation trigger incommands.pyand forced_git_compared_commit = Noneinhandler.pyto guarantee a re-fetch and re-injection on save.git_blame()shell execution completely omitted the compare target, causing inline annotations to always evaluate against HEAD. Fix: Retrieved the target viaget_compare_against()and injected it before the--separator in the subprocess arguments.Testing
Verified locally on ST4. Modifying a file, saving it, and triggering popups/inline diffs now correctly maintains the selected historical commit target without visual overlap or state drops.