Announcing bzr-tiplog

Martin Pool mbp at canonical.com
Tue Oct 25 01:24:42 UTC 2011


On 25 October 2011 11:09, Brian de Alwis <briandealwis at gmail.com> wrote:
> On 13-Oct-2011, at 11:36 PM, Martin Pool wrote:
>> On 28 September 2011 00:29, Brian de Alwis <briandealwis at gmail.com> wrote:
>>> On reflection, what I'd like is to have a command-level hooks like 'command_finished'.  This would also help with recording a rebase, as rebase will be recorded as a slew of commits.
>
> So I had 30 minutes to kill and started in on this… and it was surprisingly easy (see diff below).  It this approach considered too gruesome?

That looks pretty reasonable.  My main comment would be that you
should probably not squash the exceptions entirely: they ought to
always be logged, and probably exceptions during the hooks should
terminate the command.

The hooks might like to look at (and have the chance to modify) the
arguments and options, and perhaps they want the chance to override
the command function that's run.  You don't have to make it too
elaborate in the first cut but making the hook reasonably complete
will let us keep the interface stable later.

Please do put up a proposal for it.

>
>> That does sound worthwhile, and perhaps also some hooks that tell you
>> about the logical operations separate from the particular commands
>> that cause them (which might be more sustainable.)
>
>
> I'm not exactly sure what you mean by logical operations?  How would that be different from the existing branch, pull, push, commit, and branch-tip-change hooks?

If there is common code that needs to be attached to more than one of
them, we should look at whether we can instead provide a single hook
that's offered by multiple commands.  Maybe tip-change is all you
need.

m



More information about the bazaar mailing list