Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,930
Community Members
 
Community Events
184
Community Groups

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

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.
Feb 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

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.
Feb 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

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?

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.

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