Request: post-commit hook needs more info

John Arbash Meinel john at arbash-meinel.com
Wed Oct 17 22:50:37 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew D. Fuller wrote:
> On Wed, Oct 17, 2007 at 11:14:15AM -0500 I heard the voice of
> John Arbash Meinel, and lo! it spake thus:
>> 1) The path to the working tree for this commit.
> 
> This sounds like trouble for a post-commit hook running on a remote
> server from a checkout...
> 
> ("Then, the smart server will attempt to hack into your
> workstation...")
> 
> 

Well, it could always be set to None. It still seems better than abusing:
  a_branch.bzrdir.root_transport.local_abspath('.')

Also, at the moment, all of these hooks are executed on the client.

What I would like to see is passing tree, but barring that, tree.basedir.

As it is, commit.py requires a working tree. One of the first lines is:

        if working_tree is None:
            raise BzrError("working_tree must be passed into commit().")

It is just that these are considered "Branch.hooks", not "WorkingTree.hooks".

I personally am fine with them declared on the branch (so that a lightweight
checkout of the same branch will have the same hooks declared). Just that the
callback should probably be defined in terms of the working tree that is being
committed, since that *is* actually a required object.

(Certainly, Branch.commit() doesn't make sense since a Branch is just a
pointer, it doesn't have any changes to commit.)

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFoOkJdeBCYSNAAMRAt1aAJ0S9JNCoLOd61E/4rQHMK7zj7z/jwCfULUA
pi04XV1FJkUBuXArkZQCaXk=
=bidr
-----END PGP SIGNATURE-----



More information about the bazaar mailing list