Diff at end of commit message

Uwe Brauer oub at mat.ucm.es
Thu Feb 22 21:35:42 UTC 2018


>>> "Stefan" == Stefan Schwarzer <sschwarzer at sschwarzer.net> writes:

    > When I commit a change, I edit the commit message in the
    > editor. Inside the editor, I like a diff of the changes
    > that are about to be committed.

    > I found out that I can set a template for the commit
    > message in my Mercurial configuration file under
    > `[committemplate]`. At the moment, I use

    > [committemplate]
    > changeset = {desc}\n
    >     HG: Enter commit message.  Lines beginning with 'HG:' are removed.
    >     HG: {extramsg}
    >     HG: --
    >     HG: user: {author}\n{ifeq(p2rev, "-1", "",
    >    "HG: branch merge\n")
    >    }HG: branch '{branch}'\n{if(activebookmark,
    >    "HG: bookmark '{activebookmark}'\n")   }{subrepos %
    >    "HG: subrepo {subrepo}\n"              }{file_adds %
    >    "HG: added {file}\n"                   }{file_mods %
    >    "HG: changed {file}\n"                 }{file_dels %
    >    "HG: removed {file}\n"                 }{if(files, "",
    >    "HG: no files changed\n")}
    >    HG: ------------------------ >8 ------------------------
    >    HG: Do not touch the line above.
    >    HG: Everything below will be removed.
    >    {diff()}

    > which I took from the `hgrc` manpage and added the `{diff()}`
    > at the end.

Thanks, I just tried that out, and indeed your template shows up in my
editor (gnuclient) which I use for those purpose.

But then how to you display your message, sorry for this elementary
question but I played a bit around and it is not really display. I must
miss here something obvious.




More information about the Mercurial mailing list