git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/6] diff.c: change the default for move coloring to zebra

From
Stefan Beller <sbeller@google.com>
Date
Jun 28, 2017, 19:54 UTC
Message-ID
<CAGZ79kY2qhaefcjFJLDAuhFB_ZngGw7bKnzv-hA-5hmCfH3KOA@mail.gmail.com>
In-Reply-To
<xmqq60fgztud.fsf@gitster.mtv.corp.google.com>
On Tue, Jun 27, 2017 at 8:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
>> diff --git a/diff.h b/diff.h
>> index 98abd75521..9298d211d7 100644
>> --- a/diff.h
>> +++ b/diff.h
>> @@ -192,6 +192,7 @@ struct diff_options {
>>               COLOR_MOVED_NO = 0,
>>               COLOR_MOVED_PLAIN = 1,
>>               COLOR_MOVED_ZEBRA = 2,
>> +             COLOR_MOVED_DEFAULT = 2,
>>               COLOR_MOVED_ZEBRA_DIM = 3,
>>       } color_moved;
>>  };
>
> Hmph.  I would have expected that COLOR_MOVED_DEFAULT would not be
> part of the enum, but a
>
>     #define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA
>
> I do not have a strong preference either way; it was just a bit
> unexpected.

Yes it is not as one would expect. Originally I thought it could buy us some more protection via smart static analysis (to be invented yet), but now I am not so sure any more. Changed it to the #define.

Thanks.
Previous: Junio C HamanoNext: Stefan Beller
Message 5 of 18 in “Fixing up sb/diff-color-moved”
  1. 0/6 Fixing up sb/diff-color-movedStefan Beller, Jun 28, 2017
  2. 1/6 diff.c: factor out shrinking of potential moved line blocksStefan Beller, Jun 28, 2017
  3. 2/6 diff.c: change the default for move coloring to zebraStefan Beller, Jun 28, 2017
  4. Junio C HamanoJun 28, 2017
  5. Stefan BellerJun 28, 2017
  6. 3/6 diff.c: better reporting on color.moved bogus configurationStefan Beller, Jun 28, 2017
  7. 4/6 Documentation/diff: reword color movedStefan Beller, Jun 28, 2017
  8. Junio C HamanoJun 28, 2017
  9. 5/6 diff.c: omit uninteresting moved linesStefan Beller, Jun 28, 2017
  10. Junio C HamanoJun 28, 2017
  11. Stefan BellerJun 28, 2017
  12. 6/6 diff.c: detect blocks despite whitespace changesStefan Beller, Jun 28, 2017
  13. Junio C HamanoJun 28, 2017
  14. Junio C HamanoJun 28, 2017
  15. Stefan BellerJun 28, 2017
  16. Junio C HamanoJun 28, 2017
  17. Stefan BellerJun 29, 2017
  18. Junio C HamanoJun 29, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.