-
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2cabbc8
wipe test, change example
PatrickF1 8008021
fix using special logic if rename detected
PatrickF1 82e1a33
start work on test
PatrickF1 fd55607
fix test
PatrickF1 ce69e01
Merge branch 'main' into fix-preview-renamed-spaces
PatrickF1 0158c43
Merge branch 'main' into fix-preview-renamed-spaces
PatrickF1 3d3223b
slightly optimize
PatrickF1 7d9e404
comment
PatrickF1 a50f5d4
completely forgot to pass to string split
PatrickF1 cf686b9
show only changes post-rename
PatrickF1 66797bb
reorder logic for separation
PatrickF1 5d6762f
partial regex solution
PatrickF1 dd599d1
more regex solution, untested
PatrickF1 c20f23c
append in reverse order
PatrickF1 987e718
don't use --no-prefix now that diffing against itself sometimes
PatrickF1 dd563bd
try parse git status in separate PR
PatrickF1 afe3828
reduce one possible if statement test
PatrickF1 bd7fee6
update test
PatrickF1 3fc3dd0
add txt extension or it'll be identified as ruby file
PatrickF1 f719ec6
string split max 1
PatrickF1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
aaaaaaaaaaa | ||
bbbbbbbbbbb | ||
ccccccccccc | ||
ddddddddddd | ||
eeeeeeeeeee | ||
fffffffffff | ||
ggggggggggg | ||
hhhhhhhhhhh | ||
iiiiiiiiiii | ||
jjjjjjjjjjj | ||
kkkkkkkkkkk | ||
lllllllllll | ||
mmmmmmmmmmm | ||
nnnnnnnnnnn | ||
ooooooooooo | ||
ppppppppppp | ||
qqqqqqqqqqq | ||
rrrrrrrrrrr | ||
sssssssssss | ||
ttttttttttt | ||
uuuuuuuuuuu | ||
vvvvvvvvvvv | ||
wwwwwwwwwww | ||
xxxxxxxxxxx | ||
yyyyyyyyyyy | ||
zzzzzzzzzzz |
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
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
tests/preview_changed_file/renamed_path_modifications.fish
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set orig_path "tests/_resources/alphabet 26 lines.txt" | ||
set renamed_path "tests/_resources/alphabet lines.txt" | ||
set added_line a-very-unique-line | ||
git mv $orig_path $renamed_path | ||
echo $added_line >>$renamed_path | ||
git add $renamed_path | ||
|
||
set output (_fzf_preview_changed_file "R \"$orig_path\" -> \"$renamed_path\"") | ||
|
||
# test that the added line shows up in the diff but not the entire file | ||
# "aaaaaaaaaa" is the first line in the file | ||
string match --entire --quiet $added_line $output && | ||
not string match --entire aaaaaaaaaa $output | ||
@test "shows only the modifications made to renamed file" $status -eq 0 | ||
|
||
git mv $renamed_path $orig_path | ||
git restore --staged --worktree $orig_path |
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.
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