Re: [showing-off RFC/PATCH 26/26] diff.c: have a "machine parseable" move coloring
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 21, 2017, 21:55 UTC
- Message-ID
- <xmqqh8z9m2ed.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170621215104.GF53348@google.com>
Brandon Williams <bmwill@google.com> writes:
Show 21 quoted lines
> On 06/19, Stefan Beller wrote: >> Ævar asked for it, this is how you would do it. >> (plus documentation, tests, CLI knobs, options) >> >> Signed-off-by: Stefan Beller <sbeller@google.com> >> --- >> diff.c | 15 +++++++++++---- >> diff.h | 2 ++ >> 2 files changed, 13 insertions(+), 4 deletions(-) >> >> diff --git a/diff.c b/diff.c >> index 7756f7610c..61caa057ff 100644 >> --- a/diff.c >> +++ b/diff.c >> @@ -997,6 +997,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, >> static const char *nneof = " No newline at end of file\n"; >> const char *context, *reset, *set, *meta, *fraginfo; >> struct strbuf sb = STRBUF_INIT; >> + int sign; > > should this be a char instead of an int?
Perhaps. Once we start adding things other than + and -, I think they should no longer be called "sign", though.
If Stefan chose '*' as a replacement for '+' because both makes things larger (yes, I am a positive person and my numbers are all positive), probably the replacement for '-' should be '/' (or '%'), not '_'. But that is just bikeshedding.