wiki:CommittersTipsAndTricks

Version 1 (modified by raimue (Rainer Müller), 16 years ago) (diff)

--

Tips and Tricks for committers

This page provides some useful hints how to work with our infrastructure. And they can also make your work a lot easier.

Set svn properties automatically on new Portfiles

In the configuration for your Subversion client, enable automatic property setting and, for all files named Portfile, setting "svn:eol-style" to "native" and "svn:keywords" to "Id". If you are not using Subversion's own svn command-line client, see its documentation. For svn, you can make the appropriate changes by editing ~/.subversion/config as follows:

...

[miscellany]
enable-auto-props

...

[auto-props]
Portfile = svn:eol-style=native;svn:keywords=Id

Apply patches directly from Trac URL

Add the following functions to your .bashrc in order to apply patches directly from Trac.

function trac-get {
    curl "$1?format=raw" -o $(basename $1)
}

function trac-patch {
    trac-get $1
    patch -p0 < $(basename $1)
}

Use like this:

  1. Copy the URL to the patch from the Trac ticket page
  2. Switch to the ports directory
    $ cd $(port dir foo)
    
  3. Apply the patch
    $ trac-patch http://trac.macosforge.org/projects/macports/attachment/ticket/.../Portfile.diff