[RFC] Amend commit messages

Laurens Holst laurens.nospam at grauw.nl
Wed Feb 23 07:20:48 CST 2011


Op 23-2-2011 9:41, Gilles Moris schreef:
> Hello,
>
> I don't remember any extension in this area, but this is a recurrent question
> on the mailing list:
> "I made a mistake in my commit message. How can I change it?"
>
> We can redirect them to either mq or histedit, but usually we can only answer
> that this is not possible if the commit is already published.
> However, this question is legitimate. Whatever the number of reviews you can
> do, there always be some typo that can escape, like switched digits in a bug
> number or similar issues. The idea to have a message forever wrong is quite
> frustrating.

Also, does the same not apply to files? ‘I checked in a file I didn’t 
intend to. How can I change it?’

It’s the same class of error, made in the same window. I certainly make 
this mistake as much as I make mistakes in my commit message. Also the 
answer is the same: you can rollback and retry immediately, or with some 
more effort amend before you push. After you push, it’s permanent. 
Simple. And plenty of opportunity to realise and fix your mistake.

A nice aspect of this I think is that it has ‘gradations of penalties’, 
through which it teaches you to be careful when committing and pushing 
changes.

Didn’t review what you were about to commit? You have to waste time 
doing the commit over. Only realise that you made a mistake after you 
made other commits? Go through the additional effort of altering your 
local history, or don’t bother. Still didn’t realise your mistake when 
you pushed? Either you get admin access to the central repo and inform 
the whole department that they need to re-pull their repos, or don’t 
bother. Even at this point it’s still possible, just the cost really 
starts to outweigh the benefit.

So I suppose you could even argue that lowering this cost of altering 
history could make people more careless in their commits :).

~Laurens

-- 
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6034 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110223/f4d2e328/attachment.bin>


More information about the Mercurial-devel mailing list