savannah-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [savannah-help-public] help about pre-commits, and pre-push scripts


From: Bob Proulx
Subject: Re: [savannah-help-public] help about pre-commits, and pre-push scripts using git
Date: Sat, 4 May 2019 19:50:07 -0600
User-agent: Mutt/1.10.1 (2018-07-13)

address@hidden wrote:
> Does Anyone know if there are any GNU scripts for checking code sanity
> as Git hooks?
> I'm thinking about scripts for following the official coding style
> guidelines. (C, C++, PHP, python...)

The "standard" git hook that I enable for my own projects is the one
that comes with git that says:

  # This is slightly modified from Andrew Morton's Perfect Patch.
  # Lines you introduce should not have trailing whitespace.
  # Also check for an indentation that has SP before a TAB.

That's fairly generic but enforces the basic rules that most projects
benefit from having.  Prevents a lot of noisy whitespace errors from
creeping into the change history.  Not enabled by default.

I am not aware of any git hooks that people are currently using for
checking code sanity as you describe.  I am sure they do exist
however.

I recall seeing checks added at build time (for example my-distcheck
targets as dependencies) that run checks at build time for various
project specific items.  Presumably one will run distcheck targets
before commiting and will be notified of problems found then.
(However in git if someone has already committed locally then they can
still rebase and fix their local working copy before pushing and
publishing it.)

No hooks are enabled on Savannah git repositories by default.  If you
want one enabled then you have to ask for it to be enabled.  The
admins are happy to work with you on getting custom hooks set up.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]