Uh oh!
There was an error while loading. Please reload this page.
only offer edit on head revision, open older revisions as tempfile - #3012
Open
MsfPablo wants to merge 1 commit into
Open
only offer edit on head revision, open older revisions as tempfile#3012MsfPablo wants to merge 1 commit into
MsfPablo wants to merge 1 commit into
Conversation
In the revision file tree the `edit [e]` command always opened the file as it exists on disk, regardless of the revision being browsed. That shows content that does not match the revision, or fails outright when the file no longer exists. `edit [e]` is now only offered when the browsed revision is HEAD. For any other revision `open [o]` dumps that revision's blob into a temporary file and opens that in the external editor instead. closesgitui-org#2147
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 freeto 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.
Closes#2147
In the revision file tree
edit [e]was offered for any file at any revision, but it always opened the file as it currently exists on disk. That means you don't see what you expected when looking at an old revision, or the editor errors out because the file no longer exists.Now:
edit [e]is only shown when the browsed revision is HEAD (existing behaviour, unchanged).open [o]is shown instead: it writes that revision's blob to a temporary file (gitui-<short-id>-<name>) and opens that in the external editor.go to head [g]from the issue is left for a separate issue as suggested.New key:
open_file_revision(defaults too). The revision file tree consumes it before the global options popup binding.cargo build,cargo clippy --all-featuresandcargo fmt --checkare clean.