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

GitUp does not handle submodule conflicts #282

Open
lapfelix opened this issue Feb 25, 2017 · 4 comments · May be fixed by #996
Open

GitUp does not handle submodule conflicts #282

lapfelix opened this issue Feb 25, 2017 · 4 comments · May be fixed by #996
Labels

Comments

@lapfelix
Copy link
Contributor

When rebasing or merging, if there's a submodule SHA1 conflict (when there's a divergence in both branches), GitUp does not handle the submodule reference conflict well at all: it displays a "Submodule not in index" alert view.

In the commit view, it seems like the submodule with a conflict is treated like a file with conflicts:
screen shot 2017-02-25 at 4 01 51 pm

When it happens, I need to resolve the conflict with the command line or another GUI app (like SourceTree).

Sample repo

Clone this repo: https://github.com/lapfelix/test-repo-submodules
Try to merge branch1 into branch2.

@swisspol
Copy link
Contributor

What happens when you click the 3 buttons?

@lapfelix
Copy link
Contributor Author

Open with default editor:
Opens the submodule folder in Finder

Resolve In Merge Tool:
screen shot 2017-02-25 at 5 50 11 pm

Mark as resolved:
screen shot 2017-02-25 at 5 50 01 pm

If I try to discard the changes, the base/ item in the working directory disappears (but the 2 conflicts stay).

I can't move the submodule in the index to the working directory (or vice-versa)

If I click "Discard All..." the submodule folder gets deleted:
screen shot 2017-02-25 at 5 54 30 pm

If I try to discard the changes to the red "base" delta cell, I get this alert view:
screen shot 2017-02-25 at 5 55 38 pm

@lapfelix
Copy link
Contributor Author

Looks like, in GCIndex, in - (id)initWithAncestor:(const git_index_entry*)ancestor our:(const git_index_entry*)our their:(const git_index_entry*)their;, the GCFileModeFromMode method does not support the provided git_index_entry mode, which is 57344.

@swisspol swisspol added bug and removed question labels Feb 26, 2017
@swisspol swisspol changed the title GitUp does not handle submodule conflicts at all GitUp does not handle submodule conflicts Feb 26, 2017
@lapfelix
Copy link
Contributor Author

lapfelix commented Feb 26, 2017

I worked on a solution to this bug for myself: lapfelix/GitUp@master...lapfelix:submodule_conflict_improvements

So far it does work well, but I think it can still be improved before I open a PR.

This is what it looks like when a submodule reference conflict is encountered while performing a merge:
screen shot 2017-02-26 at 2 10 34 pm

I still need to figure out a way to ignore the submodule addition deltas (the second table view cell in the diff contents view) when the submodule has conflicts.

If we can open the submodule in GitUp, maybe there should also be a marked as resolved button ? Though that would be the fourth button and that's a lot of buttons. Maybe there's a better way to display this ?

@lapfelix lapfelix linked a pull request Apr 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants