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

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

Previous: Eric SunshineNext: Jean-Noël AVILA
Message 6 of 17 in “Allow setting diff.worddiff=color via gitconfig”
  1. Olliver SchinaglFeb 28, 2024
  2. 0/2 Support diff.wordDiff configKarthik Nayak, Mar 2, 2024
  3. 1/2 t4034: extract out `diff_with_opts`Karthik Nayak, Mar 2, 2024
  4. 2/2 diff: add 'diff.wordDiff' config optionKarthik Nayak, Mar 2, 2024
  5. Eric SunshineMar 2, 2024
  6. Karthik NayakMar 2, 2024
  7. Jean-Noël AVILAMar 2, 2024
  8. Junio C HamanoMar 2, 2024
  9. Karthik NayakMar 2, 2024
  10. Kristoffer HaugsbakkMar 2, 2024
  11. Chris TorekMar 3, 2024
  12. Junio C HamanoMar 3, 2024
  13. Olliver SchinaglMar 22, 2024
  14. Dragan SimicMar 25, 2024
  15. Olliver SchinaglMar 22, 2024
  16. Olliver SchinaglMar 22, 2024
  17. Olliver SchinaglMar 22, 2024

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.