git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: oliver@schinagl.nl, git@vger.kernel.org
Subject: Re: [PATCH 2/2] diff: add 'diff.wordDiff' config option
Date: Sat, 2 Mar 2024 05:25:26 -0500	[thread overview]
Message-ID: <CAPig+cRXtk0f=gMSkRka8mCFfT2=PKSBXMQGGhA3J_t=O_rpAA@mail.gmail.com> (raw)
In-Reply-To: <20240302095751.123138-3-karthik.188@gmail.com>

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?

  reply	other threads:[~2024-03-02 10:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28  8:54 Allow setting diff.worddiff=color via gitconfig Olliver Schinagl
2024-03-02  9:57 ` [PATCH 0/2] Support diff.wordDiff config Karthik Nayak
2024-03-02  9:57   ` [PATCH 1/2] t4034: extract out `diff_with_opts` Karthik Nayak
2024-03-02  9:57   ` [PATCH 2/2] diff: add 'diff.wordDiff' config option Karthik Nayak
2024-03-02 10:25     ` Eric Sunshine [this message]
2024-03-02 18:02       ` Karthik Nayak
2024-03-02 19:57     ` Jean-Noël AVILA
2024-03-02 17:03   ` [PATCH 0/2] Support diff.wordDiff config Junio C Hamano
2024-03-02 18:02     ` Karthik Nayak
2024-03-02 19:57       ` Kristoffer Haugsbakk
2024-03-03  7:23         ` Chris Torek
2024-03-03 17:45           ` Junio C Hamano
2024-03-22 22:08             ` Olliver Schinagl
2024-03-25 21:53               ` Dragan Simic
2024-03-22 22:05           ` Olliver Schinagl
2024-03-22 21:59       ` Olliver Schinagl
2024-03-22 21:57     ` Olliver Schinagl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cRXtk0f=gMSkRka8mCFfT2=PKSBXMQGGhA3J_t=O_rpAA@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=oliver@schinagl.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).