[RFC] Pre-commit hooks and other requests

Ian Clatworthy ian.clatworthy at internode.on.net
Tue Jun 26 14:41:06 BST 2007

Before I go overboard restructuring commit, I'd like to have a feel for
 any future features that are *likely* to be requested. For example,
right now commit supports hooks for code to execute after a commit is
successful. Is there a need for pre-commit hooks or some "mid-commit" hooks?

I'm not looking to over-design things upfront here, just raise my
awareness of any likely logical constraints down the track. In
particular, the current code does several "startup" checks (e.g.
checking for unknowns in strict mode) before beginning the commit "main
loop". I'm planning to combine those where I can, i.e. check for
unknowns in the main loop and abort if any are found. As things stand
right now, that's something I can do because it's just an implementation
detail. If a hook is likely to be required *after* the checks but before
the main loop, then the situation is potentially different.

I appreciate that this is not black-and-white: commit can still be doing
tests of some sort or another right up until the final transaction than
delivers a new revision. I did want to ask the question openly though so
that the refactored commit code continues in the right direction from a
logical design perspective (as well as a physical design one). So ...

  What features is commit missing that I ought to have in the
  back of my mind?

Ian C.

More information about the bazaar mailing list