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

stash apply: report merge conflicts #576

Closed
josmith42 opened this issue Mar 9, 2021 · 14 comments · Fixed by #578
Closed

stash apply: report merge conflicts #576

josmith42 opened this issue Mar 9, 2021 · 14 comments · Fixed by #578
Labels
bug Something isn't working
Milestone

Comments

@josmith42
Copy link

Is your feature request related to a problem? Please describe.
When applying a stash that will result in conflict (e.g., the working copy has changed), gitui does not report the error message. This makes it difficult to see that a conflict occurred.

Describe the solution you'd like
A dialog box with the error message. (e.g.: "CONFLICT (content): Merge conflict in [filename]", maybe with an OK button and an Abort button.

Describe alternatives you've considered
The error message could also be in the status bar.

Additional context
If there is already error handling for stashes, maybe it could be reused.

@extrawurst
Copy link
Owner

oh I did not encounter that one yet. but does it put the conflicting files in the correct conflicted state?

@josmith42
Copy link
Author

No, it appears to not understand the conflict state after a stash is applied:
gutui-stash-apply-conflict
This occurs even if the stash is applied outside of gitui.

Whereas, if you do a git status, you see the following:

On branch master
Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
	both modified:   conflict

no changes added to commit (use "git add" and/or "git commit -a")

@extrawurst
Copy link
Owner

which gitui version are you using?

@josmith42
Copy link
Author

I was using 0.11.0. However, I just upgraded to 0.12.0 and it still occurs.

@extrawurst
Copy link
Owner

0.12 should tell you that the repo is in a conflicting state though 🤔

@josmith42
Copy link
Author

It just shows M in Unstaged and Stages, the same as the above screenshot. :-(

@extrawurst
Copy link
Owner

without having reproduced this:
a) gitui currently does not support letting you resolve conflicts (#485)
b) it does not seem to work that it should show you that the repo is in a conflict resolution stage (although it should)
c) stash apply should actually refuse to do apply if this requires creating a conflict (until we support conflict resolution)

I will tackle c) in this issue

@extrawurst extrawurst added this to the v0.13 milestone Mar 9, 2021
@extrawurst extrawurst added the bug Something isn't working label Mar 9, 2021
@extrawurst
Copy link
Owner

@josmith42 ok I am having trouble reproducing this. applying that results in a conflict actually is prevented
image

@extrawurst
Copy link
Owner

extrawurst commented Mar 9, 2021

so I added unittests and it seems to me that the conflict state can only be achieved right now if applying the stash outside of gitui. I used this issue to improve on the visualisation of files in conflict state:

image

if you manage to achieve gitui putting files into conflicted state please provide me with a repro and feel free to reopen the issue

@josmith42
Copy link
Author

OK, here are some steps to repro:

  • Make a change to a file. Stash the change.
  • Make a different change to the same file on the same line. Commit the change.
  • Use gitui to apply the stash you saved in the first step.

So after #578, gitui does show the files as conflicted, but it still doesn't prevent the confilct from occurring.

To me, showing the confilct is sufficient, but if if you want gitui to prevent the conflict in the first place, it is not doing that in this case.

@josmith42
Copy link
Author

Github won't allow me to reopen this issue, so please reopen the issue if you feel it should be based on what I reported above.

@extrawurst
Copy link
Owner

ha! committing the changes was the step I missed

@extrawurst extrawurst reopened this Mar 10, 2021
@extrawurst
Copy link
Owner

comparing this again against regular git stash apply it seems to be the default behaviour to put the files into a conflicting state. meaning I will leave it like that. the only thing I am going to check now is why the diff is empty for the conflicts

@extrawurst
Copy link
Owner

superseded by #580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants