[Gllug] Mercurial or Subversion for single user?
Philip Hands
phil at hands.com
Wed Mar 24 09:08:55 UTC 2010
On Wed, 24 Mar 2010 00:53:09 +0000
Nix <nix at esperi.org.uk> wrote:
> On 23 Mar 2010, James Courtier-Dutton uttered the following:
...
> Git uses snapshots of the entire tree, chained together into a
> directed graph of commits over time.
In fact, the directed graph bit is reasonably independent of the
objects, so you have a big bucket of versions, and then outside that
there's the graph of the history that gave rise to these versions.
I fell in love with git after having utterly misunderstood what I was
doing when trying to rewrite history only to discover that I'd
lobotomised the repository (by using --force a few times when it
wouldn't do what I thought I wanted -- Doh!), and the versions I cared
most about had disappeared -- you might think that's an odd point at
which to fall in love with it, but having taken a machine-shotgun to my
entire leg, I fairly soon discovered:
git fsck --unreachable
This lists versions that exist in the repository but are not recorded in
history -- iI fairly rapidly worked out that doing something like:
gitk --all $(git fsck --unreachable | cut -d\ -f3)
allows you to visualise where the orphans fit when compared with the
rest of the archive's history -- I had my lost version back in minutes,
and realised that you have to be considerably more stupid than I'd been
to actually lose data with git (I could have managed that by running the
garbage collector after being stupid).
It is rather important to understand something of the underlying model
in git though -- it's not difficult to do that, and will ensure that
you don't just feel confused all the time -- I'd recommend reading:
http://www.newartisans.com/2008/04/git-from-the-bottom-up.html
So, don't dismiss git as being overkill, it's really very good for all
sorts of odd tasks (I use it with etckeeper to track the contents
of /etc on all my systems, for instance) and if you're liable to do any
collaboration on free software you're going to bump into it eventually.
Once you're addicted to git, the pain of going back to svn collaboration
can be completely eliminated with git-svn.
If you're fed up with having to care what sort of repository you're
sitting in, Joey Hess has a wrapper that will drive all of them called
'mr'
Cheers, Phil.
--
|)| Philip Hands [+44 (0)20 8530 9560] http://www.hands.com/
|-| HANDS.COM Ltd. http://www.uk.debian.org/
|(| 10 Onslow Gardens, South Woodford, London E18 1NE ENGLAND
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list