This is a small set of Git-CVS workflow utilities.
It is expected to initialize and work with a Git repository that shares the same directory as the CVS repository.
Use it at your own risk.
git clone https://github.com/vilic/gcvs.git
source gcvs/utilities.sh
All the following commands are expected to be executed under CVS working directory.
Please check out the source code to see what exactly happens.
gcvs_init
gcvs_update
# alias `gcup`
Please note it will only export the last commit, and it will commit automatically if export patch applies.
gcvs_export
# alias `gcxp`
gcvs_export_continue
# alias `gcxpc`
Do Git commit with message "CVS update (...)"
(commit with message in this
format will abort exporting). You may need to do so when your repository gets
messy and need to by synchronized manually.
gcvs_git_commit_as_cvs_update
# alias `gccu`
After Git committing, you may also need to manually commit to CVS as well.
The .gitignore
file will be updated automatically on intializing and
updating, but you can still manually update it with following command:
gcvs_update_gitignore
# alias `gcui`
You can also create a custom .git/extra.gitignore
file to tell gcvs what to
add to the .gitignore
file.
Remove .#*
, .msg
, .cvsexportcommit.diff
files and tmp-*
branches.
gcvs_cleanup
# alias `gccl`
It provides gcvs_on_export_complete
and gcvs_on_update_complete
as hooks.
You can add functions named after them, e.g.:
gcvs_on_export_complete() {
zlxc relink
}
gcvs_on_update_complete() {
zlxc relink
}
When things got messy, you may need to handle them yourself:
- Check out your working branch, and make sure repository is clean by running
git status
. - Make nacessary changes if the previous failure is due to an invalid commit.
- Restart the failed operation.
- Check out your working branch, fix contents and execute
cvsup
manually. - Make sure no modification is made regarding to CVS (if there is any, revert it or commit them using CVS).
- Stage every change to Git repository, then execute
gcvs_git_commit_as_cvs_update
to commit.
MIT License.