Bug: Aborting conflict resolution still stages file when using external tool

Piotr February 11, 2019

1. Right click on an unstaged file > Resolve Conflicts > Launch External Merge Tool

2. Externa tool is opened, SourceTree shows "Visual Merge In Progress" window with Abort button

3. After I click Abort and close external, SourceTree moves the unstaged file to staged files and in unstaged file new ".orig" file is left

 

My expectation is that since I aborted the the conflick resolution, it should leave the file in unstaged section. Right now I have to manually mark the file as unresolved. Also, if there are multiple files in Staged files, it is sometimes hard to find the file.

 

I tried reporting this as a bug but your bug tracking website does not allow me to do that - the Create issue window has only Cancel button...

1 answer

0 votes
Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 13, 2019

Hello! This is a result of the return code your merge-tool is returning back to Git. You can read more about this here

Piotr February 14, 2019

What does the "Abort" button do if it's not aborting the conflict resolution?

Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2019

It just closes the dialog and terminates the process. I assume git then updates the index when your tool closes.

 

You can see the same behavior Sourcetree does by doing the following via the terminal:

  • Have a conflicting file in your repo
  • Run:
    • git mergetool -y --tool=YOUR_MERGE_TOOL -- YOUR_FILE_NAME
  • Wait for the mergetool to start
  • Kill the git.exe process via task manager
  • Close the merge tool and observe that "git status" no longer reports a merge conflict
Piotr February 15, 2019

It just closes the dialog and terminates the process. I assume git then updates the index when your tool closes.

It does not terminate the process. Tested with p4merge and with WinMerge. I have to close the tool myself. To me it looks like the button does nothing.

 

 

  • git mergetool -y --tool=YOUR_MERGE_TOOL -- YOUR_FILE_NAME

Yes you are right, git behaves in the same way. In the config I see following:

mergetool.sourcetree.cmd='C:/Program Files/Perforce/p4merge.exe' "$BASE" "$LOCAL" "$REMOTE" "$MERGED"

After running:

git mergetool -y --tool=sourcetree -- myfile

and closing p4merge window and choosing not to save changes, the file is indeed moved to staged.

 

 

So I understand that SourceTree is simply calling git to do the merge resolution using mergetool, and I'd have the same issue if I was using git directly.

Still, is there no way to abort a conflict resolution using external tool, in a way that the file is not staged and that it's still marked as having unresolved conflict?

Deleted user October 2, 2019

I am having the same issue. Is there a way to tell git to leave the file unresolved? When the external merge tool aborted or otherwise did not complete the merge.

Deleted user October 2, 2019

Maybe there's something similar to setting git config mergetool.<tool>.trustExitCode to 0/false in Sourcetree?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events