Re: [PATCH 07/14] t7800-difftool.sh: Fix a test failure on Cygwin

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

 



Junio C Hamano wrote:
> David Aguilar <davvid@xxxxxxxxx> writes:
> 
>>> diff --git a/git-difftool.perl b/git-difftool.perl
>>> index e95e4ad..ced1615 100755
>>> --- a/git-difftool.perl
>>> +++ b/git-difftool.perl
>>> @@ -52,6 +52,7 @@ sub generate_command
>>>  	my @command = (exe('git'), 'diff');
>>>  	my $skip_next = 0;
>>>  	my $idx = -1;
>>> +	my $prompt = '';
>> Would it be simpler to set $prompt = 1 and then
>> flip it to 0 when -y | or --no-prompt is supplied?
>> ...
>>
>> This would become:
>>
>> 	if ($prompt) {
>> 		...
>> 	}
>> 	else {
>> 		...
>> 	}
> 
> But that is not what the patch does, is it?
> 
> Isn't it more like initializing $prompt to undef and then the above
> condition becomes:
> 
> 	if (!defined $prompt) {
>         	; # nothing
>         elsif ($prompt) {
> 		setenv PROMPT true
> 	} else {
> 		setenv NO_PROMPT true
> 	}
> 
> no?

Yes. :-P
At least that is what I was aiming for.

In particular, if none of -y, --no-prompt or --prompt is passed on
the command-line, I don't want to set either key in the hash.
(Or, to put it another way, I don't want to change the behaviour
in this case, where neither variable is set in the environment
of the helper script)

ATB,
Ramsay Jones



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]