ANN: edit_message plugin

Vincent LADEUIL v.ladeuil at alplog.fr
Wed Jan 25 15:08:06 GMT 2006


>>>>> "Alexander" == Alexander Belchenko <bialix at ukr.net> writes:

    Alexander> Aaron Bentley пишет:
    >> DOING THIS IS A MODEL VIOLATION.  YOU ARE LIKELY TO BREAK
    >> BZR.
    >> 
    >> The revision id refers to all the metadata, including the
    >> commit message.  If you do this, you MUST change the
    >> revision id of the revision you alter, and change the
    >> revision ids of all its descendants, AT MINIMUM.



    Alexander> I really want for someone comment my plugin --
    Alexander> thank you.  And I want to understand your caution.

    Alexander> Right now revision id automaticaly generated by
    Alexander> function in bzrlib.commit module named
    Alexander> _gen_revision_id(). This function accept 2
    Alexander> arguments: `config` and `when`. From `config`
    Alexander> extracted user email and when used as
    Alexander> timestamp. Plus at the end added 8 random
    Alexander> bytes. Probably I miss something, but I don't see
    Alexander> how commit message affects to revision id. 

    Alexander> What I do wrong?

You consider that comments are not part of the commit.

Changing comments *should* be handled as changing code.

It's important to know *who* did *what* and *when*.

If you  commit a wrong comment  you should commit  a new revision
explaining that you committed a wrong comment.

Basically  the only legal  use of  your add-on  will be  when you
realize you had put a wrong comment just after committing it. And
in that case,  you should un-commit and re-commit  with the right
comment  before anyone else  had ever  had a  chance to  see your
comments or commit some other changes (in short: never).

Don't  get fooled  by how  bzr calculate  revision ids,  they are
built *before* anybody can see them. But once they are used, they
should not change  and the data they represent  should not change
either, never.

So pay  attention to what you  write in your  commit comments :-)
They will last forever.

         Vincent





More information about the bazaar mailing list