make `view diff on commit` a feature that is easy to use
Olle
olle.lundberg at gmail.com
Wed Nov 5 13:35:21 UTC 2014
On Tue, Nov 4, 2014 at 9:50 PM, anatoly techtonik <techtonik at gmail.com>
wrote:
> I always do `hg diff` before `hg ci` (sometimes also `hg sum/st`),
> which is very clumsy, so I went to see if something is already
> available.
>
> vim-only
>
> https://stackoverflow.com/questions/8009333/vim-show-diff-on-commit-in-mercurial
> http://mercurial.selenic.com/wiki/DiffsInCommitMessageInVIM
>
> bash-only
> http://mercurial.selenic.com/wiki/hgeditor
>
>
> I've tried to bring my own solution with temporary file, but the
> diff with prepended HG: loses syntax highlighting. So, to make
> this feature more useful, maybe these two things are possible
> to implement:
>
> 1. remove all lines after HG: block, i.e.
> -HG: Enter commit message. Lines beginning with 'HG:' are removed.
> -HG: Leave message empty to abort commit.
> +HG: Enter commit message. Lines beginning with 'HG:' and any text
> +HG: after are removed. Leave message empty to abort commit.
>
> 2. hg commit -v to show diff
> hg commit -vv to show diff + diffstat
> (grabbed the idea from SO comment above)
>
I actually started to implement this a while ago, but never got to
incorporate the changes suggested by mpm:
http://selenic.com/pipermail/mercurial-devel/2013-December/055311.html
> This way the editor can use the full diff highlight and you can copy
> paste things from it also.
>
>
> This looks like a killer feature to me. Is it why hgeditor is located in
> the root of Mercurial repository and not in contrib/ ?
> --
> anatoly t.
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
--
Olle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20141105/d1fd86fe/attachment-0002.html>
More information about the Mercurial
mailing list