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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle submodule conflicts #996

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lapfelix
Copy link
Contributor

@lapfelix lapfelix commented Apr 26, 2024

Resolves #282

I use submodules every day at work and I think GitUp is the best Git interface so this has been a regular issue for me for way too long 馃お

The basic UI I came up with looks like this:
image

It closely matches the current submodule diff UI, but with buttons to choose which commit should be chosen (as a side note, in a future update it would be interesting to also pull the title of each commits and display it in the diff/conflicts views as I don't know my commit SHA1s by heart).

The "sketchiest" part of this PR is probably in GCDiff.m lines 358-377. I've written an explanation in a comment right above the code to justify it, but it would be nice if the superfluous untracked diff entry was not returned by libgit2 at all, but I couldn't find any combination of diff options that could do that.

Before

Submodule conflicts weren't handled at all and any rebase that involves a submodule conflict errors out in GitUp (and the repository needs to be "Reset to Checkout..." to get a clean working directory again | Submodule conflicts can be handled with a "Choose ours" or "Choose theirs" button

Screen.Recording.2024-04-26.at.6.20.58.PM.mp4

After

Submodule conflicts can be handled with a "Choose ours" or "Choose theirs" button

Screen.Recording.2024-04-26.at.6.23.39.PM.mp4

Here's the repository I used for my tests:
test-repo-submodules.zip

Once #989 is merged, I could use it as a base to write a unit test that checks that submodule conflicts are well handled.

I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

GitUp does not handle submodule conflicts
1 participant