develooper Front page | perl.perl5.porters | Postings from January 2009

applying patches and upstream

Thread Next
From:
Nicholas Clark
Date:
January 13, 2009 11:15
Subject:
applying patches and upstream
Message ID:
20090113191441.GX2919@plum.flirble.org
Oops, I seem to have deleted the relevant messages I would need to reply to.

I see that Rafael tweaked Porting/Maintainers.pm so that

    perl Porting/Maintainers --opened

would list the files that git sees as modified. I've tweaked it so that if
there are no files modified, it does something useful:

    $ perl Porting/Maintainers --opened
    (No files are modified)
    $

rather than happening to show you the usage message. (A bug, but not showing
you anything would have been less than useful)

I've also tweaked it so that the upstream status shows in the file base
listing too. So

    $ perl Porting/Maintainers --opened
    (No files are modified)
    $ echo >> lib/CPAN.pm
    $ perl Porting/Maintainers --opened
    lib/CPAN.pm     [CPAN   ] CPAN andk Andreas J. Koenig <andk@cpan.org>
    $


So here we can see that our potential change to lib/CPAN.pm shouldn't really
be committed - instead we should send the patch upstream to Andreas. Other
output might be:

    $ perl Porting/Maintainers --opened
    lib/Shell.pm    [unknown] Shell ferreira Adriano Ferreira <ferreira@cpan.org>
    lib/Switch.pm   [blead  ] Switch rgarcia Rafael Garcia-Suarez <rgarcia@cpan.org>


ie Rafael says "commit it to blead, please", whilst we don't know what Adriano
wants yet.

As ever, if a file is not part of anything dual life we get a question mark:

    $ perl Porting/Maintainers Porting/Maintainers.pm
    Porting/Maintainers.pm ?
    $


However, git am doesn't seem to play nicely with the above ideas, as it makes
a local commit straight off. (On the assumption that if it breaks tests, you
can revert or amend the commit locally, before pushing).

So I added a feature. If there is a single command line argument, and it looks
like a commit, show the status for all the files modified by that. So:

    $ perl Porting/Maintainers HEAD
    Porting/Maintainers.pm ?
    $

because that was the last thing I committed. Not that useful here, but very
interesting after git am. Should the patch be unwound, and forwarded onwards?

To demonstrate that it works for a more interesting commit:

    $ perl Porting/Maintainers HEAD~7
    win32/Makefile  [unknown] win32 jand Jan Dubois <jand@activestate.com>
    win32/makefile.mk [unknown] win32 jand Jan Dubois <jand@activestate.com>
    $


So, hopefully now, it's really easy and fast (hence suitably lazy and
impatient) to figure out what the best thing to do with a patch is.


Um, should this get added to pod/perlrepository.pod? Anyone want to convert it
to pod and make a patch?

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About