On Tue, 2010-08-10, C. Michael Pilato wrote: > On 08/10/2010 01:10 PM, C. Michael Pilato wrote: > > On 08/10/2010 12:15 PM, Julian Foad wrote: > >> On Tue, 2010-08-10 at 17:12 +0100, Bolstridge, Andrew wrote: > >>>> Summary... > >>>> > >>>> There are two issues here... > >>>> > >>>> 1. The repo admin wants to enforce what is commited to their repo. > >>> This > >>>> exists with scripts but common request can be made inherient repo > >>> settings > >>>> (probably need to be path based). > >>>> > >>> > >>> The issue with pre-commit hooks is that they are run after all data is > >>> transferred - so if I commit loads of data, and accidentally leave the > >>> banned buildlog.htm file in... I'll find out about it after half an > >>> hour's commit.. and have to repeat the process. > >> > >> No - there are two different hooks, for precisely this reason. > >> pre-commit runs before all the file contents are transferred, and > >> start-commit after all the file contents are transferred. > > > > Er... no. > > > > 'start-commit' runs before any files are transferred. It can't be used to > > fail a commit based on any information that comes from the commit's tree > > delta content payload. > > > > 'pre-commit' runs just before the commit transaction is promoted into a > > revision, and can be used to block commits based on the content payload. > > But only after the whole payload is transmitted to the server. > > In other words, I think you were essentially correct about the two-hook > system, Julian -- you just had the hooks switched. But regardless, the
Thanks for correcting me. > two-hook system still fails Andrew's particular enforcement requirements > (which are quite common). Oh? All I know about Andrew's particular requirements related to this query is what's quoted above - "If I ... accidentally leave the banned buildlog.htm file in ..." - which sounded vaguely like a requirement for a path-based rule. Maybe I missed something. - Julian