Personal tools

Darcs vs. Git

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(replace, tests, wrong push)
 
(Added context for GHC's switch from darcs to git)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
I don't understand why so many people move from darcs to git.
+
= Darcs Resources =
   
== darcs replace ==
+
* http://darcs.net/ Main site
   
Darcs can replace identifiers, Git cannot.
+
* http://darcs.net/FAQ
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.
 
   
== darcs check --test ==
+
* http://www.haskell.org/haskellwiki/Darcs
   
Darcs lets you easily run a test suite after every commit.
+
* http://en.wikibooks.org/wiki/Understanding_Darcs/Patch_theory_and_conflicts
Usually I register
 
   
: <code>cabal configure && cabal build && cabal haddock && cabal test</code>
+
= Git resources =
   
as a darcs test.
+
* http://git-scm.com/ Main site
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 <code>darcs add</code>
 
or vice versa, then the darcs test will quickly spot the problem.
 
   
This almost not possible with Git.
+
* http://git-scm.com/book
It could certainly be hacked into <code>.git/hooks/pre-commit.sample</code>,
 
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.
+
* http://gitref.org/
   
== Pushing to the wrong repository ==
+
* http://bramcohen.livejournal.com/74462.html
   
It is very easy in Git to push commits
+
= GHC's switch from darcs to git =
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.
 
   
== Update of working copy files ==
+
* http://www.haskell.org/pipermail/glasgow-haskell-users/2011-January/019752.html
   
+
* http://www.reddit.com/r/haskell/comments/ezgvs/rfc_migrating_ghc_development_to_git/ interesting thread
== Branches ==
 
 
== Merging ==
 
 
== GitHub ==
 
 
github sucks, looping scripts, pull requests, how to get a git repository
 

Latest revision as of 18:50, 18 June 2014

[edit] 1 Darcs Resources

[edit] 2 Git resources

[edit] 3 GHC's switch from darcs to git