This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [HOOK] Fix leading and trailing whitespace
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 5 Jun 2013 20:14:44 +0000
- Subject: Re: [HOOK] Fix leading and trailing whitespace
- References: <20130605213420 dot GA12601 at domone dot kolej dot mff dot cuni dot cz>
On Wed, 5 Jun 2013, Ondrej Bilka wrote:
> Hi,
>
> As I noticed problem of patches with trailing whitespaces I
> decided to use a pre commit hook to solve this problem once for all.
The glibc repository already has a hook to reject commits with bad
whitespace; we don't need another one. git has or had a standard hook
users can copy into place / chmod executable to have git warn if you are
locally committing a patch with bad whitespace; again, there's no need for
another version.
Hooks automatically modifying your source code seem a bad idea to me;
there may be cases (e.g. test inputs) where the trailing whitespace is
significant.
> As regenerated files need to remove these would it be possible to
> automaticaly run this script after generation?
This version looks like massive overkill for that. The makefile rules for
generated files with whitespace issues should just fix the whitespace
using a trivial sed command.
--
Joseph S. Myers
joseph@codesourcery.com