Ability to modify the tree from a pre-commit hook

Bug #186422 reported by Jelmer Vernooij on 2008-01-27
2
Affects Status Importance Assigned to Milestone
Bazaar
Wishlist
Jelmer Vernooij

Bug Description

 affects bzr

For etckeeper, I need to use a hook in "bzr commit" that could change
the tree that is being committed. This is not possible using the current
pre_commit hook.

Perhaps it would be possible to split up pre_commit hook into a hook run
right before the commit is started and a hook that is being run after
the delta has been determined?

The first hook could still allow changing of the tree.
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

James Westby (james-w) on 2008-01-28
Changed in bzr:
importance: Undecided → Wishlist
status: New → Triaged
Ian Clatworthy (ian-clatworthy) wrote :

I think the hook that permits changing the tree ought to be called start_commit. FWIW, Subversion has a hook called this. (It would be nice if our hook followed a similar signature to make it easier for teams switching from Subversion to Bazaar, assuming the signature meets our needs.)

Am Mittwoch, den 30.01.2008, 07:17 +0000 schrieb Ian Clatworthy:
> I think the hook that permits changing the tree ought to be called
> start_commit. FWIW, Subversion has a hook called this. (It would be nice
> if our hook followed a similar signature to make it easier for teams
> switching from Subversion to Bazaar, assuming the signature meets our
> needs.)
Yep, subversion does indeed have a "start-commit" hook for this moment,
but it doesn't appear to guarantee that there's a working tree around
that the user can use.

Of course, that doesn't stop us from making it available though.

Cheers,

Jelmer

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

On Sun, 2008-01-27 at 19:24 +0000, Jelmer Vernooij wrote:
> Public bug reported:
>
> affects bzr
>
> For etckeeper, I need to use a hook in "bzr commit" that could change
> the tree that is being committed. This is not possible using the current
> pre_commit hook.
>
> Perhaps it would be possible to split up pre_commit hook into a hook run
> right before the commit is started and a hook that is being run after
> the delta has been determined?
>
> The first hook could still allow changing of the tree.

I don't think splitting is needed - just adding a new hook should suffice.

Some care will be needed to avoid locking and race conditions;
particularly if non-python hooks are anticipated for this.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

James Westby (james-w) wrote :

Hi,

We now have a start_commit hook, can this bug be closed?

Thanks,

James

Jelmer Vernooij (jelmer) on 2008-08-30
Changed in bzr:
assignee: nobody → jelmer
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers