Re: [PATCH v2 0/3] pre-push hook support
Aaron Schrab aa...@schrab.com writes: Main changes since the initial version: * The first patch converts the existing hook callers to use the new find_hook() function. * Information about what is to be pushed is now sent over a pipe rather than passed as command-line parameters. Aaron Schrab (3): hooks: Add function to check if a hook exists push: Add support for pre-push hooks Add sample pre-push hook script Getting much nicer. Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/3] pre-push hook support
Junio C Hamano gits...@pobox.com writes: Aaron Schrab aa...@schrab.com writes: Main changes since the initial version: * The first patch converts the existing hook callers to use the new find_hook() function. * Information about what is to be pushed is now sent over a pipe rather than passed as command-line parameters. Aaron Schrab (3): hooks: Add function to check if a hook exists push: Add support for pre-push hooks Add sample pre-push hook script Getting much nicer. Thanks. Hmph, t5571 seems to be flaky in that it sometimes fails but passes when run again. Something timing dependent is going on??? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/3] pre-push hook support
Junio C Hamano gits...@pobox.com writes: Junio C Hamano gits...@pobox.com writes: Aaron Schrab aa...@schrab.com writes: Main changes since the initial version: * The first patch converts the existing hook callers to use the new find_hook() function. * Information about what is to be pushed is now sent over a pipe rather than passed as command-line parameters. Aaron Schrab (3): hooks: Add function to check if a hook exists push: Add support for pre-push hooks Add sample pre-push hook script Getting much nicer. Thanks. Hmph, t5571 seems to be flaky in that it sometimes fails but passes when run again. Something timing dependent is going on??? With this patch applied, repeatedly try to - make sure foreign ref does not exist; and - attempt pushing the HEAD:foreign to create the foreign ref until it fails, I can get it stop before the output scrolls off of my 114 line terminal. Then when I revert the changes to transport.[ch] and builtin/push.c in this series, the test will keep going. Wait. The sample hook used in the test _is_ fed some input but it exits without reading any. What happens when we fork it, and it completes execution before we even have a chance to feed a single byte? Wont' we get a sigpipe and die? Yup, I think that is what is missing from run_pre_push_hook() implementation. diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh index d68fed7..050318b 100755 --- a/t/t5571-pre-push-hook.sh +++ b/t/t5571-pre-push-hook.sh @@ -16,8 +16,15 @@ test_expect_success 'setup' ' git init --bare repo1 git remote add parent1 repo1 test_commit one - git push parent1 HEAD:foreign + while : + do + git push parent1 :refs/heads/foreign + git push parent1 HEAD:foreign || break + done ' + +exit + write_script $HOOK EOF exit 1 EOF -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/3] pre-push hook support
Main changes since the initial version: * The first patch converts the existing hook callers to use the new find_hook() function. * Information about what is to be pushed is now sent over a pipe rather than passed as command-line parameters. Aaron Schrab (3): hooks: Add function to check if a hook exists push: Add support for pre-push hooks Add sample pre-push hook script Documentation/githooks.txt | 29 + builtin/commit.c | 6 +- builtin/push.c | 1 + builtin/receive-pack.c | 25 run-command.c| 15 - run-command.h| 1 + t/t5571-pre-push-hook.sh | 129 +++ templates/hooks--pre-push.sample | 53 transport.c | 60 ++ transport.h | 1 + 10 files changed, 300 insertions(+), 20 deletions(-) create mode 100755 t/t5571-pre-push-hook.sh create mode 100644 templates/hooks--pre-push.sample -- 1.8.1.340.g425b78d -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html