Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying Git Diff files

Tags:

c++

git

c

diff

We branched off the main project about 6 months ago. In that time the master branch 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. 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?

like image 287
Chad Avatar asked Jul 22 '09 07:07

Chad


1 Answers

diff has the option you need: -D NAME

like image 101
reinierpost Avatar answered Oct 07 '22 13:10

reinierpost