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, 18:36 UTC
Message-ID
<xmqqbjsavp0a.fsf@gitster.g>
In-Reply-To
<CAP9jKjEbb_ABmGmLNwn=ruh+BOR73QDqtzF-cCYv40cE47fEGQ@mail.gmail.com>
Leon Michalak <leonmichalak6@gmail.com> writes:
> This is what I have been using currently although the perfectionist in
> me says that a user could pass `--unified=-1` and the code would treat
> that as if nothing was passed by the user.

The command line parser and corresponding config parser callback can be careful to check the value they get from the end user to avoid that, can't they?

In any case, it is PEBKAC when the end-users do that, and they cannot complain about their --unified=-1 are ignored. We do not have to care, and can just tell them "Don't do that, then."

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