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

Re: [PATCH] diff: add --no-indicators option

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2025, 11:58 UTC
Message-ID
<xmqq8qeywuno.fsf@gitster.g>
In-Reply-To
<pull.2133.git.git.1766132264231.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 8 quoted lines
> 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.

If you are cutting more than two lines, then the first column, whether it is '+' or neutered ' ', needs to be removed. And even if you are cutting just one line, you'd still need to deal with the byte in the first column, whether it is '+' or ' ', by either cutting from the second column or removing the first column after pasting.

Also, if your terminal emulator allows cutting from Nth column to the right (e.g., "screen" allows this), it does not matter what the first letter is. You can just say "cut from the 2nd column" and you are done.

So, I am not sure if this is something we want to support. Are there other people's "diff" implementations (like GNU or BSD) that has something like that? If not, it takes a lot more to convince others.

Previous: Johannes SixtNext: Harald Nordgren
Message 15 of 18 in “diff: add --no-indicators option”
  1. diff: add --no-indicators optionHarald Nordgren via GitGitGadget, Dec 19, 2025
  2. Collin FunkDec 19, 2025
  3. Harald NordgrenDec 19, 2025
  4. Ben KnobleDec 19, 2025
  5. Harald NordgrenDec 19, 2025
  6. Phillip WoodDec 19, 2025
  7. Harald NordgrenDec 19, 2025
  8. Phillip WoodDec 19, 2025
  9. Chris TorekDec 19, 2025
  10. Harald NordgrenDec 19, 2025
  11. Chris TorekDec 19, 2025
  12. Harald NordgrenDec 19, 2025
  13. Harald NordgrenDec 19, 2025
  14. Johannes SixtDec 20, 2025
  15. Junio C HamanoDec 19, 2025
  16. Harald NordgrenDec 19, 2025
  17. Junio C HamanoDec 20, 2025
  18. Harald NordgrenDec 20, 2025

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.