[petsc-dev] I hate this one

Jed Brown jedbrown at mcs.anl.gov
Mon Jan 21 19:17:24 CST 2013


On Mon, Jan 21, 2013 at 7:04 PM, Sean Farley
<sean.michael.farley at gmail.com>wrote:

> > Hg may have something similar, but git has "clean" and "smudge" filters
> that
> > can be used to keep the working tree somehow different from what is in
> the
> > repository. If someone wants to operate with a working tree that has
> > different formatting, they set filter-clean and filter-smudge commands.
> The
> > diffs they see will always be "clean", but the working tree can be
> smudged
> > to their desire.
>
> Yeah, but I'm sure you will agree that this is a tad bit dangerous
> (merge conflicts?).


An uncrustify filter should satisfy the condition that smudge followed by
clean produces the same thing as clean.

http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html#_merging_branches_with_differing_checkin_checkout_attributes

Of course I don't want to work this way, but if someone wants to have their
own formatting that much, I think this is the right level of abstraction.


> I would put this in the category of "feature of
> last resort." The equivalent way would be to use an extension, such as
> this one:
>
> http://www.fast-downward.org/ForDevelopers/Uncrustify


This is a quite different sort of thing, really meant for easily running
uncrustify on source files rather than maintaining a working tree that is
different from the repository.


>
>
> (don't know if it's still current) or to define your own filters for
> doing the "smudge"-ing. It would probably be the same rule and maybe
> even a one-liner in python but I haven't tried it yet.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130121/e4a1f9e4/attachment.html>


More information about the petsc-dev mailing list