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

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

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
May 2, 2025, 14:39 UTC
Message-ID
<bf7f6606-e719-4c3d-b7ab-ef7351f66f37@gmail.com>
In-Reply-To
<CAP9jKjGb-Rcr=RLJEzeFdtrekYM+qmHy+1T1fykU3n9cV4GhGw@mail.gmail.com>
On 29/04/2025 10:16, Leon Michalak wrote:
> 
> (https://stackoverflow.com/questions/6711670/git-show-more-context-when-using-git-add-i-or-git-add-e)
> which mentions you can do `GIT_DIFF_OPTS=-u<number> git add -p` which
> does work however isn't very user friendly or convenient.

This is a question for others on the list rather than Leon - is it intentional that the plumbing diff commands respect GIT_DIFF_OPTS? If a script that wants to create a diff with a certain number of context lines runs `git diff-index -U <context>` is it helpful for that to be overridden if GIT_DIFF_OPTS happens to be set in the environment? Looking at the history it seems that environment variable used to be the only way to override the default context setting but that's not the case now.

Best Wishes
Phillip
Previous: Phillip WoodNext: Leon Michalak
Message 7 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.