Changes between Version 30 and Version 31 of DarcsEvaluation

Jul 24, 2008 2:07:54 PM (9 years ago)

add info about git and file renames


  • DarcsEvaluation

    v30 v31  
    314314||{{{darcs pull}}}||{{{git pull}}} then {{{git cherry-pick}}}/{{{gitk}}} + select patches using mouse.  It's probably best to have one local branch correspond to the remote branch and then cherry-pick from that.  You can also create local names for several remote repositories.||
     316Git doesn't handle file renames well.  Here's a script to demonstrate the problem:
     319# Demonstrates problem with git's cherry picking not commuting around
     320# file renmaes.
     322rm -rf repo1 repo2
     324mkdir repo1
     325cd repo1
     326git init
     327printf "b\nd\n" >file
     328git-add file
     330git-commit -m "bd"
     332cd ..
     333git clone repo1 repo2
     335cd repo1
     336git mv file file1
     337git commit -m move
     338printf "a\nb\nd\ne\n" >file1
     339git commit -m "abde" file1
     340printf "a\nb\nc\nd\ne\n" >file1
     341git commit -m "abcde" file1
     343cd ../repo2
     344git remote add -f repo1 ../repo1
     345git cherry-pick repo1/master
     346# cherry-picks the most recent change from repo1
     347# BANG!!!
     350Apparently git didn't realise that "file" had been renamed to "file1" in one branch, because its contents had also changed sufficiently.  In fact, if you add enough other stuff to the file so that both versions are similar, then the merge works, which is deeply worrying.
     352This goes wrong with git version  I wouldn't be surprised if other versions work, but the underlying issue is that git doesn't store information about file and directory renames, and has to rely on heuristics to recover the information when necessary.  Converting a darcs repo into a git repo is a lossy conversion - it discards information about renames.
    316355== Darcs alternatives still in the running ==
    389428Advantages to staying with darcs:
    391431 * Community consistency: essentially the Haskell community has standardised on darcs, so it would be
    392432   an extra barrier for contributors if they had to learn another VC system.