[Paraview-developers] Adding a check for local Git hooks

Brad King brad.king at kitware.com
Fri Jul 16 08:29:30 EDT 2010


Biddiscombe, John A. wrote:
> $ git merge-base --all jb kitware/master
> d101715e7258a115b8c00eddbd63f437b2d675b4
> $ git rev-parse kitware/master
> e1018fac025de3157a839c33f87ac7a7729a2b5b

This means that the set of upstream changes that you are trying
to merge into your local branch is "d101715e..e1018fac".  Indeed,
running

 $ git diff --name-only d101715e..e1018fac

shows basically the same list of files you see in "git status"
as modified and staged for commit.

However, I see many whitespace errors in those commits:

 $ git log --oneline --check d101715e..e1018fac

They appear in commits that were made by people that did *not*
have the local checks enabled.  When I first set up the vtk.org
repositories I had a server-side update hook to reject commits
that had whitespace errors.  This was deemed too restrictive by
other developers who did not want to rewrite their commits just
to fix whitespace, so the check was removed.  Had it been in
place you would not be seeing this error now.

Now we depend on local hooks to reject such errors.  It is much
easier to fix them before committing locally than to rewrite the
commit later.  Now that we require local hooks to be enabled new
commits should not come in with these errors.  Once we've settled
into using the local hooks I will probably re-enable the update
hook's whitespace check on the server to guarantee it.

You just need to get pas this one merge.  To do so, run

 $ git commit --no-verify

This tells Git to skip running the local hooks.  Don't abuse it
after this though ;)

-Brad


More information about the Paraview-developers mailing list