Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

A project I work on uses source code that's been purchased from a third party. The source code is delivered to us in a zip file. We store this source code in version control (TFS 2010) and routinely make modifications to it.

When the third party releases a new version of the product we've purchased, I need to merge their new code into ours. Because the code I get is not under any kind over version control, it's very difficult to do this merge correctly.

The last time I did this, we had not made many changes. As a result, I was able to check all the files out, copy the new files into their place, and fix up everything by hand without the help of any merging tools. Now that we've got a much larger set of changes, fixing things up by hand is too fragile to be a viable option.

Are there any better ideas, or is this doomed to be painful and fragile each time?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

I can say nothing about TFS, but in other SCMs with good branching/merging it's known as "Vendor branching" workflow.

In short: your repository will get (at least) two branches - f.e Vendor and Custom

In Vendor branch you'll store vanilla versions of code as is, Custom branch will get your local modification on top of original.

Process of update is rather straightforward:

  • Update sources in Vendor with new version, commit
  • Merge Vendor into Custom

Not-conflicted changes (no intersection of upstream changes with own) will be merged automatically, conflicts must be resolved by hand

share|improve this answer

The best tool for that is a good diff/merge tool. Most of those support three way merging. With that you take the old original code, your modifications and their modifications and get them in three panes side by side and can see who changed what.

I'm mostly using meld, but there are tons of other such tools working more or less equally well.

meld three way merge

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.