git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Syntax check via update hook?

From
Mark Plaksin <happy@usg.edu>
Date
May 8, 2009, 19:43 UTC
Message-ID
<wsprejtm71.fsf@usg.edu>
Howdy:
What's the best way to make the update hook do a syntax check?

We want to switch our Puppet [1] config repository from SVN to Git. Our SVN repository has a pre-commit hook that does a syntax check. The hook runs Puppet to check the syntax of the file(s) being committed and if the check fails, the commit fails. With SVN that hook runs on the server so it's easy to have (the correct version of) the puppet binary there for the hook to use.

Once Puppet config changes are committed to to our SVN repository they are automatically pushed into our production Puppet config. We want to do something similar with Git--once commits are successfully pushed to the master repository they are automatically pulled and become our production Puppet config.

Git's pre-commit hook runs wherever a person happens to have checked out the Git repository. That could be a desktop, laptop...just about anywhere. It's harder to make sure the correct version of Puppet is in all of those places. So we'd love for the syntax check to run on the server. But we can't figure it out.

Thanks for any assistance!
Footnotes: 
[1]  http://reductivelabs.com/products/puppet/
Next: Jeff King
Message 1 of 8 in “Syntax check via update hook?”
  1. Mark PlaksinMay 8, 2009
  2. Jeff KingMay 9, 2009
  3. Mark PlaksinMay 12, 2009
  4. Jeff KingMay 14, 2009
  5. Mark PlaksinMay 14, 2009
  6. Mark PlaksinMay 20, 2009
  7. Jeff KingMay 20, 2009
  8. Mark PlaksinMay 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.