{"thread":{"id":"25453","subject":"Why there is no pre-checkout hook?","startedAt":"2010-10-15T08:21:07Z","lastAt":"2010-10-15T22:46:44Z","messageCount":3,"participants":["Óscar Fuentes","Jonathan Nieder","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153569","messageId":"87hbgn27f0.fsf@telefonica.net","threadId":"25453","inReplyTo":null,"subject":"Why there is no pre-checkout hook?","fromName":"Óscar Fuentes","fromEmail":"ofv@wanadoo.es","sentAt":"2010-10-15T08:21:07Z","receivedAt":"2010-10-15T08:21:07Z","isPatch":false,"sender":{"key":"ofv@wanadoo.es","avatar":null},"body":"Subject says it all.\n"},{"id":"153570","messageId":"20101015083022.GA8763@burratino","threadId":"25453","inReplyTo":"87hbgn27f0.fsf@telefonica.net","subject":"Re: Why there is no pre-checkout hook?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-15T08:30:22Z","receivedAt":"2010-10-15T08:30:22Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Óscar Fuentes wrote:\n\n> [Subject: Why there is no pre-checkout hook?]\n\nBecause you can use your script in place of \"git checkout\".\n\nOr: because no one's come up with a compelling use case for\none.\n\nOr: because no one implemented it and demonstrated how to\nuse it yet.\n\nTake your pick. :)\n"},{"id":"153605","messageId":"7vr5fraxbf.fsf@alter.siamese.dyndns.org","threadId":"25453","inReplyTo":"20101015083022.GA8763@burratino","subject":"Re: Why there is no pre-checkout hook?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-15T22:46:44Z","receivedAt":"2010-10-15T22:46:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Óscar Fuentes wrote:\n>\n>> [Subject: Why there is no pre-checkout hook?]\n>\n> Because you can use your script in place of \"git checkout\".\n>\n> Or: because no one's come up with a compelling use case for\n> one.\n>\n> Or: because no one implemented it and demonstrated how to\n> use it yet.\n>\n> Take your pick. :)\n\nThe first one is the most correct answer from historical standpoint for\nalmost any command, as git was designed to be scripted, and if you need\npre-frotz to always run before running frotz you should be doing that\nbefore running frotz yoruself.  The same for post-frotz that would\nunconditionally run after you run frotz.\n\nGoogle/Bing/Gmane Search for \"five valid reasons for git hook\" ;-)\n\nHaving said that, I think it may be a good time to start thinking about\nloosening the criteria, especially unconditional pre- and post- ones,\naround Porcelain commands.  The \"five valid reasons\" criteria apply to\nplumbing where you have more control and freedom and we do not want to\nspend extra cycles even to check for non-existence of hooks.\n"}]}