Skip to content
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

Merged
merged 10 commits into from
Sep 26, 2022

Conversation

PatrickF1
Copy link
Owner

@PatrickF1 PatrickF1 commented Sep 26, 2022

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/

@@ -1,7 +1,5 @@
mock git diff "echo \$argv"
set file dir/file.txt
Copy link
Owner Author

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
Copy link
Owner Author

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.

@PatrickF1 PatrickF1 merged commit 1a0bf6c into main Sep 26, 2022
@PatrickF1 PatrickF1 deleted the support-preview-merge branch September 26, 2022 06:02
PatrickF1 added a commit that referenced this pull request Oct 4, 2022
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.
PatrickF1 added a commit that referenced this pull request Oct 4, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant