git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* help for a git newbie please
@ 2010-12-29 17:43 Marlene Cote
  2010-12-29 18:58 ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Marlene Cote @ 2010-12-29 17:43 UTC (permalink / raw
  To: git@vger.kernel.org

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?
--------------------------
Regards,
Marlene Cote
Affirmed Networks
978-268-0821 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: help for a git newbie please
  2010-12-29 17:43 help for a git newbie please Marlene Cote
@ 2010-12-29 18:58 ` Jakub Narebski
  2010-12-29 19:17   ` shared hooks (Re: help for a git newbie please) Jonathan Nieder
  2010-12-29 19:26   ` help for a git newbie please - git hooks Marlene Cote
  0 siblings, 2 replies; 4+ messages in thread
From: Jakub Narebski @ 2010-12-29 18:58 UTC (permalink / raw
  To: Marlene Cote; +Cc: git

Marlene Cote <Marlene_Cote@affirmednetworks.com> writes:

> 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?

First, for the future, could you please use more specific subject?
"Help for a git newbie please" doesn't tell us _anything_ about what
problem do you have with git on first glance.

Second, hooks are not versioned and not under version control.  They
are not transferred on clone either.  There are reasons for that,
including the safety (running code under control of other side), and
the fact that hooks are usually configured to local needs, so they
might not make sense for other people.


Now, if you either use some kind of networked filesystem, or you can
configure it so each developers machine has the same install, you can
make use of git templates mechanism.  This is the way git includes
sample hooks in newly created repositories (git init, git clone, or
even IIRC "git init" on existing repository).

Those template files are by default (on Linux) installed in
/usr/share/git-core/templates.  So what you can do is to put hooks you
want each developer to have (either as executable hook, or as hook
sample) in /usr/share/git-core/templates/hooks/ directory (or its
equivalent in your installation).

I hope that helps.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 4+ messages in thread

* shared hooks (Re: help for a git newbie please)
  2010-12-29 18:58 ` Jakub Narebski
@ 2010-12-29 19:17   ` Jonathan Nieder
  2010-12-29 19:26   ` help for a git newbie please - git hooks Marlene Cote
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2010-12-29 19:17 UTC (permalink / raw
  To: Jakub Narebski; +Cc: Marlene Cote, git

Jakub Narebski wrote:

> Now, if you either use some kind of networked filesystem, or you can
> configure it so each developers machine has the same install, you can
> make use of git templates mechanism.

To expand on this: if you are in the "controlled environment"
situation, you may find the discussion pointed to by [1] interesting.

If you do not control developer machines, life is even simpler.
One approach[2] is to track a git-templates/ directory in the working
tree and add a setup-hooks.sh script that installs those hooks in
.git/hooks.

[1] http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/776932
Summary: it is easier to change hooks later if you keep hooks in some
directory outside the template dir (e.g., in /etc/hooks) and put a
symlink to that directory in the template.
[2] e.g., used by the libreoffice repository iirc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: help for a git newbie please - git hooks
  2010-12-29 18:58 ` Jakub Narebski
  2010-12-29 19:17   ` shared hooks (Re: help for a git newbie please) Jonathan Nieder
@ 2010-12-29 19:26   ` Marlene Cote
  1 sibling, 0 replies; 4+ messages in thread
From: Marlene Cote @ 2010-12-29 19:26 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git@vger.kernel.org

Jakub,
 Thank-you for your reply and your advice about the subject.  I apologize for the vagueness of the previous one.

I see the templates directory now.  Thanks again.

--------------------------
Regards,
Marlene Cote
Affirmed Networks
978-268-0821 



->-----Original Message-----
->From: Jakub Narebski [mailto:jnareb@gmail.com]
->Sent: Wednesday, December 29, 2010 1:58 PM
->To: Marlene Cote
->Cc: git@vger.kernel.org
->Subject: Re: help for a git newbie please
->
->Marlene Cote <Marlene_Cote@affirmednetworks.com> writes:
->
->> 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?
->
->First, for the future, could you please use more specific subject?
->"Help for a git newbie please" doesn't tell us _anything_ about what
->problem do you have with git on first glance.
->
->Second, hooks are not versioned and not under version control.  They
->are not transferred on clone either.  There are reasons for that,
->including the safety (running code under control of other side), and
->the fact that hooks are usually configured to local needs, so they
->might not make sense for other people.
->
->
->Now, if you either use some kind of networked filesystem, or you can
->configure it so each developers machine has the same install, you can
->make use of git templates mechanism.  This is the way git includes
->sample hooks in newly created repositories (git init, git clone, or
->even IIRC "git init" on existing repository).
->
->Those template files are by default (on Linux) installed in
->/usr/share/git-core/templates.  So what you can do is to put hooks you
->want each developer to have (either as executable hook, or as hook
->sample) in /usr/share/git-core/templates/hooks/ directory (or its
->equivalent in your installation).
->
->I hope that helps.
->
->--
->Jakub Narebski
->Poland
->ShadeHawk on #git

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-29 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29 17:43 help for a git newbie please Marlene Cote
2010-12-29 18:58 ` Jakub Narebski
2010-12-29 19:17   ` shared hooks (Re: help for a git newbie please) Jonathan Nieder
2010-12-29 19:26   ` help for a git newbie please - git hooks Marlene Cote

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).