[Example] "pre-commit" server-side hook translated from SVN
Martin Pool
mbp at canonical.com
Wed Jul 16 08:19:13 BST 2008
On Wed, Jul 16, 2008 at 11:33 AM, Andrew Bennetts <andrew at canonical.com> wrote:
> But there's very little that you can usefully do from such a script, at least
> not out of the things the GNOME pre-commit hook wants to do. You can't easily
> get the list of changed files, or even something simple like the commit message,
> with simple bzr invocations. You could check the MAINTAINERS file with
> "bzr cat -rrevid:$REVID $BRANCH/MAINTAINERS" I guess, but that's about it.
> Obviously Python and bzrlib is much more capable than shell and /usr/bin/bzr,
> but it would be nice if we could make simple shell scripts possible. This would
> be especially helpful for people converting hook scripts for other VCS tools.
I think this script would be worth comitting as an example linked from
the user documentation, and maybe with a bit of commentary. And
mention it in NEWS too.
It seems to me that they should be able to look at the output of 'bzr
status -r $OLD_REVID..$NEW_REVID' and 'bzr log -r $NEW_REVID'. I'm
not completely sure if that will work in the context where the shell
hooks are run.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list