From: takis@lumumba.uhasselt.be (Panagiotis Issaris)
To: git@vger.kernel.org
Cc: torvalds@osdl.org
Subject: GIT-CVS sync script
Date: Tue, 28 Jun 2005 21:14:46 +0200 [thread overview]
Message-ID: <20050628191445.GA27979@lumumba.uhasselt.be> (raw)
Hi,
I find the included script useful to easily track a CVS repository in
GIT. You can both call it for the initial import and ofcourse for the
subsequent resynchronisation with the parent CVS repository (that's what
the script's about).
Would it be better to provide this as a patch against git-cvsimport-script?
It has been tested on the RTAI-Fusion repository.
With friendly regards,
Takis
Signed-off-by: Panagiotis Issaris <takis@gna.org>
#!/usr/bin/env bash
#
# Keep a GIT repository in sync with a CVS repository.
#
# Copyright (c) Panagiotis Issaris, 2005.
#
CVS2GIT_PATCHSETNR=.cvs2git_patchsetnr
CVS2GIT_UPGRADESCRIPT=.cvs2git_updatescript
PROJECT_GITDIR=`pwd`
PROJECT_CVSDIR=$1
CVSPS_OPTIONS="--no-rlog"
usage () {
echo -e "Usage: \n\t$0 /path/to/project/cvsdir"
exit 1
}
if test $# -lt 1 ; then
usage
else
if test ! -d $PROJECT_CVSDIR; then
usage
fi
fi
cd $PROJECT_CVSDIR
if test ! -d $PROJECT_GITDIR/.git; then
TZ=UTC cvsps $CVSPS_OPTIONS -A > $PROJECT_GITDIR/.git-cvsps-result
git-cvs2git --cvsroot=`cat CVS/Root` --module=`cat CVS/Repository` < $PROJECT_GITDIR/.git-cvsps-result > $PROJECT_GITDIR/.cvs2git_updatescript
else
if test -f $PROJECT_GITDIR/.cvs2git_patchsetnr; then
PATCHSETNR=`cat $PROJECT_GITDIR/.cvs2git_patchsetnr`;
else
PATCHSETNR=`cvsps | grep "^PatchSet " | tail -n1 | cut -f2 -d' '`
fi
let PATCHSETNR=$PATCHSETNR+1
# Updating from patchset $PATCHSETNR...
TZ=UTC cvsps $CVSPS_OPTIONS -x -s $PATCHSETNR- -A > $PROJECT_GITDIR/.git-cvsps-result
if test ! -s $PROJECT_GITDIR/.git-cvsps-result; then
echo "No new patchsets available"
exit 2
fi
git-cvs2git -u --cvsroot=`cat CVS/Root` --module=`cat CVS/Repository` < $PROJECT_GITDIR/.git-cvsps-result > $PROJECT_GITDIR/.cvs2git_updatescript
fi
# Storing last patchset number $PATCHSETNR
PATCHSETNR=`grep "^PatchSet " $PROJECT_GITDIR/.git-cvsps-result | tail -n1 | cut -f2 -d' '`
echo $PATCHSETNR > $PROJECT_GITDIR/.cvs2git_patchsetnr
# And finally, execute the generated script
cd $PROJECT_GITDIR
sh .cvs2git_updatescript
next reply other threads:[~2005-06-28 19:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 19:14 Panagiotis Issaris [this message]
2005-06-28 19:33 ` GIT-CVS sync script Matthias Urlichs
2005-06-28 19:56 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050628191445.GA27979@lumumba.uhasselt.be \
--to=takis@lumumba.uhasselt.be \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox