Mercurial for dotfiles
19 Feb 2009Nicks' post on customizing your home was interesting. Over the last year or so, I've been slowly improving the way I do this. My results have been mixed, probably because of the way I use Mercurial.
So I've got a repo to keep my dotfiles. There's a truly awful script that will symlink the real files to the repo, and doesn't clobber the originals more than one time out of three. I clone to work, or to a laptop, and start customizing. Overall, I feel like this should work…but it's decidely awkward.
Let's take the case of bash init files. I've got mine divided into
.bashrc
and .bashrc_local
. The latter, as you'd expect, is
machine/situation-specific — ssh aliases, commands for work,
etc. .bashrc
sets various aliases and functions that are unlikely to
change. Just before exporting all the environment variables,
.bashrc_local
is sourced, which gives me a chance to override
anything.
.bashrc
should be in the repo — no question about that. But
.bashrc_local
should be there too, since I may clone my repo at work
(say) to another filesystem. Since Mercurial is distributed, there's
no problem with this — except when it comes to merging things back
home. Since I think about home as The One True Repo, I want to keep
everything there. But usually I've run hg push ssh://home
, which
promptly clobbers .bashrc_local there (at least when I do an hg
update
. Or if I merge from home, I end up creating new heads in my
repo, and a multi-headed repo can't be pushed. (I'm fuzzy on the
details; usually when this happens I bang away at it randomly until
merges happen, and swear until I'm blind.)
As outlined here, the difficulty is probably in the way I use Mercurial and the way I've become used to SVN's (and CVS's) idea of branches that look like directories (and are thus very, very visible and easy for me to think about). xyld says, "I'm fed up with having to do hg merge and not actually merge anything, but just to satisfy the Mercurial internals." That's pretty much how I'm starting to feel. There's the option of doing pull, rather than push, to cherrypick the changes I want, but it's still a bit awkward for me to think about.
I understand SVN; it fits well with my brain, which is not a developer's. I understand hg, and I like the idea of distributed repos for certain things. But xyld's comments about switching to git resonate with me, and I may start trying that out.
Add a comment:
Name and email required; email is not displayed.
Related Posts
QRP weekend 08 Oct 2018
Open Source Cubesat Workshop 2018 03 Oct 2018
mpd crash? try removing files in /var/lib/mpd/ 11 Aug 2018