[RFC] Changing the generate_commit_message_template and commit_message_template hook APIs

Robert Collins robertc at robertcollins.net
Tue Sep 15 01:33:07 BST 2009


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

John Szakmeister wrote:
> On 9/13/09, Martin Pool <mbp at canonical.com> wrote:
> [snip]
>> Those are good cases to keep in mind, but I don't think it's
>> inherently unreasonable to say "do a dry-run commit and give me the
>> template", then later "actually commit, using this message."
>> Obviously there is some risk of the tree changing in the interim but I
>> can imagine people liking to use it from shell scripts or emacs or
>> other things.  It is a bit inefficient too.
>>
>> Another (maybe weird) approach is to have the in-process commit editor
>> be: write the template to a tmp file, then connect to this named pipe
>> and read the message back from there.  That gives you a handoff to an
>> asynchronous process: it gets the template, does its thing, and when
>> the user presses ok opens that pipe and writes.  This will vary a bit
>> between unix and Windows but in principle (heh) it should work
>> everywhere.
> 
> Does attempting to get the message in the middle of the commit prevent
> things like diff from working?  One of the really nice features of
> qcommit is the ability to view the files being committed and write an
> appropriate log message, as well as filter off any files I don't want
> committed yet.  Preventing those features from working would be a real
> detriment to QBzr, IMHO.

So, something I'd like the CLI to permit is interactive commit.

$ commit -i

{editor opens} containing an area to write a commit, a list of modified
files, and detailed diffs.

to not commit some files, just delete them from the 'status' list.
To not commit some hunks, delete the hunks from the detail diffs.

If we can do this cleanly, I'm sure a GUI will have no trouble doing it
with whatever altered interfaces we create.

- -Rob
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqu4MIACgkQ42zgmrPGrq4wlQCgtR70I4Fe1FI6PGWuLBios9C9
IecAn3vomnboVO2YaLpGHPGRszbWzhv6
=VZah
-----END PGP SIGNATURE-----



More information about the bazaar mailing list