4 ms·
> Rewording a commit is guaranteed to not cause a merge conflict, so requiring that the commit be checked out is unnecessary What if someone else rewords the s
by rcme 4y ago
> Rewording a commit is guaranteed to not cause a merge conflict, so requiring that the commit be checked out is unnecessary
What if someone else rewords the same commit?
- afiori 4y agoThat will be resolved during a merge/rebase and only if you are editing an already pushed commit. Overall git does use the filesystem in a lot of cases when it is not needed.
- arxanas 4y agoAh, I should have been more precise. If you were to reword a commit in the equivalent manner as `git rebase -i`, which is to say, reapplying any descendant commits/patches, you would be guaranteed not to get conflicts while applying descendant commits. I suppose there is some possibility for merge conflicts in a workflow where you reword a public commit, which changes the merge-base in an unfortunate way and causes conflicts to appear which wouldn't have otherwise. Primarily I meant the workflow where you reword local commits only. More enlightened version control systems like Mercurial can handle this better, such as via its "commit evolution" feature. If you then rebase on top of a reworded commit, the patches will apply the same, and you can resolve the so-called "divergence" by running `hg evolve`. (It's still possible to have un-automatically-remediable divergences, such as if two people reword the same public commit in different ways, but it handles the common case.)