[RFC] CommitTemplate (was Re: [ANN bzr-vim] syntax and ftplugin for bzr_log.* files)

John Arbash Meinel john at arbash-meinel.com
Fri Jul 28 16:29:35 BST 2006


Adeodato Simó wrote:
> * Aaron Bentley [Fri, 28 Jul 2006 09:31:14 -0400]:
> 
> Hi,
> 
>> Adeodato Simó wrote:
>>> ------------------------------------------------------------------------
> 
>>> # Bazaar revision bundle v0.8
> 
>>> # message:
>>> #   bzrlib/commit_template.py:
>>> #     - New file.
> 
>> Our convention is that the first line of the commit message is a
>> summary, and frequently the only line displayed.
>> "bzrlib/commit_template.py:" does not make a good summary.
> 
> Yah, this slipped from my own particular commit message convention. In
> any case, since this is in a branch that gets integrated later with a
> proper first log line later, does it really matter? (it's okay if it
> does).
> 

It's not like we would refuse to merge you because of a bad commit
message. :)
It is just hygiene to have a good summary.

...

>> Feel free to fix up whatever file you copied it from.
> 
> A quick grep reveals at least 33 files suffer from that. If you'd like,
> I can send a diff for all of them. Just let me know.

If you want to do the cleanup, please do. But do it as a separate patch,
so things don't get mixed.

...

> 
> Footnotes:
> 
>   (*) A wrapper that does:
>     
>       def run(self, arg1=default, arg1=default, arg1=default)
> 
>   instead of
> 
>       def run(self, arg_i_need1=default, arg_i_need2=default, **kwargs)
> 
> 
>   (**) What I would like to see someday is `bzr commit --select-hunks`,
>        a-la-darcs. Kinda like shelve-commit-unshelve. Do you think it'd
>        be accepted if some day... an implementation appeared?
> 

What you might want to look into is instead of:

def run(self, my_arg_1=None, my_arg_2=None, *args, **kwargs):

to use

def run(self, *args, **kwargs):

  arg_i_need_1 = kwargs.get('args_i_need_1', None)
  ....

The problem is that if you use explicitly named arguments, and somebody
calls:

obj.run(a, b)

b will be used for you 'my_arg_1' instead of being put into *args.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060728/b1821c72/attachment.pgp 


More information about the bazaar mailing list