Re: [PATCH v2 1/2] sequencer: fix gpg option passed to merge subcommand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phillip Wood <phillip.wood123@xxxxxxxxx> writes:

>>   +test_expect_success 'rebase -r, GPG and merge strategies' '
>> +	git reset --hard merged &&
>> +	git rebase -fr --gpg-sign -s resolve --root &&
>> +	git verify-commit HEAD
>> +'
>
> Unfortunately I've just noticed that the test above runs
>
> 	git config commit.gpgsign true
>
> So this test would pass anyway if merge picks up that config
> setting. The previous test needs to be changed to
>
> 	test_config commit.gpgsign true
>
> so that the config setting is cleared when that test finishes.

Thanks for a review, but I do not think that is a right way to go.

test_config has an inherent assumption that not having the config at
all is somehow the "natural" state, and if that holds true, that
would be OK.  But what is "natural" is subjective X-<.

The way each test is run by calling test_rebase_gpg_sign repeatedly
uses a different and more robust approach to ensure that previous
test does not affect the current one.  Each invocation of test
explicitly sets the configuration to the state the test wants to,
cancelling what the previous test did.

To blend in better with existing tests and match their robustness
expectations, the right fix is for this new test to explicitly use
"git config --set" or "git config --unset" to make the variable into
the desired state, regardless of what the previous tests did.  

If the test quoted at the beginning of this message wants to make
sure that --gpg-sign from the command line takes effect without
commit.gpgsign set, it should unset the variable explicitly.
Another combination worth testing is to ensure that --gpg-sign takes
effect when commit.gpgsign is explicitly set to false (not "left
unset").

Thanks.






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux