Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Yanick (3196)

  (email not shown publicly)

Journal of Yanick (3196)

Monday December 29, 2008
01:32 PM

CPAN Patching with Git

[ #38180 ]

A few months ago, brian posted a blog entry about patching modules using Git. In the ensuing discussion, I pointed at a possible way to automatise the process a step further by punting the generated patch to The hack was well-received and, with (very) minimal coaxing, I was subsequently convinced to expand on the idea for the Perl Review.

The resulting piece is now available in TPR 5.1. In the article, the initial command-line hack has morphed into four scripts -- git-cpan-init, git-cpan-clone, git-cpan-update and git-cpan-sendpatch -- that pretty much take care of all the administrative overhead of module patching. In most cases, grabbing a distro, fixing a bug and sending the patch can be done in four lines:

    $ git cpan-init Some::Module
    $ git checkout -b mypatch
    ...hack hack hack...
    $ git rebase -i cpan
    $ git cpan-sendpatch

And, no, the lack of hyphen between git and cpan-X isn't a typo; the article also covers how to seamlessly integrate the new scripts into the git infrastructure (as Edna Mode would say, it's a non-feature, dahling).

Of course, I'm burning to say more, but I'll have to stop here. To know the whole story, you'll have to wait for The Perl Review to land in your mailbox (you are subscribed to TPR, right?).

cross-posted from Hacking Thy Fearful Symmetry.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I wrote a CPAN/BACKPAN -> git gateway a while back. The code is here:;a=blob;f=bin/git-cpan;hb=HEAD []

    I have been meaning to index the whole BACKPAN and host the generated YAML files publicly... but if you want to play with it right now, point the indexer at a minicpan or cpan mirror, and then say "git-cpan Foo::Bar". (The reason we need an index here is because Foo::Bar is not necessarily in a distribution called Foo-Bar, and the distribution name isn't necessarily the

    • Interesting. I've not been quite able to get it work, but it seems like a much more all-encompassing version of my quick hack. I'll have to keep my eye on it.

      Are you still actively developing that project, or is it more sitting on the back burner?