git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* some (fairly simple) questions about hooks
@ 2018-05-30 11:00 Robert P. J. Day
  2018-05-30 11:14 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2018-05-30 11:00 UTC (permalink / raw)
  To: Git Mailing list


  just want to clarify a few things about hooks to make sure i'm not
missing anything when i write my own hooks tutorial.

  first, for any hook to be active, it *must* be marked as executable
-- that much seems clear from the man page.

  next, "core.hooksPath" aside, the hooks related to any repository
are (by default) in $GIT_DIR/hooks and *only* in that directory. AIUI,
there is no way to extend or enhance the per-repo hooks with, perhaps,
a common subset of hooks in a common directory, is there? (i'm
ignoring the possibility that one could populate $GIT_DIR/hooks with a
few symlinks to share some common hooks among a number of repos --
would that work? and is it something that is even considered good
programming practice?)

  next, AIUI, the use of "core.hooksPath" *completely* overrides any
hooks in $GIT_DIR/hooks, yes? that is, that config setting does not
support any sort of enhancement of existing hooks, it's all or
nothing, correct?

  and sticking with core.hooksPath, one could set it either globally
to affect all repos, or one could of course set it locally to take
advantage of it just for *some* repos, but not all of them.

  finally, if you run "git init" for an existing repo, as i read it,
based on the templates content in effect, that will install new hooks
in a repo but *only* hooks for which there is no existing equivalent
-- it will *never* overwrite an existing hook by the same name.

  oh, and related to that last paragraph, running "git init" related
to hooks should be unaffected by core.hooksPath, is that correct? so
that even if "git init" installs some new hooks in an existing repo,
those new hooks will have no effect if core.hooksPath is set to refer
somewhere else, yes?

  am i missing any important features of hooks in the above?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

end of thread, other threads:[~2018-05-30 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 11:00 some (fairly simple) questions about hooks Robert P. J. Day
2018-05-30 11:14 ` Ævar Arnfjörð Bjarmason

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).