Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Why there is no pre-checkout hook?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:48

Jonathan Nieder [off-list ref] writes:
Óscar Fuentes wrote:
quoted
[Subject: Why there is no pre-checkout hook?]
Because you can use your script in place of "git checkout".

Or: because no one's come up with a compelling use case for
one.

Or: because no one implemented it and demonstrated how to
use it yet.

Take your pick. :)
The first one is the most correct answer from historical standpoint for
almost any command, as git was designed to be scripted, and if you need
pre-frotz to always run before running frotz you should be doing that
before running frotz yoruself.  The same for post-frotz that would
unconditionally run after you run frotz.

Google/Bing/Gmane Search for "five valid reasons for git hook" ;-)

Having said that, I think it may be a good time to start thinking about
loosening the criteria, especially unconditional pre- and post- ones,
around Porcelain commands.  The "five valid reasons" criteria apply to
plumbing where you have more control and freedom and we do not want to
spend extra cycles even to check for non-existence of hooks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help