git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Plaksin <happy@usg.edu>
To: git@vger.kernel.org
Subject: Re: Syntax check via update hook?
Date: Wed, 20 May 2009 11:13:09 -0400	[thread overview]
Message-ID: <ws7i0bu7sq.fsf@usg.edu> (raw)
In-Reply-To: wsd4abfonx.fsf@usg.edu

Mark Plaksin <happy@usg.edu> writes:

> Jeff King <peff@peff.net> writes:
>
>> On Tue, May 12, 2009 at 03:16:50PM -0400, Mark Plaksin wrote:
>>
>>> >         $ cat <<EOF >.git/hooks/update
>>> >         #!/bin/sh
>>> >         GIT_INDEX_FILE=/path/to/tempdir/index; export GIT_INDEX_FILE
>>> >         cd /path/to/tempdir/tree &&
>>> >         mkdir -p tree &&
>>> >         git read-tree "$3" &&
>>> >         git checkout-index &&
>>> >         your_syntax_check
>>> >         EOF
>>> >         $ chmod +x .git/hooks/update

...

> It does!  You make it seem so easy!  Thanks very much.  I now have an
> update hook which checks syntax just like we want.  Thanks again!

Well, it's oh so close!  If we make changes that don't pass the syntax
check and try to push them the hook rejects the changes.  If we then
make a change that will pass the syntax check, leave the others broken,
and push, 'git diff-tree' doesn't list the previously rejected files so
the hook accepts the push.  Is there any way to get 'git diff-tree' to
list all of the files?

Here's 'git diff-tree' output from our first push attempt:
139ca369a16151faedf78fd86941769ceff289e4
:100644 100644 bfc70383d8e5ab1adb83ce599eac6f4f9dd47f9c 931c8f3acb640606c950ee14b47c92f2b6ad5f51 M      modules/git/files/update_hook
:100644 100644 34cea12e7c32a61f1ad25955c7ee8434652a354a b27af409ca226f9acbd8e7b89ae7ed21785f1ab1 M      modules/git/manifests/init.pp
:100644 100644 598af464c5220f83a6d2342cecf7beace47dd136 033a8b4c897094db050590501c5accef1feb2abc M      modules/git/manifests/server.pp

And here's the output from the second push attempt:
eacdddf85e5d1180f5917a467edd5e0535a61321
:100644 100644 12418bd45df24a7d8cc8c43691c35a62888343e9 65f8137b0887bd734c6adc951eb45ea76a220775 M      modules/git/files/xinetd

Thanks again!

  reply	other threads:[~2009-05-20 15:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08 19:43 Syntax check via update hook? Mark Plaksin
2009-05-09 14:47 ` Jeff King
2009-05-12 19:16   ` Mark Plaksin
2009-05-14  6:55     ` Jeff King
2009-05-14 19:52       ` Mark Plaksin
2009-05-20 15:13         ` Mark Plaksin [this message]
2009-05-20 15:22           ` Jeff King
2009-05-20 20:57             ` Mark Plaksin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ws7i0bu7sq.fsf@usg.edu \
    --to=happy@usg.edu \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).