{"thread":{"id":"1037","subject":"GIT-CVS sync script","startedAt":"2005-06-28T19:14:46Z","lastAt":"2005-06-28T19:56:13Z","messageCount":3,"participants":["Panagiotis Issaris","Matthias Urlichs","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"5356","messageId":"20050628191445.GA27979@lumumba.uhasselt.be","threadId":"1037","inReplyTo":null,"subject":"GIT-CVS sync script","fromName":"Panagiotis Issaris","fromEmail":"takis@lumumba.uhasselt.be","sentAt":"2005-06-28T19:14:46Z","receivedAt":"2005-06-28T19:14:46Z","isPatch":false,"sender":{"key":"takis@lumumba.uhasselt.be","avatar":null},"body":"Hi,\n\nI find the included script useful to easily track a CVS repository in\nGIT. You can both call it for the initial import and ofcourse for the\nsubsequent resynchronisation with the parent CVS repository (that's what\nthe script's about).\n\nWould it be better to provide this as a patch against git-cvsimport-script?\n\nIt has been tested on the RTAI-Fusion repository.\n\nWith friendly regards,\nTakis\n\nSigned-off-by: Panagiotis Issaris <takis@gna.org>\n\n#!/usr/bin/env bash\n#\n# Keep a GIT repository in sync with a CVS repository.\n# \n# Copyright (c) Panagiotis Issaris, 2005.\n#\n\nCVS2GIT_PATCHSETNR=.cvs2git_patchsetnr\nCVS2GIT_UPGRADESCRIPT=.cvs2git_updatescript\nPROJECT_GITDIR=`pwd`\nPROJECT_CVSDIR=$1\nCVSPS_OPTIONS=\"--no-rlog\"\n\nusage () {\n        echo -e \"Usage: \\n\\t$0 /path/to/project/cvsdir\"\n        exit 1\n}\n\nif test $# -lt 1 ; then\nusage\nelse\nif test ! -d $PROJECT_CVSDIR; then\nusage\nfi\nfi\n\ncd $PROJECT_CVSDIR\n\nif test ! -d $PROJECT_GITDIR/.git; then\n\nTZ=UTC cvsps $CVSPS_OPTIONS -A > $PROJECT_GITDIR/.git-cvsps-result\ngit-cvs2git --cvsroot=`cat CVS/Root` --module=`cat CVS/Repository` < $PROJECT_GITDIR/.git-cvsps-result > $PROJECT_GITDIR/.cvs2git_updatescript\n\nelse\n\nif test -f $PROJECT_GITDIR/.cvs2git_patchsetnr; then\nPATCHSETNR=`cat $PROJECT_GITDIR/.cvs2git_patchsetnr`;\nelse\nPATCHSETNR=`cvsps | grep \"^PatchSet \" | tail -n1 | cut -f2 -d' '`\nfi\nlet PATCHSETNR=$PATCHSETNR+1\n\n# Updating from patchset $PATCHSETNR...\nTZ=UTC cvsps $CVSPS_OPTIONS -x -s $PATCHSETNR- -A > $PROJECT_GITDIR/.git-cvsps-result\nif test ! -s $PROJECT_GITDIR/.git-cvsps-result; then\necho \"No new patchsets available\"\nexit 2\nfi\ngit-cvs2git -u --cvsroot=`cat CVS/Root` --module=`cat CVS/Repository` < $PROJECT_GITDIR/.git-cvsps-result > $PROJECT_GITDIR/.cvs2git_updatescript\n\nfi\n\n# Storing last patchset number $PATCHSETNR\nPATCHSETNR=`grep \"^PatchSet \" $PROJECT_GITDIR/.git-cvsps-result | tail -n1 | cut -f2 -d' '`\necho $PATCHSETNR > $PROJECT_GITDIR/.cvs2git_patchsetnr\n\n# And finally, execute the generated script\ncd $PROJECT_GITDIR\nsh .cvs2git_updatescript\n"},{"id":"5358","messageId":"pan.2005.06.28.19.33.40.876796@smurf.noris.de","threadId":"1037","inReplyTo":"20050628191445.GA27979@lumumba.uhasselt.be","subject":"Re: GIT-CVS sync script","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-28T19:33:43Z","receivedAt":"2005-06-28T19:33:43Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Panagiotis Issaris wrote:\n\n> I find the included script useful to easily track a CVS repository in\n> GIT. You can both call it for the initial import and ofcourse for the\n> subsequent resynchronisation with the parent CVS repository (that's what\n> the script's about).\n> \nHmm, my Perl script (just posted...) should do the same thing without\ndepending on .git* files which may or may not still exist when you do an\nincremental import half a year later.\n\nCan you test whether that script works for you?\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nI may not be totally perfect, but parts of me are excellent.\n\t\t-- Ashleigh Brilliant\n"},{"id":"5361","messageId":"Pine.LNX.4.58.0506281254040.19755@ppc970.osdl.org","threadId":"1037","inReplyTo":"pan.2005.06.28.19.33.40.876796@smurf.noris.de","subject":"Re: GIT-CVS sync script","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-06-28T19:56:13Z","receivedAt":"2005-06-28T19:56:13Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 28 Jun 2005, Matthias Urlichs wrote:\n\n> Hi, Panagiotis Issaris wrote:\n> \n> > I find the included script useful to easily track a CVS repository in\n> > GIT. You can both call it for the initial import and ofcourse for the\n> > subsequent resynchronisation with the parent CVS repository (that's what\n> > the script's about).\n> > \n> Hmm, my Perl script (just posted...) should do the same thing without\n> depending on .git* files which may or may not still exist when you do an\n> incremental import half a year later.\n> \n> Can you test whether that script works for you?\n\nPlease do. I'm not proud of my horrid cvs2git thing, and if just one other\nuser reports \"it works for me\" I'll happily replace that piece of cr*p\nwith Matthias' version that looks much nicer (but not being a perl user I\ncan't judge it any other way than having others say \"yeah, that works for\nme\").\n\n\t\t\tLinus\n"}]}