{"thread":{"id":"26156","subject":"help for a git newbie please","startedAt":"2010-12-29T17:43:43Z","lastAt":"2010-12-29T19:26:17Z","messageCount":4,"participants":["Marlene Cote","Jakub Narebski","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158718","messageId":"20053D7ED46E664F8B9A4D5E5B31937407197534@MBX021-W4-CA-1.exch021.domain.local","threadId":"26156","inReplyTo":null,"subject":"help for a git newbie please","fromName":"Marlene Cote","fromEmail":"marlene_cote@affirmednetworks.com","sentAt":"2010-12-29T17:43:43Z","receivedAt":"2010-12-29T17:43:43Z","isPatch":false,"sender":{"key":"marlene_cote@affirmednetworks.com","avatar":null},"body":"I don't understand the docs when they talk about hooks.  I have tried making my .git/hooks samples executable and they don't have any suffix to remove, so they should just run.  However, every time I make a new clone, the changes I made to the hooks are gone.  Just the samples get put into  the clone again.  How do I put a hook in place that every developer will get and execute?  If I should be using server side hooks, where exactly would those go?  Should I modify the hooks under my repositories directory?\n--------------------------\nRegards,\nMarlene Cote\nAffirmed Networks\n978-268-0821 \n"},{"id":"158719","messageId":"m3k4iscsq2.fsf@localhost.localdomain","threadId":"26156","inReplyTo":"20053D7ED46E664F8B9A4D5E5B31937407197534@MBX021-W4-CA-1.exch021.domain.local","subject":"Re: help for a git newbie please","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-12-29T18:58:11Z","receivedAt":"2010-12-29T18:58:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Marlene Cote <Marlene_Cote@affirmednetworks.com> writes:\n\n> I don't understand the docs when they talk about hooks.  I have\n> tried making my .git/hooks samples executable and they don't have\n> any suffix to remove, so they should just run.  However, every time\n> I make a new clone, the changes I made to the hooks are gone.  Just\n> the samples get put into the clone again.  How do I put a hook in\n> place that every developer will get and execute?  If I should be\n> using server side hooks, where exactly would those go?  Should I\n> modify the hooks under my repositories directory?\n\nFirst, for the future, could you please use more specific subject?\n\"Help for a git newbie please\" doesn't tell us _anything_ about what\nproblem do you have with git on first glance.\n\nSecond, hooks are not versioned and not under version control.  They\nare not transferred on clone either.  There are reasons for that,\nincluding the safety (running code under control of other side), and\nthe fact that hooks are usually configured to local needs, so they\nmight not make sense for other people.\n\n\nNow, if you either use some kind of networked filesystem, or you can\nconfigure it so each developers machine has the same install, you can\nmake use of git templates mechanism.  This is the way git includes\nsample hooks in newly created repositories (git init, git clone, or\neven IIRC \"git init\" on existing repository).\n\nThose template files are by default (on Linux) installed in\n/usr/share/git-core/templates.  So what you can do is to put hooks you\nwant each developer to have (either as executable hook, or as hook\nsample) in /usr/share/git-core/templates/hooks/ directory (or its\nequivalent in your installation).\n\nI hope that helps.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"158721","messageId":"20101229191717.GA19195@burratino","threadId":"26156","inReplyTo":"m3k4iscsq2.fsf@localhost.localdomain","subject":"shared hooks (Re: help for a git newbie please)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-29T19:17:17Z","receivedAt":"2010-12-29T19:17:17Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jakub Narebski wrote:\n\n> Now, if you either use some kind of networked filesystem, or you can\n> configure it so each developers machine has the same install, you can\n> make use of git templates mechanism.\n\nTo expand on this: if you are in the \"controlled environment\"\nsituation, you may find the discussion pointed to by [1] interesting.\n\nIf you do not control developer machines, life is even simpler.\nOne approach[2] is to track a git-templates/ directory in the working\ntree and add a setup-hooks.sh script that installs those hooks in\n.git/hooks.\n\n[1] http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/776932\nSummary: it is easier to change hooks later if you keep hooks in some\ndirectory outside the template dir (e.g., in /etc/hooks) and put a\nsymlink to that directory in the template.\n[2] e.g., used by the libreoffice repository iirc\n"},{"id":"158722","messageId":"20053D7ED46E664F8B9A4D5E5B31937407197592@MBX021-W4-CA-1.exch021.domain.local","threadId":"26156","inReplyTo":"m3k4iscsq2.fsf@localhost.localdomain","subject":"RE: help for a git newbie please - git hooks","fromName":"Marlene Cote","fromEmail":"marlene_cote@affirmednetworks.com","sentAt":"2010-12-29T19:26:17Z","receivedAt":"2010-12-29T19:26:17Z","isPatch":false,"sender":{"key":"marlene_cote@affirmednetworks.com","avatar":null},"body":"Jakub,\n Thank-you for your reply and your advice about the subject.  I apologize for the vagueness of the previous one.\n\nI see the templates directory now.  Thanks again.\n\n--------------------------\nRegards,\nMarlene Cote\nAffirmed Networks\n978-268-0821 \n\n\n\n->-----Original Message-----\n->From: Jakub Narebski [mailto:jnareb@gmail.com]\n->Sent: Wednesday, December 29, 2010 1:58 PM\n->To: Marlene Cote\n->Cc: git@vger.kernel.org\n->Subject: Re: help for a git newbie please\n->\n->Marlene Cote <Marlene_Cote@affirmednetworks.com> writes:\n->\n->> I don't understand the docs when they talk about hooks.  I have\n->> tried making my .git/hooks samples executable and they don't have\n->> any suffix to remove, so they should just run.  However, every time\n->> I make a new clone, the changes I made to the hooks are gone.  Just\n->> the samples get put into the clone again.  How do I put a hook in\n->> place that every developer will get and execute?  If I should be\n->> using server side hooks, where exactly would those go?  Should I\n->> modify the hooks under my repositories directory?\n->\n->First, for the future, could you please use more specific subject?\n->\"Help for a git newbie please\" doesn't tell us _anything_ about what\n->problem do you have with git on first glance.\n->\n->Second, hooks are not versioned and not under version control.  They\n->are not transferred on clone either.  There are reasons for that,\n->including the safety (running code under control of other side), and\n->the fact that hooks are usually configured to local needs, so they\n->might not make sense for other people.\n->\n->\n->Now, if you either use some kind of networked filesystem, or you can\n->configure it so each developers machine has the same install, you can\n->make use of git templates mechanism.  This is the way git includes\n->sample hooks in newly created repositories (git init, git clone, or\n->even IIRC \"git init\" on existing repository).\n->\n->Those template files are by default (on Linux) installed in\n->/usr/share/git-core/templates.  So what you can do is to put hooks you\n->want each developer to have (either as executable hook, or as hook\n->sample) in /usr/share/git-core/templates/hooks/ directory (or its\n->equivalent in your installation).\n->\n->I hope that helps.\n->\n->--\n->Jakub Narebski\n->Poland\n->ShadeHawk on #git\n"}]}