Subject: Re: [boost] [conversion] Enforcing tabs to spaces conversions and other git goodies.
From: Cox, Michael (mhcox_at_[hidden])
Date: 2013-11-28 15:19:51
On Thu, Nov 28, 2013 at 8:06 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
> On Thu, Nov 28, 2013 at 5:00 AM, Mateusz Loskot <mateusz_at_[hidden]> wrote:
> > On 28 November 2013 08:49, Cox, Michael <mhcox_at_[hidden]> wrote:
> > > In addition to re-normalizing the line endings, we could also start
> > > enforcing coding standards, e.g. tabs converted to spaces standard via
> > > gitconfig/gitattribute filters. Git allows you to define filters in your
> > > .git/config or ~/.gitconfig file and specifying their use in
> > > .gitattributes, e.g. in .gitconfig:
> > >
> > > # Convert tabs to 4 spaces (uses Linux expand/unexpand commands, so not
> > > cross-platform)
> > > [filter "tabspace"]
> > > smudge = unexpand --tabs=4 --first-only
> > > clean = expand --tabs=4 --initial
> > > [...]
> > ...automatically behind the scene? Scary!
> > IMHO, this belongs to commit hooks.
> > Qt's sanitize-commit may be a good example
> > https://qt.gitorious.org/qt/qtrepotools/source/b69da7d675774be14027808328eaf86086b6e09a:git-hooks
> Michael and Mateusz,
> Yes - sanitizing and commit hooks are important topics. But the way to
> handle them is to start a new thread so that they don't get lost in the
> line-ending bicycle shed discussion.
I agree hooks have to be used for the "golden" boostorg repositories
since folks may forget to configure their local/public repositories
with the appropriate hooks/filters, but if Boost goes fully
distributed like Linux, there may be a lot of integration repositories
a change flows through on it's way to boostorg and it's probably best
to get the code normalized as soon as possible.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk