CPAN to git helper

barbie on 2009-04-06T15:12:21

As I have a lot of CPAN distributions I want to port to git, I decided to try and make things a little easier (and fun) along the way. As I don't have a previous VCS repo for my distributions (I once did, but it died a long time ago), I currently rely on snapshots and backing up the current workspace. The snapshots happen to be the tarballs I upload to CPAN, and are kept in the current workspace so they get backed up too.

This made for writing a simple tool to firstly create a new git repo, unwrap each snapshots in turn, importing the contents and removing obsolete files, then doing the same for the current workspace. I did think about adding some code to login to Github, create the new project and then push the master and tags to Github, but I think that might be going a bit too far for the moment.

Any road up, if you have a similar setup, and want to port your CPAN distributions to a git repo that can be moved to Github, my little script might go a long way to getting you off the ground. The usual disclaimers about me not being responsible for breaking your code apply :)


git-backpan-init

Yanick on 2009-04-06T15:41:00

Unless I'm mistaken, the git-backpan-init utility of Git::CPAN::Patch might be able to help you do that too.

Re:git-backpan-init

barbie on 2009-04-06T19:16:12

Not quite. Mine adds the Github entries and also removes files that have since been made obsolete or moved.

Re:git-backpan-init

rjbs on 2009-04-07T15:31:28

I'm not sure what you've seen that program not do. I thought it would have each revision stored correctly, with each one only showing files that were in each versioned dist.

I *think* it was inspired by my older program (but I could be wrong!) described here: http://rjbs.manxome.org/rubric/entry/1720

Anyway, I hope we can all steal something from each other in the future!

Re:git-backpan-init

Yanick on 2009-04-07T22:45:00

Yup, it was inspired by your script all right. :-)

And I guess that while we're talking importing stuff to Github, we should probably also mention brian d foy's github_creator, for completeness' sake.