Re: Three-way merge program
Re: Three-way merge program
- Subject: Re: Three-way merge program
- From: Greg Guerin <email@hidden>
- Date: Mon, 15 Oct 2007 19:51:30 -0700
Mark Wagner wrote:
>I'm working on merging two branches of development. However, on one
>branch of development, the casing of filenames and the line endings of
>files have changed, and FileMerge can't handle it. Does anyone have
>suggestions for a program I can use for this?
For line-endings, just canonicalize them first. There are any number of
ways to do that:
- script BBEdit, TextWrangler, or another text editor.
- write a script (AppleScript, Perl, sed, whatever)
For the casing of filenames, you can canonicalize those, too. For example,
convert all to lower-case, first building a database of the original case
for each filename. A simple text file should suffice for the "database".
After both canonicalizations are done, perform the merge.
After the merge is done, you shouldn't have to do anything to line-endings,
as they should already be in the correct (canonical) form. To restore the
original filename's case, refer to the database file you built before
lower-casing, and use that to map from the lower-case name back to the
original name, and issue a 'mv' command.
To me, this seems like the kind of thing Perl would be good for, not least
because it's easy to make simple databases using associative arrays.
Another option might be to see if BBEdit or TextWrangler will do a 3-way
merge while automatically handling line-ending canonicalization, and/or
filename caseness canonicalization. If so, it would probably save you
writing any scripts at all, or even if it will only do one thing, say,
line-ending canonicalization, it's still less work.
For the longer term, you might want to look into filters that canonicalize
line-endings at checkin or checkout of your SCM system. I'm not sure if
SCM would have case-canonicalizers or not, but who knows.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden