How to manage config files

Kent Gibson warthog618 at gmail.com
Tue Nov 20 14:05:43 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Mike Brack wrote:
>
>
> On 11/20/07, *Martin Pool* <mbp at sourcefrog.net
> <mailto:mbp at sourcefrog.net>> wrote:
>
>     > I have config and ohter files which I want to version spread
>     over different directories.
>     > Does that mean there is no way to have all them centrally
>     stored and managed by bazaar?
>
>     Maybe I'm missing your point.  Normally one would just 'bzr
>     init' the
>     highest-level directory (eg /etc), then add the files underneath
>     them
>     using 'bzr add'.  This will give you just one .bzr directory
>     representing the whole configuration.
>
>     > When I have various .bzr directories on my machines, is there
>     a way to get a single view on them?
>
>     There's no builtin thing that will find all the
>     directories.  Normally
>     you would add all versioned files to one tree.  Maybe you could
>     explain more about why you have many .bzr directories?
>
> 
> I have several Linux machines, but let's focus for the time being on
> only one machine.
> On this machine I have several different configuration files for
> various apps, tool, etc.
> Each of this config file I would like to get versioned but these
> files must remain in the origin location.
> Maybe I used bazaar the wrong way, up to know I did an init in every
> directory where a config file is located.
> Therefore my question if I can have only one bzr directory.
> Is it possible to just have one in /home/<user/.bzr and all config
> file which are in the user space get managed through this .bzr?
> 
Sure thing.  You can init your home directory then selectively version
anything within it, using `bzr add` on the relevant files or
subdirectories.
IMO this is one of the major advantages of bzr over svn and cvs - you
can easily version your files in place, or even sparse subsets of your
files, and not leave .svn or .CVS directories littered all over your
directory tree.

I use bzr for versioning my /etc on several machines as Martin
describes above.  Same principle, just a different location.  That
creates a single .bzr directory - /etc/.bzr.

Btw, you can also nest one working tree within another.  bzr walks up
the directory tree looking for the nearest .bzr - that is what
identifies the relevant working tree.  e.g. Say you version your home
directory so that you can version all the config files you have in
there.  That will create a .bzr directory at ~/.bzr.  Later on you
decide you want to start working on a new project that has nothing to
do with your config files, and naturally you want to version it.  You
can then create a directory ~/myproject and init that, which will
create a .bzr directory at ~/myproject/.bzr.  Then you can version all
the files in the myproject directory independently of your config
files.  The two bzr directories would be ~/.bzr and ~/myproject/.bzr.
The ~/myproject/.bzr covers everything in ~/myproject while the ~/.bzr
covers everything else in your home area.

I hope that helps.

Cheers,
Kent.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHQum3goxTFTi1P8QRAvWpAKCV31D+ZjVtFFGEWuH0kGb2XoX93gCeJbqv
aJsFeE5Ebl0YsdJI34LilNY=
=nOFO
-----END PGP SIGNATURE-----



More information about the bazaar mailing list