Skip to content

[Feature Request] Popup for merge conflicts #1210

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

Closed
lwray-renesas opened this issue Apr 17, 2025 · 10 comments
Closed

[Feature Request] Popup for merge conflicts #1210

lwray-renesas opened this issue Apr 17, 2025 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@lwray-renesas
Copy link
Contributor

Hello,

First of all, thanks for such a great tool!
I have a minor suggestion that might be good for first time users.

FYI I'm using Windows 10.
When in the HISTORY view and trying to merge changes between branches which contain conflicts that can't be resolved automatically, the details show that a the merge is in progress, indicating the merge is incomplete.
However for new users, its not immediately obvious that there are unresolved conflicts and that they need to go to LOCAL CHANGES and handle conflicts.

Suggestion is:
On detection of unresolved conflicts, to produce a pop-up/dialog that indicates conflicts exist which haven't been resolved and offers the user a button to launch their external merge tool on the files affected.

Thanks for any consideration!

Louis

@love-linger
Copy link
Collaborator

I suggest you to use a external merger.

Image

@love-linger
Copy link
Collaborator

You can also open external merger for all conflicts one-by-one by clicking this button.

Image

@lwray-renesas
Copy link
Contributor Author

Thanks for the quick response - Sorry, I don't think my request was clear.
Its not that I don't know how to launch the external merge tool, its that after I perform a merge and conflicts exist (whilst in the HISTORY view) its not immediately obvious that there are conflicts pending for a new user.

Image

I have to already know that "Merge in progress" means I need to navigate to LOCAL CHANGES and start addressing the conflicts there.

My request is that when a conflict is detected, a dialog popping up to indicate there is a conflict would help new users catch it.
Another suggestion might be to default the view to LOCAL CHANGES and select the first visible unstaged change, forcing the interface to the conflicts detected messaging.

Code wise, something like:

Image

@lwray-renesas
Copy link
Contributor Author

Just managed to mock up the behaviour if it helps illustrate?
Effectively forcing the user to deal conflicts, codes here if you want to give it a go, I'll open a pull request shortly and link here:

Dispatcher.UIThread.Invoke(() =>
            {
                if((visibleUnstaged.Count > 0) && (hasConflict))
                {
                    _repo.RefreshBranches();
                    _repo.RefreshCommits();
                    _repo.SelectedViewIndex = 1;
                    selectedUnstaged.Add(visibleUnstaged[0]);
                }

                _isLoadingData = true;
                HasUnsolvedConflicts = hasConflict;
                VisibleUnstaged = visibleUnstaged;
                VisibleStaged = visibleStaged;
                Unstaged = unstaged;
                Staged = staged;
                SelectedUnstaged = selectedUnstaged;
                SelectedStaged = selectedStaged;
                _isLoadingData = false;

                UpdateInProgressState();
                UpdateDetail();
            });

Image

Now after I open the repository and if there's a conflict causing a "merge in progress" OR I try perform a merge and a conflict causes a merge in progress", I'm immediately directed to the views used to to deal with the conflicts:

Image

lwray-renesas added a commit to lwray-renesas/sourcegit that referenced this issue Apr 17, 2025
As per sourcegit-scm#1210.
Included conflict popup + switched focus for immediate conflict handling.
@love-linger
Copy link
Collaborator

love-linger commented Apr 18, 2025

However for new users, its not immediately obvious that there are unresolved conflicts and that they need to go to LOCAL CHANGES and handle conflicts.

As you said, this problem will almost only trouble new users. For users who are already familiar with this app or other similar software like Fork, popping up a prompt box every time is not a very good solution.

Moreover, for the Interactive-Rebase operation, Rebase in progress may not be due to conflicts. For example, when the user selects the "Edit" operation, there is no conflict at this time, and it is only waiting for the user to modify the current commit (split or reword).

Another example is that when we run rebase or cherry-pick, empty commits may be generated. At this time, there are still no conflict files. It is only waiting for the user to decide whether to ignore this empty commit or generate an empty commit.

Therefore, I think the key to the problem is to make it easier for users to notice that the LOCAL CHANGES page is waiting for user operations (not just resolving conflicts).

@love-linger
Copy link
Collaborator

For example, I'd like to add just an icon to attract the user's attention.

Image

@love-linger love-linger self-assigned this Apr 18, 2025
love-linger added a commit that referenced this issue Apr 18, 2025
@love-linger love-linger added the enhancement New feature or request label Apr 18, 2025
@lwray-renesas
Copy link
Contributor Author

Ah, I understand and can see how my proposal is excessive, I like the icon to indicate action pending - seems like an elegant solution.

Just thinking out loud, how about keeping the pop-up (not the view switch portion, I see how that's unappealing now) but changing the messaging to "local changes pending review" but have a "Don't show this again" radio button to disable it for future launches?
First time users get a bit of a tutorial in this way and users who are familiar just disable it and move on.

One question I have about the code though as I'm not very familiar with the project and would like to get a better understanding - would checking for visibleUnstaged changes and hasConflicts not restrict the action to show the popup only when there are conflicting files? If it's an empty commit pending, I wouldn't expect there to be any visibleUnstaged changes? Meaning the view wouldn't switch and pop up wouldn't appear.

@love-linger
Copy link
Collaborator

One question I have about the code though as I'm not very familiar with the project and would like to get a better understanding - would checking for visibleUnstaged changes and hasConflicts not restrict the action to show the popup only when there are conflicting files? If it's an empty commit pending, I wouldn't expect there to be any visibleUnstaged changes? Meaning the view wouldn't switch and pop up wouldn't appear.

When there's an empty commit need to be confirmed, you still need to go to LOCAL CHANGES page, maybe you want to change the commit message or not, then press the CONTINUE button.

@love-linger
Copy link
Collaborator

Clipchamp.mp4

@lwray-renesas
Copy link
Contributor Author

OK I understand now thank you, appreciate you taking the time to explain and for addressing the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants