[petsc-dev] Style Guide: How to format single-line if/for/while-blocks?

Karl Rupp rupp at mcs.anl.gov
Mon Jan 21 22:45:41 CST 2013


Hi Jed,

> This has a nice picture of the way clean clean and smudge filters work.
>
> http://git-scm.com/book/ch7-2.html#Keyword-Expansion
>
> The idea is that you tell git to use your filter in a place that is not
> checked into the repository:
>
> echo '*.c filter=petscfmt' >> .git/info/attributes
>
> (If you wanted it to be checked in, you'd put it in .gitattributes, but
> we don't want that now.) Then set what the petscfmt filter does
>
> git config filter.petscfmt.clean 'uncrustify read from stdin and write
> clean version to stdout'
> git config filter.petscfmt.smudge 'uncrustify read from stdin and write
> smudged version to stdout'
>
> The smudged version is whatever the user wants to interact with, the
> cleaned version is whatever should go in the PETSc repository. (You can
> also just edit these filters in .git/config.)

Perfect, this will actually work with any source code transformation 
tool. :-)

Best regards,
Karli





More information about the petsc-dev mailing list