sageserpent-open / kineticMerge

Merge a heavily refactored codebase and stay sane.
MIT License
12 stars 2 forks source link

Duplicate the behaviour of Git merge for simple renaming / movement of files with minor editing on one branch and outright deletion on the other. #4

Open sageserpent-open opened 1 year ago

sageserpent-open commented 1 year ago

This is similar to #3 , only this time the file is completed deleted on one branch - but is still renamed and / or moved on the other, possibly with some minor editing.

This is handled by git merge nicely:

  1. For a conflict between a renamed / moved file without edits and a deletion, it writes a stage entry for 'our' version of the file only. git status --porcelain says AU for the renamed / moved file.
  2. For a conflict between an edited and renamed / moved file and a deletion, it writes stage entries for the common base form of the file, 'our' version of the file, but leaves the conflicting deletion implied as there is neither a path nor any content for the deleted form. git status --porcelain says UD for the renamed / moved file.

Out of scope for this is what happens when a file split on one branch (possibly with edits in either part) and deleted outright on another. That is for another story.