> I'm using subversion since no much time and I think it's
> great, much more than cvs.
> I would like to ask one question. I want all the source .c
> files in my repository to be well pretty-printed, all
> conforming a common C programming style. But the problem is
> that the programmers don't do the job well, they forget to
> follow the rules and so...
> The ideal think could be at the pre-commit hook execute the
> pretty printer for all the .c source files so that in the
> repository the files all are well stored. Also it would be
> desirable to check C syntax so all files that are in the
> repository complile all. But I've seen the comments on the
> pre-commit template hook and explicitly reports that the
> script must not change the transaction. So is there a way to
> transform (pretty-print) the source files before committing them?
> If this is not possible, it will be very nice to add it as a
> new feature :D,
NOTE: I mistakenly sent this message directly to the original poster
earlier this morning; I didn't check the reply-to field before sending. I
wanted to add it to the discussion.
I agree with others here that version control software should NOT be
responsible for such tasks. I've always seen pretty-printing done as part
of the build. Your cycle should go something like this (simplified):
3. Build (with automatic pretty-printing)
4. If build succeeds, then test
5. If test succeeds, then commit
6. Cycle back to #2 for each feature to add/change
Your tests (whatever they comprise) give you confidence that your changes,
even after pretty-printing, work as you expect.
There are many tools that can do the pretty-printing, as I'm sure you
already know. You should be able to run them against your code in your
build script, be it make or something else. Since everyone MUST run the
build script to verify that changes are worthy of committing,
pretty-printing happens automatically. If you still have problems with code
not conforming to your organization's coding standards, you have a personnel
problem, not a technical one.
Fisher Scientific International Inc.
(formerly Apogent Technologies Inc.)
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Aug 19 17:51:28 2004