Re: [PATCH 2/2] diff: add 'diff.wordDiff' config option
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Mar 2, 2024, 18:02 UTC
- Message-ID
- <CAOLa=ZRsCaqT34JsAzaDrqF+gVQ1ZsLRQb3AbyU=qPgYAGO3WQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cRXtk0f=gMSkRka8mCFfT2=PKSBXMQGGhA3J_t=O_rpAA@mail.gmail.com>
On Sat, Mar 2, 2024 at 11:25 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 28 quoted lines
>
> On Sat, Mar 2, 2024 at 4:58 AM Karthik Nayak <karthik.188@gmail.com> wrote:
> > The git-diff(1) command supports the `--word-diff` which allows the
> > users to specify how to delimit word diffs. Provide this option also as
> > a config param 'diff.wordDiff'.
> >
> > Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
> > ---
> > diff --git a/diff.c b/diff.c
> > @@ -209,6 +210,23 @@ int git_config_rename(const char *var, const char *value)
> > +static int parse_word_diff_value(const char *value)
> > +{
> > + if (!value)
> > + return -1;
> > + else if (!strcmp(value, "plain"))
> > + return DIFF_WORDS_PLAIN;
> > + else if (!strcmp(value, "color")) {
> > + return DIFF_WORDS_COLOR;
> > + }
> > + else if (!strcmp(value, "porcelain"))
> > + return DIFF_WORDS_PORCELAIN;
> > + else if (!strcmp(value, "none"))
> > + return DIFF_WORDS_NONE;
> > +
> > + return -1;
> > +}
>
> Why is one arm surrounded by curly braces when none of the others are?Seems like I missed that one, if the patch series is being taken forward, I will fix it. Thanks