{"thread":{"id":"24416","subject":"Re: git: please refuse push containing commits marked for autosquash by default","startedAt":"2010-07-16T19:04:32Z","lastAt":"2010-07-26T15:50:27Z","messageCount":2,"participants":["Jonathan Nieder","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145701","messageId":"20100716190432.GA16371@burratino","threadId":"24416","inReplyTo":"20100716123715.16356.65888.reportbug@richter","subject":"Re: git: please refuse push containing commits marked for autosquash by default","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-16T19:04:32Z","receivedAt":"2010-07-16T19:04:32Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Simon,\n\nSimon Richter wrote:\n\n> When using the --autosquash feature, quite a number of temporary commits\n> are created that should never be pushed anywhere. It might be a good\n> idea to have an option to refuse to transfer commits whose messages\n> start with \"fixup!\" or \"squash!\", both on the server and client side.\n\nAt first glance this looks very useful, as an optional hook rather\nthan on by default[1].\n\nIt sounds like a good use for hooks.\n\nReceiving side: an update hook should do the trick.  See the githooks\nmanual page, or /usr/share/doc/git/contrib/hooks/update-paranoid for\nan example.\n\nSending side: there is no pre-push hook yet, but there was some work\ntowards that about a year and a half ago[2].  Maybe someone interested\ncould revive the topic or figure out what remains to be done.\n\nJonathan\n\n[1] Sometimes I send works in progress from one machine to another; it\nwould be quite unnerving if this resulted in some puzzling message\nabout how I forgot to rebase first.\n\n[2] http://thread.gmane.org/gmane.comp.version-control.git/92900\nhttp://thread.gmane.org/gmane.comp.version-control.git/128426/focus=128433\n"},{"id":"146387","messageId":"20100726155027.GB18762@coredump.intra.peff.net","threadId":"24416","inReplyTo":"20100716190432.GA16371@burratino","subject":"Re: git: please refuse push containing commits marked for autosquash by default","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-07-26T15:50:27Z","receivedAt":"2010-07-26T15:50:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 16, 2010 at 02:04:32PM -0500, Jonathan Nieder wrote:\n\n> > When using the --autosquash feature, quite a number of temporary commits\n> > are created that should never be pushed anywhere. It might be a good\n> > idea to have an option to refuse to transfer commits whose messages\n> > start with \"fixup!\" or \"squash!\", both on the server and client side.\n> \n> At first glance this looks very useful, as an optional hook rather\n> than on by default[1].\n\nYeah, from my cursory look, this really seems like policy that should be\ngoing in a hook.\n\n> Sending side: there is no pre-push hook yet, but there was some work\n> towards that about a year and a half ago[2].  Maybe someone interested\n> could revive the topic or figure out what remains to be done.\n\nIf somebody is interested in that, they should read this related thread:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/128273\n\nwhich talks about a \"pre-push\" hook that could interactively confirm\npush of specific refs. So ideally any pre-push hook interface would not\njust be \"do the push or not\" but would actually be able to munge the\nlist of commits to push.\n\n-Peff\n"}]}