Skip to content

Instantly share code, notes, and snippets.

@leikahing
Created September 7, 2011 18:13
Show Gist options
  • Save leikahing/1201293 to your computer and use it in GitHub Desktop.
Save leikahing/1201293 to your computer and use it in GitHub Desktop.
super hack!
#!/bin/bash
# Hacky script to see what we have that's not in SVN,
# and what we don't have that's in SVN
listfile="dirlist.txt"
svnfile="svnlist.txt"
rm $listfile $svnfile
touch $listfile $svnfile
for direc in `gls -Ad -1 */`; do echo ${direc%/} >> $listfile; done
for proj in `svn list https://svnserver/svn/invent`; do echo ${proj%/} >> $svnfile; done
echo "Projects you don't have, and the commands to run them "
for missing in `comm -2 -3 $svnfile $listfile`
do
echo "git svn clone -s -r 80000:HEAD https://svnserver/svn/invent/${missing}"
done
echo "Projects you do have, but SVN doesn't"
for nonsvn in `comm -1 -3 $svnfile $listfile`
do
echo $nonsvn
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment