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

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

From
Chris Torek <chris.torek@gmail.com>
Date
Dec 19, 2025, 14:40 UTC
Message-ID
<CAPx1GvdNQbHY0avQ_Gt4bkLiuNHPW80E0v1vxrwyQYDD=zpc0g@mail.gmail.com>
In-Reply-To
<f141e335-9729-4f09-86b2-12a39f24837a@gmail.com>
On Fri, Dec 19, 2025 at 6:27 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 6 quoted lines
> If you want to restore some lines from a previous version of the file
> then it would be worth trying out "git restore -p" as Ben suggested. If
> there is some other use for this then it would be helpful to understand
> a bit more about it. I'm struggling to see why it would be useful to be
> able to copy and paste a mixture of insertions and deletions without the
> '+' and '-' indicators. ...

As someone who makes a lot of tpyos and hsa text that gets duplicaged because of copypasta duplicaged because of copypasta errors and on on (ahem), my personal preference tends towards:

    $ git show <rev1>:<path>  > file.oldver
    $ git show <rev2>:<path>  > file.newver
    $ vim file file.oldver file.newver

and then cut/paste old or new parts in the editor, rather than with a mouse that doesn't always get the proper edge points. The ability to "git show" specific versions of files is the key here.

(The patch modes of git add/restore are good for small things.)

Chris
Previous: Phillip WoodNext: Harald Nordgren
Message 9 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.