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

Re: [PATCH] add -p: introduce 'w' command to view hunk with --word-diff

From
Junio C Hamano <gitster@pobox.com>
Date
May 11, 2026, 00:16 UTC
Message-ID
<xmqqqznix0ko.fsf@gitster.g>
In-Reply-To
<CALnO6CCsOMyLxAhGW10L4duaahUORwedfmtdpY3zDGpQcZoP2Q@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 14 quoted lines
> I concur, though I wonder what other diff options would be useful. I
> can imagine a world where "add --patch" allows to reshow the patch
> with any set of custom options. Spitballing…
>
>      :show <opts>
>
> …could work, since we have room to allow long-form commands still.
> This could be extended to arbitrary git-* commands, and ":!cmd" could
> be used for shelling out.
> (Can you tell I use Vim?)
>
> Anyway, what I like about this is we don't have to worry about running
> out of (or thinking up new mnemonics for) single letters for different
> combinations of diff options, so it's a bit more extensible.

If you mean "don't waste a new letter, like 'w', every time you come up with a use case to show the patch hunk differently", I had the same reaction to suggest reusing 'p' but allow options after it, just like the output from "git diff" can be modified by giving it an option "--word-diff". But how would it work for single-key folks (I am not one of them so I have less sympathy than I should in this case, but still...).

Previous: D. Ben KnobleNext: D. Ben Knoble
Message 7 of 9 in “add -p: introduce 'w' command to view hunk with --word-diff”
  1. add -p: introduce 'w' command to view hunk with --word-diffJavier Bassi, May 6, 2026
  2. PabloMay 7, 2026
  3. Phillip WoodMay 7, 2026
  4. PabloMay 7, 2026
  5. Phillip WoodMay 7, 2026
  6. D. Ben KnobleMay 7, 2026
  7. Junio C HamanoMay 11, 2026
  8. D. Ben KnobleMay 11, 2026
  9. Junio C HamanoMay 12, 2026

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.