[PATCH v2 1/2] Allow deriving the current user's home directory via the HOME variable

Johannes Schindelin Johannes.Schindelin@gmx.de
Fri Nov 18 08:18:17 GMT 2022


Hi Corinna,

On Thu, 10 Nov 2022, Corinna Vinschen wrote:

> On Nov 10 16:16, Johannes Schindelin wrote:
>
> > On Mon, 24 Oct 2022, Corinna Vinschen wrote:
> >
> > > On Oct 23 23:04, Johannes Schindelin wrote:
> > > > On Tue, 18 Oct 2022, Corinna Vinschen wrote:
> > > > [...]
> > > > > That means, the results from the "env" method is equivalent to the
> > > > > "windows" method, just after checking $HOME.  That's a bit of a downer.
> > > > >
> > > > > Assuming the "env" method would *only* check for $HOME, the user would
> > > > > have the same result by simply setting nsswitch.conf accordingly:
> > > > >
> > > > >   home: env windows
> > > >
> > > > Except when the domain controller is (temporarily) unreachable, e.g. when
> > > > sitting in a train with poor or no internet connection. Then that latter
> > > > approach would have the "benefit" of having to wait 10-15 seconds before
> > > > the network call says "nope".
> > > >
> > > > This particular issue has hit enough Git for Windows users that I found
> > > > myself being forced to implement these patches and run with them for the
> > > > past seven years.
> > > >
> > > > Given the scenario of an unreachable domain controller, I hope you agree
> > > > that the `env` support added in the proposed patches _has_ merit.
> > >
> > > Yes, I don't doubt an `env' method checking for $HOME even a bit.
> >
> > Cool!
> >
> > > I'm just not sure as far as HOMEDRIVE/HOMEPATH/USERPROFILE are
> > > concerned.  Those vars should be left alone, but we can't control that,
> > > so reading them from genuine sources is preferred.
> >
> > I do not recall the exact reasons because it has been a good while since I
> > worked on these patches. But I do remember that we had to have a fall-back
> > for the many scenarios in Git for Windows where `HOME` is not even set,
> > and we specifically had to add HOMEDRIVE/HOMEPATH handling because
> > USERPROFILE alone would lead to problems (IIRC there were plenty of
> > corporate setups where USERPROFILE pointed to a potentially-disconnected
> > network drive).
> >
> > > Sure, the downside in terms of the LDAP server is clear to me
> > >
> > > So I guess it's ok to allow the env method to read the values of those
> > > vars from the env.  I would just feel better if we urge the
> > > user to set $HOME and read that exclusively.
> >
> > I would feel better about that, too, if it was practical.
> >
> > But I cannot ask millions of Git for Windows users to please go ahead and
> > first configure their `HOME` variable correctly, it took much less time to
> > implement the patch we're discussing than asking all users individually
> > ;-)
> >
> > And since there is nothing specific about Git for Windows here, I expect
> > Cygwin users to benefit from this feature, too.
> >
> > With this context in mind, I would like to ask to integrate the patch
> > as-is, including the HOMEDRIVE/HOMEPATH and USERPROFILE fall-backs.
>
> Can't do that, sorry.  Two replies before I sent a necessary change,
> which needs inclusion first.

I am a bit confused. Do you need anything from me to move this along, i.e.
are those two replies you mention some emails I failed to address yet?

Thanks,
Dscho


More information about the Cygwin-patches mailing list