Possibility of changing the message of an older commit

Marius Kruger amanic at gmail.com
Sat Dec 6 10:54:18 GMT 2008


2008/12/6 Stephen J. Turnbull <stephen at xemacs.org>

> Enrique Ramirez writes:
>
>  > I was wondering if bazaar allows changes to messages and committed
>  > dates of older revisions. Like for example, I'm at revision 100 but I
>  > just realized that revision 90 had a bogus message that didn't have
>  > anything to do to the changes. What I'm looking for would be a way to
>  > replace that message and hopefully leave no visible traces on the
>  > regular bzr log. Any ideas? Plugins?
>
> No.  None of the modern VCSes will do it for you directly.

 ...

> Note that even in git, if you revise the message at revision 90, you
> will also have to recreate the commits of revision 91 .. 100.  If you
> have allowed others to clone your repo, then their rev 100 will not be
> equal to your rev 100'.  It will appear as tip of a separate branch,
> forked after rev 89, with identical content (tree IDs) but different
> history (commit IDs).  This is a feature, not a bug.
>
> While users generally don't pay attention to the commit ID, so it will
> be effectively invisible in the log, it will be disastrously visible
> in use.  Specifically, if you use the same name for the branch with
> changed history, enormous confusion will ensue if clones of the
> original commit are available anywhere else.  Merges will fail or
> generate huge conflicts, etc.
>
> So, just don't do it.  The closest effect that is reasonably safe is
> to
>
> # untested, and I'm not fluent in bzr yet
> bzr branch -r 89 . ../tmp-branch
> bzr diff -r 89 -r 90 -p1 | patch -d ../tmp-branch -p1
> cd ../tmp-branch
> bzr commit -m "Corrected message."
> # optional, might give prettier logs
> # bzr merge -r 91:100 mainline
> cd ../mainline
> bzr merge ../tmp-branch
>

I tried the following which worked (it uses the rebase plugin):

bzr branch -r 90 . ../tmp-branch
cd ../tmp-branch
bzr uncommit
bzr commit -m "Corrected message."
bzr replay -r90 ../mainline

BTW pay head to the warning of Stephen

regards
marius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20081206/1b28ee08/attachment-0001.htm 


More information about the bazaar mailing list