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

Re: Discussion for interactive --patch commands to get --unified support

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2025, 14:40 UTC
Message-ID
<xmqqo6wd3e7v.fsf@gitster.g>
In-Reply-To
<CAP9jKjF5suY6mx19knKwWAEHrTJ_meWhktOuMTFixq0hmFsjuA@mail.gmail.com>
Leon Michalak <leonmichalak6@gmail.com> writes:
Show 5 quoted lines
> With all that being said, I propose the following:
> - inheriting `diff.context` and `diff.interhunkcontext` as the
> defaults for the various interactive/patch commands
> - be able to override these defaults on the command line with
> `-U<n>/--unified=<n>` and `--inter-hunk-context=<n>` respectively

I think the usage pattern when people use "add -p" and "diff" are different (with "add -p", you get only one hunk at a time, and you may want a bit wider context to avoid getting disoriented, for example) and I agree that it may be useful to be able to specify different context lengths for them, which the above should cover nicely.

Previous: Leon MichalakNext: Phillip Wood
Message 5 of 12 in “Discussion for interactive --patch commands to get --unified support”
  1. Leon MichalakApr 29, 2025
  2. Junio C HamanoApr 29, 2025
  3. Jeff KingApr 29, 2025
  4. Leon MichalakApr 30, 2025
  5. Junio C HamanoApr 30, 2025
  6. Phillip WoodMay 2, 2025
  7. Phillip WoodMay 2, 2025
  8. Leon MichalakMay 2, 2025
  9. Leon MichalakMay 2, 2025
  10. Junio C HamanoMay 2, 2025
  11. Leon MichalakMay 2, 2025
  12. Junio C HamanoMay 2, 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.