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
May 2, 2025, 16:57 UTC
Message-ID
<xmqqfrhnuf06.fsf@gitster.g>
In-Reply-To
<CAP9jKjG+khoUmRpVJ8om-bs_qjB=VFCj3p3h0VSaBHVnqPLNVg@mail.gmail.com>
Leon Michalak <leonmichalak6@gmail.com> writes:
Show 6 quoted lines
> Inheriting the diff.context setting is what scratches my itch the most, although
> also being able to set the context in the command list of `add -i`
> sounds interesting too. Personally, I don't think I would use the
> command line overrides too much myself as most of the time (like with
> diff) I'd like to set the option and forget it but it does have a
> certain consistency to it.
Sounds good.
> Slightly off-topic to the discussion, but does anyone have advice on
> how to deal with providing a sentinel value for something like
> context?
Seeing in diff.c
    static int diff_context_default = 3;
    static int diff_interhunk_context_default;

that they are of signed type, and negative context would not make sense (would it???), wouldn't -1 be a good "they haven't touched this from the command line or configuration" value?

Previous: Leon MichalakNext: Leon Michalak
Message 10 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.