[RFC] Changing the generate_commit_message_template and commit_message_template hook APIs

John Arbash Meinel john at arbash-meinel.com
Mon Sep 14 05:09:49 BST 2009


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

Robert Collins wrote:
> John Arbash Meinel wrote:
> 
>> Except I don't think we let you alter what files are committed at the
>> time you get the commit message.
> 
>> As I recall, we wanted to get the message as late as possible to avoid
>> typing a message and have the commit fail.
> 
> The commit message doesn't change them; other plugins that run as part
> of commit (start and pre commit) can influence things; and we'll likely
> want to add more support for that later.
> 
> Which is my point really ;)

Pre commit cannot change what is committed. It can only chose to abort
the commit (everything has already been written to the repository at
that time). Only "start_commit" can actually change anything.

qbzr reasonably expects that you will want to select what files to
commit at the same time that you write the commit message for them. I
happen to do the same thing all the time using bash's multiline argument
handling. (bzr commit -m "...\n...\n...\n" foo.py bar.py)

So we could extend the api so that the commit message editor is allowed
to change what is committed, and have it run somewhere between
'start_commit' and when we start writing content to the repository.
(Well, we could write the file content, but not the inventory content,
or something like that if we wanted.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqtwg0ACgkQJdeBCYSNAANMkACeJrWeG1bgvVb+phuJkY6YZFau
Y9oAnAo5t1B64EzRL0/GRIFkkh7vS18i
=eYK5
-----END PGP SIGNATURE-----



More information about the bazaar mailing list