Request: post-commit hook needs more info

John Arbash Meinel john at arbash-meinel.com
Wed Oct 17 17:14:15 BST 2007


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

At the moment, we have 2 branch hooks, pre-commit and post-commit.
The pre-commit hook gets:

                hook(hook_local, hook_master,
                     old_revno, old_revid, new_revno, self.rev_id,
                     tree_delta, future_tree)

The post-commit hook gets:
            if hook_name == "post_commit":
                hook(hook_local, hook_master, old_revno, old_revid, new_revno,
                     self.rev_id)

There are a few more things I would like to add:

1) The path to the working tree for this commit. It would be nice to be able to
update some meta-data in the working tree after a commit. At the moment, you
can sort of guess the location from the hook_local.base, but that is a URL, and
we all know that a branch may not be where the WT is.

2) The tree delta, and the future tree. Obviously we already have it, it would
be better to pass it than to have the callback have to extract it for itself.

It really seems like we should be passing a nice Object to the function
callback, rather than making the list of parameters longer and longer. It makes
upgrading the amount of data easier (since you aren't passing 10 arguments to
one that only expects 8), and it makes it a bit cleaner (I really don't like
functions with more than 5 or so arguments).

Any thoughts about what else we could do?

John
=:->

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

iD8DBQFHFjTXJdeBCYSNAAMRAhelAJ91/Z6hqnypcStCdQ0lcdwJdTOWtwCgnVee
B3HZwcfpP6qka3oogDoc3+Q=
=7P9v
-----END PGP SIGNATURE-----



More information about the bazaar mailing list