Home > Blockchain >  Committing changes in git in small chunks in a way that doesn't break the code (C )
Committing changes in git in small chunks in a way that doesn't break the code (C )

Time:09-14

I have written a code base with multiple driver filers, where each of these depend on functions and objects in different files. I branched off for these changes and have now been asked to merge them one by one (i.e. each driver file with its relevant dependencies) into the main branch. The issue I have is that if driver A and driver B are both dependent on object file C, and all three were changed, I cannot merge for example A and C together without breaking the functionality of B.

Is there a solution for this besides the obvious one of just merging everything together at once?

CodePudding user response:

If both A and B depend on C, and C (hopefully) does not depend on A and B, then the easy solution is to merge all changes in A, B, C in one commit, and tag the commit as "Change blah in C" or something like that. This message makes clear that A and B required to change in order to accommodate for the changes in C. Now, if A and B also changed for reasons other than the update in C, then you'll have to reset the history and commit unrelated changes one by one --- like others said, a PITA.

  •  Tags:  
  • git
  • Related