Thread (7 messages) 7 messages, 3 authors, 2025-05-02

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

From: Phillip Wood <hidden>
Date: 2025-05-02 14:39:45

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help