Ruby Forum Rails-core (closed, excessive spam) > applying patches from trac

Posted by Frederick Cheung (Guest)
on 09.10.2007 14:23
(Received via mailing list)
I'm a little on the lazy side, so when checking out a patch the
process of going to the ticket, clicking on the link to a patch,
scrolling doing to the bottom to download the raw patch, locating and
applying the patch was just getting way too much effort (is there a
better way?)

So I wrote something to do it for me. Now I can do

Fs-Macbook:~/rails_trunk fred$ apply_ticket 9640

and it will find the patch(es) for that ticket, ask me which one I
want to apply if there are more than one and download & apply it for me

Anyway, if it's useful for anyone else I'd love to hear about it.


Fred

http://svn1.hosted-projects.com/fcheung/apply_ticket/
ApplyTicket-0.1.0.gem
http://svn1.hosted-projects.com/fcheung/apply_ticket/trunk
Posted by Mislav MarohniÄ? (mislav)
on 09.10.2007 14:30
(Received via mailing list)
On 10/9/07, Frederick Cheung <frederick.cheung@gmail.com> wrote:
>
>
> So I wrote something to do it for me. Now I can do
>
> Fs-Macbook:~/rails_trunk fred$ apply_ticket 9640


I did the same, but my solution is more featured - you can redirect 
stdin to
Trac and have, say, svn di uploaded as a patch to certain ticket. It can
also post tickets/comments to Trac. I wanted to share it, but court3nay, 
who
helped me in the first place, said it allows for easy Trac spamming so 
it's
maybe not a very good idea.
Posted by Mislav MarohniÄ? (mislav)
on 09.10.2007 14:31
(Received via mailing list)
On 10/9/07, Mislav Marohnić <mislav.marohnic@gmail.com> wrote:
>
> On 10/9/07, Frederick Cheung <frederick.cheung@gmail.com> wrote:
> >
> >
> > So I wrote something to do it for me. Now I can do
> >
> > Fs-Macbook:~/rails_trunk fred$ apply_ticket 9640
>
>
> I did the same, ...


Forgot that I wanted to say this:

+1 for maintaining this. It's very useful for anyone, especially core
members and patch reviewers.
Posted by Frederick Cheung (Guest)
on 09.10.2007 14:38
(Received via mailing list)
On 9 Oct 2007, at 13:31, Mislav Marohnić wrote:

>
> +1 for maintaining this. It's very useful for anyone, especially  
> core members and patch reviewers.

That was my intent. It was just getting in my way when I wanted to
check out a patch. I can see how automated uploads of patches could
be a bad thing (If anything uploading a patch requiring a few extra
clicks just gives you a few extra 'do I really want to do this'
moments. A pure read operation can only gain from being easy.

Fred
Posted by Mislav MarohniÄ? (mislav)
on 09.10.2007 14:45
(Received via mailing list)
On 10/9/07, Frederick Cheung <frederick.cheung@gmail.com> wrote:
>
>
> That was my intent. It was just getting in my way when I wanted to
> check out a patch. I can see how automated uploads of patches could
> be a bad thing (If anything uploading a patch requiring a few extra
> clicks just gives you a few extra 'do I really want to do this'
> moments. A pure read operation can only gain from being easy.


When I get home today, I will send you the code I'm using for uploading.
Usage example:

  svn di | ticket 1234 name-of-patch

The script outputs the URL for patch preview on Trac. I'm sure you'll 
find
it useful.