Re: [PATCH 3/5] ssh: 'auto' variant to select between 'ssh' and 'simple'
From: Jonathan Nieder <hidden>
Date: 2017-10-23 23:13:07
Brandon Williams wrote:
On 10/23, Jonathan Nieder wrote:
quoted
Separately from how to document it, what do you think a good behavior would be? Should the "auto" configuration trigger command line based detection just like no configuration at all? Should the "auto" value for configuration be removed and that behavior restricted to the no-configuration case? I'm tempted to go with the former, which would look like the following. What do you think?As a user having some variant as 'auto' doesn't make much sense, i mean isn't that exactly what the default behavior is? Check if my ssh command matches existing variants and go with that. What you are proposing is the make the existing auto detection better (yay!) though I don't know if it warrants adding a new variant all together. Instead it may be better to stick this new improved detection at the end of the existing variant discovery function 'determine_ssh_variant()' as a last ditch effort to figure out the variant. That way we don't have an extra variant type that can be configured and eliminates some of the additional code in the switch statements to handle that enum value (though that isn't really that big of a deal).
Yes, if git config allowed e.g. ".git/config" to unset a setting from
e.g. "/etc/gitconfig", then I wouldn't want the 'auto' value to exist
in configuration at all. But because git's config language doesn't
have a way to unset a variable, this series provided "auto" as a way
to explicitly request the same behavior as unset.
In that spirit, the patch I sent was broken ("auto" meant something
different from unset), so thanks for pointing the issue out.
Sensible?
Jonathan