Skip to content

Instantly share code, notes, and snippets.

@toke
Created December 6, 2011 14:57
Show Gist options
  • Save toke/1438463 to your computer and use it in GitHub Desktop.
Save toke/1438463 to your computer and use it in GitHub Desktop.
git cvs update helper
#!/bin/bash
GIT="/usr/bin/git"
CVS_MODULE_BASE="BASEPATH/"
if [ -d .git ] ; then
if [ `git config --get cvsimport.module` ] ; then
echo "Good! Using the short cvsimport method"
${GIT} cvsimport
else
MODULE=`/usr/bin/basename \`/bin/pwd\``
CVS_MODULE="${CVS_MODULE_BASE}${MODULE}"
echo -e "IF YOU HAVE SET config cvsimport.module \$MODULNAME, and cvsimport.r cvs, cvsimport.d \$CVSROOT you may (and should) run git cvsimport!\n"
echo -e "You can do this by typing:\n"
echo "git config cvsimport.module ${CVS_MODULE}"
echo "git config cvsimport.r cvs"
echo -e "git config cvsimport.d \$CVSROOT\n\n"
echo "Trying to update ${MODULE} from CVS via ${CVSROOT}"
${GIT} cvsimport -d $CVSROOT -r cvs -k ${CVS_MODULE} -o master
fi
else
echo "Not an git repository or not on repository root"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment