Personal tools

Darcs vs. Git

From HaskellWiki

Revision as of 18:26, 11 December 2012 by Lemming (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I don't understand why so many people move from darcs to git.

Contents

1 darcs replace

Darcs can replace identifiers, Git cannot. I often rename identifiers. The identifier substitution of Darcs both saves space and allows for smooth merging. In Git renamings of identifiers look like you alter a lot of lines here and there. I don't think that Git can easily implement that feature, because it has no notion of a patch.

2 darcs check --test

Darcs lets you easily run a test suite after every commit. Usually I register

cabal configure && cabal build && cabal haddock && cabal test

as a darcs test. After recording a patch, darcs unpacks the repository temporarily in the state after adding the patch. Then it runs the test suite within that temporary copy of the repository. If you add a file the Cabal description but forgot darcs add or vice versa, then the darcs test will quickly spot the problem.

This almost not possible with Git. It could certainly be hacked into .git/hooks/pre-commit.sample, but the crucial feature of running a test is to reject a commit if it does not pass the tests. If there is a way in Git then it is by far more complicated than in Darcs.

I see no reason why Git does not support pre-commit tests properly.

3 Pushing to the wrong repository

It is very easy in Git to push commits to an unrelated repository or to the wrong branch of a repository. And it is cumbersome and dangerous to get rid of the wrongly pushed commits, if operating in a server git repository. In darcs this cannot happen so easily since normally darcs asks you which patch to push. This way you can see early if something starts to go wrong.

4 Update of working copy files

5 Branches

6 Merging

7 GitHub

github sucks, looping scripts, pull requests, how to get a git repository