-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Search git status] Preview only changes since file renamed #263
Merged
Conversation
This file contains 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
PatrickF1
force-pushed
the
fix-preview-renamed-spaces
branch
from
October 4, 2022 21:18
b905502
to
fd55607
Compare
PatrickF1
changed the title
[Search git status] Fix previewing renamed paths with spaces
[Search git status] Preview only changes since file renamed
Oct 9, 2022
PatrickF1
commented
Oct 10, 2022
@@ -135,7 +135,7 @@ They are always appended last to fzf's argument list. Because fzf uses the optio | |||
|
|||
### Change the commands used to preview directories and regular files | |||
|
|||
The search directory feature, by default, calls `ls` to preview directories and `bat` to preview [regular files](https://stackoverflow.com/questions/6858452/what-is-a-regular-file-on-unix). | |||
The search directory feature, by default, calls `ls` to preview directories and `bat` to preview [regular files](https://stackoverflow.com/questions/6858452). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of scope change: realized I can shorten SO urls by only referencing up to the question id
PatrickF1
commented
Oct 10, 2022
end | ||
|
||
_fzf_preview_changed_file "R file1 -> file2" >/dev/null | ||
@test "only calls git diff staged for renamed files" $diff_working_called -eq 0 -a $diff_staged_called -eq 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test wasn't testing anything very useful
PatrickF1
force-pushed
the
fix-preview-renamed-spaces
branch
from
October 10, 2022 04:11
9961b0c
to
bd7fee6
Compare
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.
Previously, the
git diff
preview for a renamed path shows the entire file as being added. A more useful diff is to view only the modifications made to the file content. To accomplish this, we need a special condition for renames to diff the current (post-rename) path with the original path.In addition, this PR fixes
git status
previews for renamed paths, which was accidentally broken in 38896f2.