tags:

views:

132

answers:

1

Will explain the problem that I'm faces, so that you have a better idea about the situation.

We have one project, and about 6 months ago it was branched off. Lets call our branch A, and theirs branch B.

In that time branch B has had 100,000 more lines of code added or deleted. We on the other hand have added or changed about 50,000 lines of code since the branch too. Its currently time to merge, so we've made a copy of branch A and merged changes from their branch B into it and called it branch C.

Now we want to take all the merge changes in our branch C and merge it back into our original branch A. But we want to safe guard against something horribly going wrong so we want to use the preproccesor to enable it or disable it depending on our product release of beta or release.

For example.

#if _BETA_CODE
.... their new code. (Merged)
#else
... our old code.
#endif

Does anyone know of a tool that can take the Diff of two projects (branch A, and the beta branch C) and merge them together but mark the changes with using #ifdef #else #endif commands?

+6  A: 

diff -D NAME

reinierpost
Thank you sooo much for this!
Chad
And diff3 to do 3-way merge (it accepts the same option)
Jakub Narębski
The solution to the problem was just simply to run a GIT difference to get a list of all files. Then open up TextPad and do a simply macro like this.diff OldFile NewFile -D MacroName > OutputFileVery simple and it covered all the 1,000 files and 150,000 lines of source code perfectly.
Chad
Btw thanks to reinierpost :) thanks!
Chad