How do I customize the 'commit message file' generated by `hg commit`?

后端 未结 6 560
星月不相逢
星月不相逢 2021-01-17 22:14

When I run hg commit, Mercurial generates a file for my commit message that looks like this :

HG: Enter commit message.  Lines beginning with \'         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 22:34

    A Mac/Linux variant of Jim Eggleston's answer... I made a script called hg-commit-editor:

    #!/bin/sh
    hg status --unknown | sed -e 's|^|HG: |' >> $1
    editor $1
    

    and then set it as my commit editor in my hgrc:

    [ui]
    editor = hg-commit-editor
    

提交回复
热议问题