ref: a08453bf28d8178919b62d01b73e56c209f5b4d1
dir: /merge/
#!/bin/rc -e rfork ne . /bin/git/common.rc usage=' git/merge theirs ' fn merge{ ourbr=$1/tree basebr=$2/tree theirbr=$3/tree all=`{walk -f $ourbr $basebr $theirbr | \ sed 's@^('$ourbr'|'$basebr'|'$theirbr')/*@@g' | sort | uniq} for(f in $all){ if(! test -f $ourbr/$f) ours=/dev/null if(! test -f $basebr/$f) base=/dev/null if(! test -f $theirbr/$f) theirs=/dev/null if(! ape/diff3 -m $ourbr/$f $basebr/$f $theirbr/$f > $f) echo merge needed: $f } } if(! ~ $#* 1) usage if(! cd `{git/conf -r}){ echo 'not in git repository' exit 'badrepo' } git/fs theirs=`{git/query $1} ours=`{git/query HEAD} base=`{git/query $theirs ^ ' ' ^ $ours ^ '@'} merge /mnt/git/object/$ours /mnt/git/object/$base /mnt/git/object/$theirs echo $ours $theirs > .git/index9/merge-parents