From: Eric Sunshine Date: Sat, 02 Mar 2024 10:25:26 GMT Subject: Re: [PATCH 2/2] diff: add 'diff.wordDiff' config option Message-ID: In-Reply-To: <20240302095751.123138-3-karthik.188@gmail.com> On Sat, Mar 2, 2024 at 4:58 AM Karthik Nayak 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 > --- > 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?