This is a imaginary problem, but I’m having real problems with patches. Let’s say I have a project with the following git history:
A - B - C
Now if I receive two patches, C1 and C2, that are meant to be applied on C, how should I handle them? If I apply patch C1 first, then I will not be able to apply patch C2 because the repository has become:
A - B - C - C1
Is it possible to apply them both, or do I have to reply to the person sending C2 telling him/her to update the patch?
Now suppose I go offline and work and commit so that the repository becomes:
A - B - C - D - E
Then I check my email and receive a patch for C. Again, is it possible to simply apply that patch, or do I have to ask for an update to the patch?
The classic way is to:
The general idea is that it isn’t up to you to solve merge conflicts: only the creator of the patch has the necessary knowledge to solve any conflict with the current source code.
As Linus Torvalds (creator of Git) said in his 2007 Google talk: