protect against accidental repeated commit?

Frank A. Kingswood frank at kingswood-consulting.co.uk
Tue Oct 18 15:05:12 UTC 2011


On 18/10/11 03:21, Cameron Simpson wrote:
> I've just made the same mistake twice in as many days: accidentally
> commited with the wrong log message.
>
> My coding setup tends to be an editor window on the left and a shell for
> testing and committing on the right. So the shell command history
> usually has a lot of:
>
>    dev python -m my-module
> and
>    hg commit -m 'my-module: fribbed with the whatsit'
>
> in it. During the test phase I'll frequently rerun the test command by
> just typing ^P and pressing Return.

If you're running bash then setting

HISTIGNORE="hg commit *:hg ci *"

might help.

(You might also want to add ":rm \*:rm -r \*")

Frank



More information about the Mercurial mailing list