[pm-h] Git patching

Todd Rinaldo toddr at null.net
Wed Oct 15 23:08:26 PDT 2008


In light of last night's git talk (Thanks again Robert!),

I thought I'd pass on Brian D Foy's Topical journal article on the
subject. But... Who is Bob?

http://use.perl.org/~brian_d_foy/journal/37664

In the olden days, to make a patch to a module, you had to have the
original, untouched file and a copy that you modified. You'd then use
diff to compare the two files.

At the Pittsburgh Perl Workshop, Ricardo was asking how to do some odd
thing in git. Instead of anyone answering his question, everyone asked
what he was doing. It turns out he was patching someone's module and
making it a git repo while he worked. The process is really handy:

   1. Download module distribution and unpack it
   2. Make it a git archive with git init
   3. Add the initial content to the index with git add .
   4. Commit the initial content with git commit -m "* Version 1.23 from CPAN"
   5. work, work, work
   6. Generate your patch with git format-patch --stdout -1
   7. And Bob's your uncle

There are other ways that you can do this, and you can change around
the process in git. I like that git is lightweight enough to make it
actually useful for everyday work


More information about the Houston mailing list