[petsc-dev] I hate this one
Sean Farley
sean.michael.farley at gmail.com
Mon Jan 21 19:20:59 CST 2013
On Mon, Jan 21, 2013 at 7:17 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 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.
Ah, ok, I wasn't paying that much attention. Then, I would stick to
wrapping this with a hook. My motivation for doing this is quite low,
so I don't really feel like testing it out.
More information about the petsc-dev
mailing list