-
Notifications
You must be signed in to change notification settings - Fork 87
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] support previewing merge conflict #262
Conversation
@@ -1,7 +1,5 @@ | |||
mock git diff "echo \$argv" | |||
set file dir/file.txt |
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.
$file was only being used in one place
|
||
set output (_fzf_preview_changed_file " D $file") | ||
|
||
contains -- "| Unstaged |" $output && not contains "| Staged |" $output |
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.
contains doesn't need --
because by passing in the first argument, it would never interpret a line prefixed with-
in $output as an option.
In #262, my research showed that only 4 of the 7 unmerged statuses listed in git status' help were possible. However, upon experimentation, I realized all 7 are possible. The three I left out are easily reproducible by merging two branches that renamed the same file but to different names. In this commit, I add them back in.
In #262, my research showed that only 4 of the 7 unmerged statuses listed in git status' help were possible. However, upon experimentation, I realized all 7 are possible. The three I left out are easily reproducible by merging two branches that renamed the same file but to different names. In this commit, I add them back in.
Without this, merge conflicts mistakenly show up as unstaged changes and as an empty staged changes section.
Also, update some comments and docs for Search git status.
Resources
https://stackoverflow.com/questions/22792906/how-do-i-produce-every-possible-git-status
https://public-inbox.org/git/4AF06B83-E928-4FE2-8094-F23CE3BA1EBC@toyland.org/