[MERGE] Show commit hook names during commit.

Robert Collins robertc at robertcollins.net
Fri Jun 29 00:36:48 BST 2007


On Thu, 2007-06-28 at 09:11 -0500, John Arbash Meinel wrote:

> > I don't think so - they are typically quite ugly or not human
> meaning
> > full. I am not -1 on the concept, but I tried it and rather hated it. I
> > guess for debugging it would be better, but perhaps -Dhooks could always
> > show the repr instead ? (I'd need a pointer at doing -D foodoo to do
> > this trivially).
> 
> Why not just use "__name__" and maybe "__module__". Specifically you get:
> >>> bzrlib.plugins.email.branch_commit_hook.__name__
> 'branch_commit_hook'
> >>> bzrlib.plugins.email.branch_commit_hook.__module__
> 'bzrlib.plugins.email'
> 
> So if you did:
> 
> >>> x = bzrlib.plugins.email.branch_commit_hook
> >>> x.__module__ + '.' + x.__name__
> 'bzrlib.plugins.email.branch_commit_hook'
> 
> You could even do it as '<%s>' % (x.__name__,)
> 
> Which would generally be short, and indicate it wasn't explicitly named.

>>> foo = lambda x:x
>>> foo.__name__
'<lambda>'

> Regardless, I would rather see:
> 
>  Running post commit hooks [unknown]
> 
> Than
> 
>  Running post commit hooks [No hook name]

I'm happy to change it to unknown. Being explicit about it seemed nicer
to me than just 'unknown' though. Straw poll time - is 'unknown' or 'no
hook name' clearer?

> But I think
> 
>  Running post commit hooks [branch_commit_hook]
> 
> is ok. I can see that different plugins might name the actual hook
> function the same thing, though.

I don't think thats useful though, because when its the same its not
clear to the user or author that this hasn't been named, nor what its
about. This is part of why I went for 'no hook name' rather than just
'unknown' because it at least hints in the right direction.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070629/9a1f1183/attachment.pgp 


More information about the bazaar mailing list