Patches para Google

Una de los últimos flecos por cerrar para finiquitar el Google Summer of Code es enviar el código a Google.

Yo no tengo problema, pues he trabajado en un repositorio de subversion para mi solo, pero en el caso de haber compartido el repositorio habría que enviar sólo nuestros patches.

Mark es una de las personas que se ven en esta situación, y como él está más agobiado que yo, le he echado una mano con esta tarea.

Para ello, que mejor que un script de bash. Se encarga de obtener todos los commits hechos por un usuario, y crear los patches correspondientes.

svn log | grep penyaskito | awk '/r[0-9]/ {print $1}' | tr -d 'r' > file
cat file |   # Supply input from a file
while read rev # As long as there is another line to read ...
do
        echo "svn diff -r $rev:$(($rev - 1)) > patches/$rev.patch"
        svn diff -r $rev:$(($rev - 1)) > patches/$rev.patch
done

3 Responses

  1. You rock!

    Thanks dude. :’-)

    Regards,

    Mark

  2. Hi,

    the complete first part:

    svn log | grep penyaskito | awk ‘/r[0-9]/ {print $1}’ | tr -d ‘r’ > file

    cat file| [ snip ]

    could be replaced with

    svn log | awk ‘$3 == “penyaskito” {sub( “r”, “”, $1); print $1}’

    so you don’t need a file or three tools for the job.

    ( and then you could either iterate over the revisions with a ‘for rev in `command`’ loop, or through ‘|xargs’ )

    hopefully this doesn’t make me sound like too much of an ass and someone considers this helpful instead😉

    — Elias

  3. Thanks Elias!
    I’ll try the changes you suggested.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: