{"thread":{"id":"24266","subject":"global hooks - once again","startedAt":"2010-07-02T16:23:42Z","lastAt":"2010-07-06T15:32:35Z","messageCount":14,"participants":["Eugene Sajine","Jonathan Nieder","Junio C Hamano","Peter Kjellerstedt","Alex Riesen","demerphq"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"144695","messageId":"AANLkTikXJS5QCXMXgsOfkYn9cMBQV6o23tds5YG3A_OI@mail.gmail.com","threadId":"24266","inReplyTo":null,"subject":"global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-02T16:23:42Z","receivedAt":"2010-07-02T16:23:42Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"I have found a thread dated March 2008 about the subject, but there\nwas no acceptable solution provided.\nTemplate directory doesn't seem to be interesting.\n\nIs there a better way now?\n\nIf there is no better way now Is it possible to create a git config\nproperty specifying where the global hooks folder is and then look for\nhooks there first and then in the repo or vice versa?\n\nFor example, so i could say\n$ git config --global hooks.dir ~/git/hooks\n\nIt could even attempt to create the specified folder and create\nnecessary structure in it like below if necesary\n/pre-commit\n/post-commit\n/pre-rebase\n/post-rebase\n\netc...\n\nThanks,\nEugene\n"},{"id":"144698","messageId":"20100702180355.GA1770@burratino","threadId":"24266","inReplyTo":"AANLkTikXJS5QCXMXgsOfkYn9cMBQV6o23tds5YG3A_OI@mail.gmail.com","subject":"Re: global hooks - once again","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-02T18:03:55Z","receivedAt":"2010-07-02T18:03:55Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eugene Sajine wrote:\n\n> I have found a thread dated March 2008 about the subject, but there\n> was no acceptable solution provided.\n\nLink?\n\n> If there is no better way now Is it possible to create a git config\n> property specifying where the global hooks folder is and then look for\n> hooks there first and then in the repo or vice versa?\n\nWell, I like the idea[1].  The design issues are not very complicated;\nthe main thing is to implement it.\n\n $ git grep -l -F -e 'hooks/' -- \\*.c \\*.sh \\*.perl | egrep -v '^(contrib/(examples|hooks))|t/'\n builtin/commit.c\n builtin/init-db.c\n builtin/receive-pack.c\n git-am.sh\n git-cvsserver.perl\n git-rebase--interactive.sh\n git-rebase.sh\n run-command.c\n\nHope that helps,\nJonathan\n\n[1] e.g., for http://bugs.debian.org/514651\n"},{"id":"144704","messageId":"7v630x1yl8.fsf@alter.siamese.dyndns.org","threadId":"24266","inReplyTo":"AANLkTikXJS5QCXMXgsOfkYn9cMBQV6o23tds5YG3A_OI@mail.gmail.com","subject":"Re: global hooks - once again","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-02T19:18:59Z","receivedAt":"2010-07-02T19:18:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eugene Sajine <euguess@gmail.com> writes:\n\n> For example, so i could say\n> $ git config --global hooks.dir ~/git/hooks\n\nI don't think \"global\" hooks are useful for people who work on more than\none project, or people who interact in more than one ways to projects.\nDifferent projects typically have different needs out of the hooks\n(e.g. pre-commit policy), and different workflows typically call for\ndifferent needs out of the hooks (e.g. I would want to be able to rebase\nin my private working repository but not in the repository I use for\nintegration of other people's branches).\n\nSo I am fairly negative on your particular example above.\n\nBut it is understandable for one to use more than one repository for the\nsame project and use them in the same way; in such a case, I agree that a\nway to ensure that these repositories use the same set of hooks (and\nnon-hooks, e.g. commit templates, local ignore pattern files, etc.) is\ndesirable.\n\nSo I would imagine that your example without \"--global\" would be a\nreasonable thing to do once per repository.\n\nNow, as long as the \"do once per repository\" action that you need to do is\nsimple enough, it doesn't necessarily have to be \"git config\".  Perhaps\n\n    [alias]\n    set-hooks = !\"sh -c 'rm -fr .git/hooks && ln -s $1 .git/hooks' -\"\n\ncould also be a simple single-command solution that is \"do once per\nrepository\".\n\nCan't we do better and make this \"do nunce per repository\" instead?\n\nYou first have to think how you are creating these more-than-one\nrepositories you would want to make sure they use the same hooks.  For\nexample, do you have a single \"upstream\" repository and everything is a\nclone of it?  If so, perhaps a way to tell \"clone\" via $HOME/.gitconfig\nthat when cloning from a particular URL you would want to run a particular\npost-clone script might be a better way.\n"},{"id":"144713","messageId":"AANLkTikbRkkEb3UE0q47gqFH1cHvFScIjLSXhXOq_G82@mail.gmail.com","threadId":"24266","inReplyTo":"20100702180355.GA1770@burratino","subject":"Re: global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-02T19:30:36Z","receivedAt":"2010-07-02T19:30:36Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Fri, Jul 2, 2010 at 2:03 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Eugene Sajine wrote:\n>\n>> I have found a thread dated March 2008 about the subject, but there\n>> was no acceptable solution provided.\n>\n> Link?\n\nhttp://search.gmane.org/?query=global+hooks&group=gmane.comp.version-control.git\n\nThanks,\nEugene\n"},{"id":"144715","messageId":"AANLkTikMEDUI7d5Mzwm8r43zCYTqefyI06PHOMvT1iLz@mail.gmail.com","threadId":"24266","inReplyTo":"7v630x1yl8.fsf@alter.siamese.dyndns.org","subject":"Re: global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-02T19:47:48Z","receivedAt":"2010-07-02T19:47:48Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Fri, Jul 2, 2010 at 3:18 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Eugene Sajine <euguess@gmail.com> writes:\n>\n>> For example, so i could say\n>> $ git config --global hooks.dir ~/git/hooks\n>\n> I don't think \"global\" hooks are useful for people who work on more than\n> one project, or people who interact in more than one ways to projects.\n> Different projects typically have different needs out of the hooks\n> (e.g. pre-commit policy), and different workflows typically call for\n> different needs out of the hooks (e.g. I would want to be able to rebase\n> in my private working repository but not in the repository I use for\n> integration of other people's branches).\n>\n> So I am fairly negative on your particular example above.\n\n\nWell, you forgot about another half of users that are working with\nmany projects but using one policy for example in one company, or if\nthe guy works with several projects, but wants some of his custom\nhooks to be applied for all his repos/projects, for example if he want\nsome general actions to be executed before commit, like spell check of\nthe commit message. If I have 40 repos --global approach is the way to\ngo.\nIn addition, i don't think there is a downside in this particular\nexample as it is not a mandatory property that I propose. If you need\na global hook there should be an easy way to work with it. If you\ndon't need it - just don't touch anything and work on per repo basis.\n\n>\n> But it is understandable for one to use more than one repository for the\n> same project and use them in the same way; in such a case, I agree that a\n> way to ensure that these repositories use the same set of hooks (and\n> non-hooks, e.g. commit templates, local ignore pattern files, etc.) is\n> desirable.\n>\n> So I would imagine that your example without \"--global\" would be a\n> reasonable thing to do once per repository.\n\nonce again it is only a part of use cases. there might be several\nrepos/projects for one user. --global is necessary option\nI'm talking about user level hooks. He has no admin access to\n/usr/local/ and too many repos to deal with each one of them and set\nup hooks per repo.\n\n\n>   [alias]\n>   set-hooks = !\"sh -c 'rm -fr .git/hooks && ln -s $1 .git/hooks' -\"\n\nThis is good one, but not enough. Not that it is too difficult to\nexecute it 40 times, but just the fact that in order to understand how\nto do that i had to write to git list;) Having it in git config makes\nit straight forward for end user and much user \"friendlier\"\n\nThanks,\nEugene\n"},{"id":"144718","messageId":"20100702205348.GA8134@burratino","threadId":"24266","inReplyTo":"7v630x1yl8.fsf@alter.siamese.dyndns.org","subject":"Re: global hooks - once again","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-02T20:53:49Z","receivedAt":"2010-07-02T20:53:49Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Now, as long as the \"do once per repository\" action that you need to do is\n> simple enough, it doesn't necessarily have to be \"git config\".  Perhaps\n> \n>     [alias]\n>     set-hooks = !\"sh -c 'rm -fr .git/hooks && ln -s $1 .git/hooks' -\"\n\nIt is not difficult to set up hook scripts when initializing a\nrepository.  In fact git clone --template= and the “[init]\ntemplatedir” configuration work pretty well.  What is more difficult\nis to change the list of hook scripts later.\n\nIf I symlink the entire hooks dir like you describe, I cannot override\na couple of hooks per-repository without teaching the hook scripts to\nhandle that themselves.  (something like:\n\n\thook=$(basename \"$0\")\n\t! test -e \"$GIT_DIR/local-hooks/$hook.disable\" || exit 0\n\t! test -e \"$GIT_DIR/local-hooks/$hook\" ||\n\t\texec \"$GIT_DIR/local-hooks/$hook\"\n\n)  Maybe that is the simplest solution.\n"},{"id":"144808","messageId":"A612847CFE53224C91B23E3A5B48BAC744940F6E57@xmail3.se.axis.com","threadId":"24266","inReplyTo":"AANLkTikMEDUI7d5Mzwm8r43zCYTqefyI06PHOMvT1iLz@mail.gmail.com","subject":"RE: global hooks - once again","fromName":"Peter Kjellerstedt","fromEmail":"peter.kjellerstedt@axis.com","sentAt":"2010-07-05T10:03:40Z","receivedAt":"2010-07-05T10:03:40Z","isPatch":false,"sender":{"key":"peter.kjellerstedt@axis.com","avatar":"https://gravatar.com/avatar/6d5a0182283c8eccd7b134a54dbfd5f30038f3ad4d38b96f424884b614a61ca2?d=mp&s=160"},"body":"> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n> Behalf Of Eugene Sajine\n> Sent: den 2 juli 2010 21:48\n> To: Junio C Hamano\n> Cc: git@vger.kernel.org\n> Subject: Re: global hooks - once again\n> \n> On Fri, Jul 2, 2010 at 3:18 PM, Junio C Hamano <gitster@pobox.com>\n> wrote:\n> > Eugene Sajine <euguess@gmail.com> writes:\n> >\n> >> For example, so i could say\n> >> $ git config --global hooks.dir ~/git/hooks\n> >\n> > I don't think \"global\" hooks are useful for people who work on \n> > more than one project, or people who interact in more than one \n> > ways to projects.\n> > Different projects typically have different needs out of the hooks\n> > (e.g. pre-commit policy), and different workflows typically call \n> > for different needs out of the hooks (e.g. I would want to be able \n> > to rebase in my private working repository but not in the repository \n> > I use for integration of other people's branches).\n> >\n> > So I am fairly negative on your particular example above.\n> \n> Well, you forgot about another half of users that are working with\n> many projects but using one policy for example in one company, or if\n> the guy works with several projects, but wants some of his custom\n> hooks to be applied for all his repos/projects, for example if he want\n> some general actions to be executed before commit, like spell check of\n> the commit message. If I have 40 repos --global approach is the way to\n> go.\n\nWell, I belong to this secondary category, working for a company \nwhich is about to switch to git. Once the transition is completed,\nwe will have more than 800 git repositories, and they should all \nhave a basic set of hooks (e.g., commit message validation, \npermissions checking, mail sending). Making our 100+ developers \nmanually set up the hooks for each repository they clone is not an \noption.\n\nSo what I have done is setup a template directory with hooks being\na link to a pre-installed directory, where each hook is linked to a \nsingle script. This script then reads from a directory called \nhooks.d which is a drop directory for hooks. Each hook then has the\nformat '<hook>.<order>.<name>' (e.g., 'post-receive.10.send_mail'),\nsomewhat similar to /etc/rcX.d. It will also look in a .githooks.d\ndirectory in the working directory (this can be disabled with a\nconfig option). This is used by repository owners who want to add\nextra hooks for their repositories, e.g., to add automatic code \nindentation before commit, or unit testing. It is also possible \nto specify more hook directories with a multi-value config option, \nwhich the user can use if he/she likes to add some personal hooks.\nAll hooks found in all drop directories are sorted by order before \nbeing executed so that it is possible to add local hooks before or\nafter the global ones.\n\nThis way it is possible to have system level hooks, repository\nspecific hooks and user specific hooks all work together. And even \nthough I now have a system which works for us, having something like\nthis in the git core would be more efficient, and benefit more users.\n\nHere is what my solution explained above would look like if it was \nadded to the git core.\n\n* The .git/hooks directory is replaced by .git/hooks.d (any hooks\n  found in .git/hooks could be assumed to have an order of 50 for\n  backwards compatibility).\n* If core.repositoryHooks (better name?) is true (default to false) \n  then .githooks.d in the working directory is searched for hooks.\n* It is possible to specify more hook directories using the \n  multi-value core.hookDirectory option (directories are relative to \n  the .git directory; absolute directories are of course also allowed).\n\n//Peter\n\n"},{"id":"144898","messageId":"AANLkTimSvwo50Q9jsbKkzvplSPE82fNJJDSFmZVw3r5o@mail.gmail.com","threadId":"24266","inReplyTo":"A612847CFE53224C91B23E3A5B48BAC744940F6E57@xmail3.se.axis.com","subject":"Re: global hooks - once again","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-07-06T12:14:20Z","receivedAt":"2010-07-06T12:14:20Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Mon, Jul 5, 2010 at 12:03, Peter Kjellerstedt\n<peter.kjellerstedt@axis.com> wrote:\n> So what I have done is setup a template directory with hooks being\n> a link to a pre-installed directory, where each hook is linked to a\n> single script. This script then reads from a directory called\n> hooks.d which is a drop directory for hooks. Each hook then has the\n> format '<hook>.<order>.<name>' (e.g., 'post-receive.10.send_mail'),\n> somewhat similar to /etc/rcX.d. It will also look in a .githooks.d\n> directory in the working directory (this can be disabled with a\n> config option). This is used by repository owners who want to add\n> extra hooks for their repositories, e.g., to add automatic code\n> indentation before commit, or unit testing. It is also possible\n> to specify more hook directories with a multi-value config option,\n> which the user can use if he/she likes to add some personal hooks.\n\nHow do your users disable execution of global hooks in this scheme?\n(to protect themselves from an evil system administrator)\n"},{"id":"144899","messageId":"AANLkTilb3ah6UNuTeUNjpP39YPwzERJ0Jsvil0YMKXaZ@mail.gmail.com","threadId":"24266","inReplyTo":"A612847CFE53224C91B23E3A5B48BAC744940F6E57@xmail3.se.axis.com","subject":"Re: global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-06T12:20:05Z","receivedAt":"2010-07-06T12:20:05Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"> Well, I belong to this secondary category, working for a company\n> which is about to switch to git. Once the transition is completed,\n> we will have more than 800 git repositories, and they should all\n> have a basic set of hooks (e.g., commit message validation,\n> permissions checking, mail sending). Making our 100+ developers\n> manually set up the hooks for each repository they clone is not an\n> option.\n>\n> So what I have done is setup a template directory with hooks being\n> a link to a pre-installed directory, where each hook is linked to a\n> single script. This script then reads from a directory called\n> hooks.d which is a drop directory for hooks. Each hook then has the\n> format '<hook>.<order>.<name>' (e.g., 'post-receive.10.send_mail'),\n> somewhat similar to /etc/rcX.d. It will also look in a .githooks.d\n> directory in the working directory (this can be disabled with a\n> config option). This is used by repository owners who want to add\n> extra hooks for their repositories, e.g., to add automatic code\n> indentation before commit, or unit testing. It is also possible\n> to specify more hook directories with a multi-value config option,\n> which the user can use if he/she likes to add some personal hooks.\n> All hooks found in all drop directories are sorted by order before\n> being executed so that it is possible to add local hooks before or\n> after the global ones.\n>\n> This way it is possible to have system level hooks, repository\n> specific hooks and user specific hooks all work together. And even\n> though I now have a system which works for us, having something like\n> this in the git core would be more efficient, and benefit more users.\n>\n> Here is what my solution explained above would look like if it was\n> added to the git core.\n>\n> * The .git/hooks directory is replaced by .git/hooks.d (any hooks\n>  found in .git/hooks could be assumed to have an order of 50 for\n>  backwards compatibility).\n> * If core.repositoryHooks (better name?) is true (default to false)\n>  then .githooks.d in the working directory is searched for hooks.\n> * It is possible to specify more hook directories using the\n>  multi-value core.hookDirectory option (directories are relative to\n>  the .git directory; absolute directories are of course also allowed).\n>\n> //Peter\n>\n>\n\nTo me this is another confirmation that not only --global but also\n--system level config variable specifying hooks folder is necessary.\nI mean company wide hooks (system) are combined with users global and\nrepo specific ones. Seems to be obvious.\n\nThanks,\nEugene\n"},{"id":"144900","messageId":"AANLkTilZcuYxb6ASgJq82JVdgcRcuak5PvYXZF6fcojm@mail.gmail.com","threadId":"24266","inReplyTo":"AANLkTimSvwo50Q9jsbKkzvplSPE82fNJJDSFmZVw3r5o@mail.gmail.com","subject":"Re: global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-06T12:23:02Z","receivedAt":"2010-07-06T12:23:02Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":">\n> How do your users disable execution of global hooks in this scheme?\n> (to protect themselves from an evil system administrator)\n>\nIn a corporate environment it is not the case, i believe. If sysadmin\nmade a mistake a with hooks, he will have to fix it, but there is no\npoint in overriding on user level as hooks in this case will be\nsomething about company policy, aren't they?\n\nThanks,\nEugene\n"},{"id":"144908","messageId":"AANLkTilP1tyHxdirhW08FZ-bzSxSCO-rH26uPBqIV2l2@mail.gmail.com","threadId":"24266","inReplyTo":"AANLkTikMEDUI7d5Mzwm8r43zCYTqefyI06PHOMvT1iLz@mail.gmail.com","subject":"Re: global hooks - once again","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2010-07-06T14:34:27Z","receivedAt":"2010-07-06T14:34:27Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 2 July 2010 21:47, Eugene Sajine <euguess@gmail.com> wrote:\n> On Fri, Jul 2, 2010 at 3:18 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Eugene Sajine <euguess@gmail.com> writes:\n>>\n>>> For example, so i could say\n>>> $ git config --global hooks.dir ~/git/hooks\n>>\n>> I don't think \"global\" hooks are useful for people who work on more than\n>> one project, or people who interact in more than one ways to projects.\n>> Different projects typically have different needs out of the hooks\n>> (e.g. pre-commit policy), and different workflows typically call for\n>> different needs out of the hooks (e.g. I would want to be able to rebase\n>> in my private working repository but not in the repository I use for\n>> integration of other people's branches).\n>>\n>> So I am fairly negative on your particular example above.\n>\n>\n> Well, you forgot about another half of users that are working with\n> many projects but using one policy for example in one company,\n\n$work is like this. Any repo on our version control host will share a\ncommon set of hooks.\n\nyves\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"144912","messageId":"A612847CFE53224C91B23E3A5B48BAC744940F7000@xmail3.se.axis.com","threadId":"24266","inReplyTo":"AANLkTilZcuYxb6ASgJq82JVdgcRcuak5PvYXZF6fcojm@mail.gmail.com","subject":"RE: global hooks - once again","fromName":"Peter Kjellerstedt","fromEmail":"peter.kjellerstedt@axis.com","sentAt":"2010-07-06T14:55:57Z","receivedAt":"2010-07-06T14:55:57Z","isPatch":false,"sender":{"key":"peter.kjellerstedt@axis.com","avatar":"https://gravatar.com/avatar/6d5a0182283c8eccd7b134a54dbfd5f30038f3ad4d38b96f424884b614a61ca2?d=mp&s=160"},"body":"> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n> Behalf Of Eugene Sajine\n> Sent: den 6 juli 2010 14:23\n> To: Alex Riesen\n> Cc: git@vger.kernel.org\n> Subject: Re: global hooks - once again\n> \n> > How do your users disable execution of global hooks in this scheme?\n> > (to protect themselves from an evil system administrator)\n\nYeah, I missed that case. What I have is another configuration \nvariable (e.g., core.hooksActiveLevels) which is set to a string of \ndifferent configuration levels (defaulting to 'system global local').\nOnly the hook directories specified on an active level are\nscanned for hooks. So by setting it to just 'local' any system\nand global hook directories are ignored.\n\nThis is not optimal, but was the best I could come up with.\nI really do not want to force the users to explicitly specify\nthe hook directories for each repository, but rather be able \nto set it on a global level, and then use exceptions for the \nfew cases where the global hooks should not be active.\n\n> In a corporate environment it is not the case, i believe. If sysadmin\n> made a mistake a with hooks, he will have to fix it, but there is no\n> point in overriding on user level as hooks in this case will be\n> something about company policy, aren't they?\n\nWell, actually it is needed there too. Even though the vast \nmajority of repositories the user clones are company repositories\nthat should use the company's rules, he may clone some occasional\nrepositories from the outside (e.g., Linux or git) in which case\nhe probably wants to disable the global company hooks.\n\n> Thanks,\n> Eugene\n\n//Peter\n\n"},{"id":"144913","messageId":"AANLkTinCFP18B8PQoGREt-izxGSlUb3IzitxK4aeiFRD@mail.gmail.com","threadId":"24266","inReplyTo":"A612847CFE53224C91B23E3A5B48BAC744940F7000@xmail3.se.axis.com","subject":"Re: global hooks - once again","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2010-07-06T15:00:36Z","receivedAt":"2010-07-06T15:00:36Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 6 July 2010 16:55, Peter Kjellerstedt <peter.kjellerstedt@axis.com> wrote:\n>> -----Original Message-----\n>> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n>> Behalf Of Eugene Sajine\n>> Sent: den 6 juli 2010 14:23\n>> To: Alex Riesen\n>> Cc: git@vger.kernel.org\n>> Subject: Re: global hooks - once again\n>>\n>> > How do your users disable execution of global hooks in this scheme?\n>> > (to protect themselves from an evil system administrator)\n>\n> Yeah, I missed that case. What I have is another configuration\n> variable (e.g., core.hooksActiveLevels) which is set to a string of\n> different configuration levels (defaulting to 'system global local').\n> Only the hook directories specified on an active level are\n> scanned for hooks. So by setting it to just 'local' any system\n> and global hook directories are ignored.\n>\n> This is not optimal, but was the best I could come up with.\n> I really do not want to force the users to explicitly specify\n> the hook directories for each repository, but rather be able\n> to set it on a global level, and then use exceptions for the\n> few cases where the global hooks should not be active.\n>\n>> In a corporate environment it is not the case, i believe. If sysadmin\n>> made a mistake a with hooks, he will have to fix it, but there is no\n>> point in overriding on user level as hooks in this case will be\n>> something about company policy, aren't they?\n>\n> Well, actually it is needed there too. Even though the vast\n> majority of repositories the user clones are company repositories\n> that should use the company's rules, he may clone some occasional\n> repositories from the outside (e.g., Linux or git) in which case\n> he probably wants to disable the global company hooks.\n\nId have guessed that users would be discouraged from having their own\nrepositories on a central version control server in most larger\nenvironments.\n\nFor instance i can imagine that boxes that devs actively work on would\nhave no global setting, and central version control boxes would have\nit.\n\ncheers,\nYves\n\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"144917","messageId":"AANLkTik-CHI2D4HYn1T2ExsyE7G3kKX4LwHf0eQRrfP1@mail.gmail.com","threadId":"24266","inReplyTo":"AANLkTinCFP18B8PQoGREt-izxGSlUb3IzitxK4aeiFRD@mail.gmail.com","subject":"Re: global hooks - once again","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-06T15:32:35Z","receivedAt":"2010-07-06T15:32:35Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"> For instance i can imagine that boxes that devs actively work on would\n> have no global setting, and central version control boxes would have\n> it.\n>\n> cheers,\n> Yves\n>\n\nI suppose the default configuration is not suggesting any system or\nglobal level hooks folders defined in proposed solution. If some admin\nor SCM makes a decision about system level hooks - he has to know what\nhe's doing - that's is pretty much it. But it might be very\ncomfortable way to set up some rules or enforce policies.\nOTOH user level (--global) hooks are going to be responsible for what\nuser does all the time and wants to automate.\n\n\nThanks,\nEugene\n"}]}