fixing old commit messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

fixing old commit messages

Hendrik Boom-2
When I commit a revision, I get to write a message explaining what this
revision does.

But sometines I look at the old commit messages and cringe.

I have troubleetyping correctly, and there are often typos and worse.

Is there any way to edit an old commit message?

g-- hendrik


_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: fixing old commit messages

Stephen Leake-3
Hendrik Boom <[hidden email]> writes:

> Is there any way to edit an old commit message?

The commit message for a revision is stored in the "changlog" cert:

$ mtn ls certs h:org.opentoken
mtn: expanding selection 'h:org.opentoken'
mtn: expanded to '99db28068fc5a79e3e6137777f8d64dc273a4870'
------------------------------------------------------------------------
Key   : [hidden email] (ed5da650ec...)
Sig   : ok
Name  : author
Value : [hidden email]
------------------------------------------------------------------------
Key   : [hidden email] (ed5da650ec...)
Sig   : ok
Name  : branch
Value : org.opentoken
------------------------------------------------------------------------
Key   : [hidden email] (ed5da650ec...)
Sig   : ok
Name  : changelog
Value : * opentoken-recognizer-graphic_character.adb (Analyze): fix if/then layout
      : * opentoken-recognizer-html_entity.adb (Analyze):
      : * opentoken-recognizer-real.adb:
      : * opentoken-token-enumerated-analyzer.adb (Find_Best_Match):
------------------------------------------------------------------------
Key   : [hidden email] (ed5da650ec...)
Sig   : ok
Name  : date
Value : 2014-06-14T06:41:14


You can't delete or change an old cert, but you can add a new one:

$ mtn cert h:org.opentoken changelog "additional changelog"

However, that might cause problems with tools that expect only one
changelog per revision.

So the best answer is "no, you can't change commit messages".

Part of the point of the name "monotone" is that history changes
monotonically; you can only add to it, never subtract (a change is a
subtract plus add).

--
-- Stephe

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: fixing old commit messages

Markus Wanner-2
In reply to this post by Hendrik Boom-2
On 06/14/2014 06:32 PM, Hendrik Boom wrote:
> When I commit a revision, I get to write a message explaining what this
> revision does.
>
> But sometines I look at the old commit messages and cringe.
>
> I have troubleetyping correctly, and there are often typos and worse.
>
> Is there any way to edit an old commit message?

What I sometimes do is commit to a private feature branch, where I don't
have to worry much about the commit message. Then "merge" the branch
with mtn pluck, thinking harder about the message after the entire
feature is done (testing takes a while; usually I end up having multiple
commits in the branch or even merges from the parent branch) and then
suspending that feature branch.

Of course, you need to plan ahead for that to work. And technically it's
not really editing the commit message, but rather adding an intermediate
step. But one that doesn't need to be visible to others.

Regards

Markus Wanner



_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: fixing old commit messages

J Decker
isn't it just as simple as adding a comment?

mtn comment rev [comment] 

This adds a new comment to a committed revision (see Selectors). If comment is not provided, it is obtained from the Lua hook edit_comment; the hook is passed an empty string.

This command is a synonym for mtn cert rev comment comment.

which becomes a lot easier than any other version system...



On Tue, Jun 17, 2014 at 9:05 AM, Markus Wanner <[hidden email]> wrote:
On 06/14/2014 06:32 PM, Hendrik Boom wrote:
> When I commit a revision, I get to write a message explaining what this
> revision does.
>
> But sometines I look at the old commit messages and cringe.
>
> I have troubleetyping correctly, and there are often typos and worse.
>
> Is there any way to edit an old commit message?

What I sometimes do is commit to a private feature branch, where I don't
have to worry much about the commit message. Then "merge" the branch
with mtn pluck, thinking harder about the message after the entire
feature is done (testing takes a while; usually I end up having multiple
commits in the branch or even merges from the parent branch) and then
suspending that feature branch.

Of course, you need to plan ahead for that to work. And technically it's
not really editing the commit message, but rather adding an intermediate
step. But one that doesn't need to be visible to others.

Regards

Markus Wanner



_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel


_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: fixing old commit messages

Markus Wanner-2
On 06/17/2014 06:18 PM, J Decker wrote:
> isn't it just as simple as adding a comment?

Well, that adds a comment. That's a) not the same as a changelog cert
and b) doesn't delete the existing changelog cert.

Regards

Markus Wanner


_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel