simonvetter / afpfs-ng

afpfs-ng/libafpclient is an open source client for the Apple Filing Protocol
GNU General Public License v2.0
70 stars 34 forks source link

History merge from SourceForge CVS #8

Open 007 opened 8 years ago

007 commented 8 years ago

I pulled the CVS repo from SF.net and filtered / imported it through SVN to GIT. It'd be nice to get that more-detailed history included in this repo (for git blame change annotation), but I don't see any way to make that happen short of a force-push.

Would you consider going through the same process to pull history and doing the force-push on your tree? You can see the end-result on 007/afpfs-ng but there's apparently no common base to let me send a PR.

This process worked for me on Ubuntu 14.04. I had to install cvs2svn, subversion and git-svn, and I don't remember if I needed other dependencies.

#!/bin/bash
# use a hard-root path to make file:// git-svn path look a little better
WORKDIR=/afpfs-ng.cvs.sourceforge.net
# might need to be sudo, or might need to create ahead of time
mkdir -p ${WORKDIR}
cd ${WORKDIR}
echo "Extracting CVS"
rsync -aP rsync://afpfs-ng.cvs.sourceforge.net/cvsroot/afpfs-ng/ cvs-version/
echo "Creating SVN dump"
cvs2svn --fallback-encoding latin1 --dumpfile afp.svn.dump cvs-version/afpfs-ng/
echo "Loading SVN dump"
svnadmin create svn-version
svnadmin load svn-version < afp.svn.dump
echo "Creating GIT clone"
cat > authors.txt << EOF
alexthepuffin = Alex deVries <alexthepuffin@gmail.com>
demon = Derrik Pates <demon@now.ai>
mulbrich = Michael Ulbrich <mulbrich@users.noreply.github.com>
(no author) = Alex deVries <alexthepuffin@gmail.com>
EOF
git svn clone file://${WORKDIR}/svn-version git-version –no-metadata -A authors.txt -t tags -b branches -T trunk
echo "working directory is ${WORKDIR}/git-version"
cd ${WORKDIR}/git-version
echo "Promoting trunk/afpfs-ng to true-root"
git filter-branch --subdirectory-filter afpfs-ng -- --all
echo "Getting new changes"
git remote add simonvetter https://github.com/simonvetter/afpfs-ng
git fetch simonvetter
echo "Pulling remote commits"
# these say "use the CP version of any/all diffs and overwrite mine"
git cherry-pick -m0 --strategy=recursive -Xtheirs 5a5eae2bdc859889911e0740be0b74e744dc0642
git cherry-pick -m0 --strategy=recursive -Xtheirs 93d871128cbbde25c49c6dfcf9d8d610130aea9d
git cherry-pick -m0 --strategy=recursive -Xtheirs ec7b7475abfcbdae49e244f6afee37c49326dbf0
git cherry-pick -m0 --strategy=recursive -Xtheirs 2017974c85cc11267bf8272ed08f39df9b8db11b
git cherry-pick -m0 --strategy=recursive -Xtheirs 2f232087da6d513b6f8fcb42a1436ce917e5a613
git cherry-pick -m0 --strategy=recursive -Xtheirs fac89c1978ca8963147c4384581dcc3fdccfedbd
git cherry-pick -m0 --strategy=recursive -Xtheirs 24e186b6867096701fb8319064563f2d8498cf6e
git cherry-pick -m0 --strategy=recursive -Xtheirs d5b75bafe5a6a95a0a546a69b1219edebfaa748c
git cherry-pick -m0 --strategy=recursive -Xtheirs b8862f904da166b7e4f60c329d165415a9c19e96
git cherry-pick -m0 --strategy=recursive -Xtheirs 6d53fbd677272040c14b978614fe28ba617c2b58
git cherry-pick -m0 --strategy=recursive -Xtheirs e107bd4939d9332e5eb70ab0c09479b7a87d18e2
echo "Pulling  merges"
git cherry-pick -m1 --strategy=recursive -Xtheirs 1a766be39e9f4850c56220d2b18faf506c8baae1
git cherry-pick -m1 --strategy=recursive -Xtheirs f6e24eb73c9283732c3b5d9cb101a1e2e4fade3e
echo "Packing everything like a boss"
git repack -a -d -f --depth=1000 --window=500

There are exactly 500 commits that end up in SVN, so this whole process takes about 2 minutes end-to-end.