Re: [PATCH v3 4/4] add-patch: add diff.context command line overrides
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 1, 2025, 09:59 UTC
- Message-ID
- <db172526-334f-404d-a9ea-530ec2e6e549@gmail.com>
- In-Reply-To
- <b68c58b667c29c66433b4634ad44ee9ec5257e80.1751128487.git.gitgitgadget@gmail.com>
Hi Leon
On 28/06/2025 17:34, Leon Michalak via GitGitGadget wrote:
Show 5 quoted lines
> From: Leon Michalak <leonmichalak6@gmail.com>
>
> +for cmd in add checkout restore 'commit -m file'
> +do
> + test_expect_success "${cmd%% *} accepts -U and --inter-hunk-context" "Looking at this again, I think the test bodies here and below should be wrapped in single quotes because they are passed to eval and we want to expand $cmd when the body is evaluated, not before. That would also simplify the quoting inside the tests as we don't need to escape double quotes. That's not your fault - you've just copied what I suggested before.
Show 5 quoted lines
> +test_expect_success 'The -U option overrides diff.context for "add"' ' > + test_config diff.context 8 && > + git add -U4 -p >output && > + test_grep ! "^ firstline" output > +'
Don't the tests above check this as they set diff.context and diff.interhunkcontext and pass different values to -U and --inter-hunk-context?
Thanks
Phillip