From: Nick Woolley <nickwoolley@yahoo.co.uk>
To: git@vger.kernel.org
Subject: [RFC] git-cvs script
Date: Sat, 30 May 2009 14:41:39 +0100 [thread overview]
Message-ID: <4A213793.3030205@yahoo.co.uk> (raw)
Hi,
I have script which wraps git-cvsimport and git-cvsexport, called "git-cvs".
The main aim of the script is to automate the steps for tracking a CVS
repository with the git-cvs* commands.
It's not currently as sophisticated as git-svn, it's undoubtably flawed and
isn't foolproof (e.g. exports to CVS of merged git histories can be
problematic), but I find it useful, because a lot of the nitty-gritty is done
for me.
I'd like to ask:
- Is this at all useful to anyone else in it's current form?
- Is there any prior art I should be aware of? (Presumably most people
just roll their own scripts, like I have)
- Bearing in mind that it's a work-in progress, are there any suggestions for
improvement?
The script can be found in its current state here:
http://github.com/wu-lee/git-cvs/
There's no installer, but the script is self-contained and just needs to be on
the execution $PATH (as well as git and cvs).
Given a CVS repository at $CVS_ROOT, tracking a module $CVS_MODULE can be done
like this:
# Create a git repo
git init
# Initialise git-cvs's config file
echo cvsroot=$CVS_ROOT >.git-cvs
echo cvsmodule=$CVS_MODULE >>.git-cvs
# First pull gets cvs files using git-cvsimport
# (optionally you can supply the option
# --author-file <authormap> for pass-through
# to git-cvsimport -A on subsequent invocations)
git-cvs pull
# hack hack...
# Push the files back into CVS with git-cvsexportcommit
# (This pushes the commits master..remotes/cvs/cvshead by default,
# or cvsworking/NAME..remotes/cvs/NAME for each CVS branch NAME)
git-cvs push
# Pull the changes back into remote/cvs/cvshead and
# (a messy part I've not found a way round yet) throw away our
# locally merged commits
git-cvs pull
git reset --hard master
# More hacking...
# Repeat push/pull steps as needed
Some other points:
- Changes in CVS get pulled back, including multiple branches.
- An author-mapping file can be supplied as for cvs-import -A
- The script creates local CVS working directories
.git/git-cvs/cvscheckout/NAME, one for each CVS branch NAME.
- Git's master branch tracks CVS's HEAD branch.
- A git branch cvsworking/NAME is created to track each CVS branch NAME.
- Edits in these branches get pushed back to the appropriate CVS branches.
- Verbose subcommand output currently goes into .git/git-cvs/logs.
- Invoking git-cvs with no parameters gets information about the options.
- In an emergency, a list of commit ids can be supplied to git-cvs push.
- Written in Perl, uses only core modules (tested with v5.8.8)
- There is a small test suite in t/, run individually or with "prove/*.t"
Thanks,
Nick
next reply other threads:[~2009-05-30 13:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-30 13:41 Nick Woolley [this message]
2009-05-30 23:33 ` [RFC] git-cvs script Junio C Hamano
2009-06-01 10:47 ` Nick Woolley
2009-05-31 7:42 ` Alex Bennee
2009-06-01 9:47 ` Nick Woolley
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A213793.3030205@yahoo.co.uk \
--to=nickwoolley@yahoo.co.uk \
--cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).