git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH] diff: add --no-indicators option
Date: Fri, 19 Dec 2025 00:57:08 -0800	[thread overview]
Message-ID: <87qzsqaly3.fsf@gmail.com> (raw)
In-Reply-To: <pull.2133.git.git.1766132264231.gitgitgadget@gmail.com>

"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> Add --no-indicators to replace '+', '-', and ' ' indicators in the
> left margin with spaces. Colors are preserved, allowing diffs to be
> distinguished by color alone.
>
> This is useful when copy-pasting diff output, as the indicators no
> longer need to be manually removed.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
>     diff: add '--no-indicators' option
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2133%2FHaraldNordgren%2Fno-indicators-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2133/HaraldNordgren/no-indicators-v1
> Pull-Request: https://github.com/git/git/pull/2133
>
>  diff.c                 | 17 +++++++++++++++++
>  t/t4000-diff-format.sh | 32 ++++++++++++++++++++++++++++++++
>  2 files changed, 49 insertions(+)

Would a 'sed' command work for this? Something like:

    $ git diff --color=always HEAD~ \
        | sed -E '/^(\x1b\[[0-9;]*m)*(-{3} a|\+{3} b)/b
                  s/^((\x1b\[[0-9;]*m)*)[-+]/\1 /'

My impression is that indicators are wanted for diff's most (all?) of
the time.

Collin

  reply	other threads:[~2025-12-19  8:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  8:17 [PATCH] diff: add --no-indicators option Harald Nordgren via GitGitGadget
2025-12-19  8:57 ` Collin Funk [this message]
2025-12-19 11:48   ` Harald Nordgren
2025-12-19 13:28     ` Ben Knoble
2025-12-19 18:53       ` Harald Nordgren
2025-12-19 10:33 ` Phillip Wood
2025-12-19 11:46   ` Harald Nordgren
2025-12-19 14:27     ` Phillip Wood
2025-12-19 14:40       ` Chris Torek
2025-12-19 14:54         ` Harald Nordgren
2025-12-19 15:02           ` Chris Torek
2025-12-19 15:23             ` Harald Nordgren
2025-12-19 14:50       ` Harald Nordgren
2025-12-20 13:14         ` Johannes Sixt
2025-12-19 11:58 ` Junio C Hamano
2025-12-19 19:08   ` Harald Nordgren
2025-12-20  6:03     ` Junio C Hamano
2025-12-20 10:52       ` Harald Nordgren

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=87qzsqaly3.fsf@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=haraldnordgren@gmail.com \
    /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).