Changes between Version 30 and Version 31 of DarcsEvaluation


Ignore:
Timestamp:
Jul 24, 2008 2:07:54 PM (7 years ago)
Author:
simonmar
Comment:

add info about git and file renames

Legend:

Unmodified
Added
Removed
Modified
  • 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.||
    315315
     316Git doesn't handle file renames well.  Here's a script to demonstrate the problem:
     317
     318{{{
     319# Demonstrates problem with git's cherry picking not commuting around
     320# file renmaes.
     321
     322rm -rf repo1 repo2
     323
     324mkdir repo1
     325cd repo1
     326git init
     327printf "b\nd\n" >file
     328git-add file
     329git-status
     330git-commit -m "bd"
     331
     332cd ..
     333git clone repo1 repo2
     334 
     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
     342 
     343cd ../repo2
     344git remote add -f repo1 ../repo1
     345git cherry-pick repo1/master
     346# cherry-picks the most recent change from repo1
     347# BANG!!!
     348}}}
     349
     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.
     351
     352This goes wrong with git version 1.5.2.5.  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.
     353
     354
    316355== Darcs alternatives still in the running ==
    317356
     
    389428Advantages to staying with darcs:
    390429 
     430
    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.