Subject: Re: Big Mess--How to use Git to resolve

From: [email-masked] (Randal L. Schwartz)
Date: Sat, 17 Dec 2011 07:33:06 -0800

>>>>> "hs" == hs glw <[email-masked]> writes:

hs> Some clients have customizations of the code, some have version 5 of the
hs> software others have 5.2, 5.5 etc.

Create an empty repo.

Unpack the oldest release (I presume you still have the tarballs) you
might have forked a customer from.  commit it, and tag it as v5.0 (or
whatever it is).

In the same dir, delete the files, and unpack the *next* release.  git
add . again, and commit that, effectively recording the changes from one
release to the next.  Tag it v5.1 or whatever.

Repeat for all releases.

git branch -m master release

That will remain your untouched release branch.

Now, take customer1.  Figure out which release is closest to their
modified code.  Let's say it's v5.2

git checkout -b customer1 v5.2

erase the files, copy their work in, and commit.  You'll now have a
customer1 branch that comes off the right release.

repeat for each customer.

So now you have tags for each release, and every customer's code checked
in somewhere.

If you feel brave, you can try to move a customer to a later release:

git checkout customer1
git rebase v5.5

That will try to apply the diff between v5.2 and customer1 directly to
the top of v5.5.  Might fail, might need some mopping up.  But at least
the hard work is done.

Hope this helps.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email-masked]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion