+4

Faster merge workflow: Support auto-stashing for merging in the same way it is already supported for pulling

Chris Kline 6 years ago 0

(Note: relates to this request, which deals with safely aborting merges)


When you pull from the remote origin into a repot that has local changes, SmartGit has a great feature where it will auto-stash before the pull, and auto-apply the stash after pulling. If conflicts occur after pulling, the user must manually apply the auto-saved stash after resolving the conflicts.


This feature is a huge time saver, and prevents loss of work as well.


This request is to implement the same feature for merging into a branch with local changes. 


Currently I have to do this:


Best case:


  • Create a stash (because I don't know if the merge will generate conflicts or not until I try)
  • Merge (no conflicts)
  • Apply the stash (no conflicts)
  • Drop the stash


Worst case:

  • Create a stash
  • Merge
  • Resolve merge conflicts
  • Manually apply the stash
  • Resolve conflicts from applying the stash
  • Drop the stash

What I would like is for SmartGit to perform the auto-stash / auto-unstash for me before/after merging. The resulting workflow would be simplified:


Best case:

  • Merge (SmartGit does auto-stash/un-stash, no conflicts at all from merge or unstash, SmartGit auto-drops the stash)

Worst case:

  • Merge (SmartGit auto-stashes)
  • Resolve merge conflicts and continue the merge 
  • Manually apply the stash
  • (Possibly) Resolve conflicts from the auto-unstash
  • Drop the stash


As you can see, this reduces the common-case (clean merge, clean unstash) from 4 steps to 1.


In the middle case (conflicts only upon merge or unstash, but not both) it reduces it from 6 steps to 4.


In the worst case (conflicts on both merge and un-stash) it reduces it from 6 steps to 5.