A smarter mergemaster

Bakul Shah bakul at BitBlocks.com
Sat Oct 1 15:16:15 PDT 2005


> : cd <etc workspace>
> : make etc-diff	# ensure your workspace reflects what is in /etc
> : <if resync is needed, commit them to local repo>
> : 
> : make import	# import the latest /usr/src/etc into etc workspace
> : make diff	# look over the changes
> : <make any local repairs>
> : make install	# install to /etc; do mkdb etc.
> : <check out your changes>
> : 
> : Finally:
> : make commit	# commit changes to local repo
> : OR
> : make undo	# if things didn't quite work, restore /etc to old state.
> : 
> : Roughly, the current mergemaster does the work of make
> : import, make diff, repairs and install.
> : 
> : Comments?
> 
> I implemented something very similar to this for maintaining all the
> etc files at Timing Solutions.  We have a tree that gets installed
> over the base OS.
>
> However, it doesn't easily allow for a mergemaster step since it
> installs all the files with schg set, and doesn't have three way merge
> in potential.

mergemaster just has to do a merge in a temp workspace
(initially a copy of /etc).  Makefile can do all the schg
magic when it installs to /etc.  But this can get messy
and I don't have a clean model....

One would have to keep Freebsd's /usr/src/etc in a vendor
branch and do a checkout -j or something.

When there is no conflict, an update goes very fast.  In case
of conflicts perhaps one can use the interactive merge
feature from mergemaster.  For files of same name but with
entirely different content, merge with the vendor branch
needs to be avoided.

Basically anything we can do to make it easy to use this
"best practice" would be nice....  even nicer if it covers
/usr/local/etc!


More information about the freebsd-hackers mailing list