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

Re: [PATCH] diff.c: offer config option to control ws handling in move detection

From
Stefan Beller <sbeller@google.com>
Date
Jul 19, 2018, 18:00 UTC
Message-ID
<CAGZ79kYo_zFfvX1LHod47BND=GbmzeaBfxhLbX_nmCPx0UATZQ@mail.gmail.com>
In-Reply-To
<xmqq601bgmh3.fsf@gitster-ct.c.googlers.com>
On Thu, Jul 19, 2018 at 10:32 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
>
> Stefan Beller <sbeller@google.com> writes:
>
> > "git format-patch HEAD^ --color" produces red/green output
> > (like git log would), so I do not see why --color-moved should impact
> > format-patch differently. (i.e. if the user requests format-patch with
> > color-moved we can do it, otherwise, when colors are off, we do not
> > spend cycles to compute the moves)
> >
> > Maybe I did not understand the gist of your question, still?
>
> "format-patch --color" done by end-user, especially when combined
> with "--stdout", would be useful to show coloured output.  That is
> what you are talking about in the above, but that is not what I was
> asking about.
>
> The question was specifically about configuration.  You may say
> "diff.colorwhatever = on", but "git format-patch" with no command
> line override wouldn't want to be affected by that and produce a
> patch that won't apply, I would think.

The options introduced here (even the command line arguments) do *nothing* if no color is on, i.e.

    git diff --no-color --color-moved=blocks \
        --color-moved-ws=allow-indentation-change
is the same as
    git diff --no-color

and as format-patch doesn't use colors by default giving color-moved settings (even via config) is a no-op, too?

Stefan
Previous: Junio C Hamano
Message 7 of 7 in “diff.c: offer config option to control ws handling in move detection”
  1. diff.c: offer config option to control ws handling in move detectionStefan Beller, Jul 18, 2018
  2. Junio C HamanoJul 18, 2018
  3. Stefan BellerJul 18, 2018
  4. Junio C HamanoJul 19, 2018
  5. Stefan BellerJul 19, 2018
  6. Junio C HamanoJul 19, 2018
  7. Stefan BellerJul 19, 2018

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.