Patchwork [8,of,8,git-diff] patch: add label for coloring the similarity extended header

login
register
mail settings
Submitter Sean Farley
Date Jan. 9, 2017, 7:49 p.m.
Message ID <0ac83cc1715c18537e3f.1483991381@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/18152/
State Accepted
Headers show

Comments

Sean Farley - Jan. 9, 2017, 7:49 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1483988505 28800
#      Mon Jan 09 11:01:45 2017 -0800
# Node ID 0ac83cc1715c18537e3f8087d32544db25cd29d0
# Parent  57b97693c687ab32b57bd3a75311237106992de9
patch: add label for coloring the similarity extended header

Just like the summary says, this will colorize the:

  similarity index 88%

line in the diff output.
Pierre-Yves David - Jan. 13, 2017, 9:24 a.m.
On 01/09/2017 08:49 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean@farley.io>
> # Date 1483988505 28800
> #      Mon Jan 09 11:01:45 2017 -0800
> # Node ID 0ac83cc1715c18537e3f8087d32544db25cd29d0
> # Parent  57b97693c687ab32b57bd3a75311237106992de9
> patch: add label for coloring the similarity extended header
>
> Just like the summary says, this will colorize the:
>
>   similarity index 88%
>
> line in the diff output.

These one are pushed, thanks.

What's your plan regarding getting the options out of experimental ?
Sean Farley - Jan. 13, 2017, 11:30 p.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> On 01/09/2017 08:49 PM, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean@farley.io>
>> # Date 1483988505 28800
>> #      Mon Jan 09 11:01:45 2017 -0800
>> # Node ID 0ac83cc1715c18537e3f8087d32544db25cd29d0
>> # Parent  57b97693c687ab32b57bd3a75311237106992de9
>> patch: add label for coloring the similarity extended header
>>
>> Just like the summary says, this will colorize the:
>>
>>   similarity index 88%
>>
>> line in the diff output.
>
> These one are pushed, thanks.
>
> What's your plan regarding getting the options out of experimental ?

That's a good question. Now that these have mostly landed, my first step
is to finish some of magit port to hg and play with that. At the very
least, if that goes well, then:

- add documentation to hg about these options
- potentially unify them? (--config diff.git_pedantic=True?)
- turn these config options on in my emacs thing (currently called
  'hugme')

Future ideas:

- add these options to friendly hg?
- something crazy like always turning them on? no idea

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2348,10 +2348,11 @@  def difflabel(func, *args, **kw):
                     ('rename', 'diff.extended'),
                     ('old', 'diff.extended'),
                     ('new', 'diff.extended'),
                     ('deleted', 'diff.extended'),
                     ('index', 'diff.extended'),
+                    ('similarity', 'diff.extended'),
                     ('---', 'diff.file_a'),
                     ('+++', 'diff.file_b')]
     textprefixes = [('@', 'diff.hunk'),
                     ('-', 'diff.deleted'),
                     ('+', 'diff.inserted')]