Conflict between Eclipse JGit and Cygwin HOME

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Tue Mar 17 06:19:47 GMT 2020


On 2020-03-16 19:03, Andrey Repin wrote:
> Greetings, David Karr!
> 
>> I've been running Cygwin on my Windows 10 laptop for quite a while.  I use
>> git in Eclipse and in the shell.
> 
>> What I'm describing isn't really a bug with Cygwin, but it breaks because
>> of the interaction with Cygwin, and I'm trying to find out a reasonable way
>> to fix this.
> 
>> Over the weekend, I upgraded Windows 10 from 1709 to 1809.  Somehow after
>> that I have messed up how git is used in Eclipse.
> 
>> The Eclipse JGit framework figures out where my git config is by checking
>> things in the following order:
> 
>> - 1. %HOME% if set,
>> - 2. %HOMEDRIVE%\%HOMEPATH%, if %HOMEDRIVE% is set,
>> - 3. %HOMESHARE% if set,
>> - 4. Java system property "user.home".
> 
>> The HOMEDRIVE, HOMEPATH, and HOMESHARE variables are set by my work
>> infrastructure, and I appear to have no control over them. The resulting
>> %HOMEDRIVE%\%HOMEPATH% doesn't even exist.
> 
> It should, that's nonsense. File an issue with your infrastructure team.
> 
>> The HOME variable is set by Cygwin, apparently.
> 
> No, it only set HOME if it is not set yet, and even then only for login
> shells.
> 
>> It is set to "/home/<myuid>".
> 
> What "myid" is supposed to mean? HOME is set to /home/$USER by default, but
> can be overridden with proper nsswitch configuration.
> 
>> I'm guessing that JGit looks at that and can't do
>> anything with it, so it goes down the list and doesn't find anything
>> useful. I end up with bad git config values.
> 
> Just install Git for Windows, but don't add it to %PATH% in any way, shape or
> form. Then configure Eclipse to use that git instead of Cygwin one.
> 
>> The workaround I've figured out is a batch file that sets HOME to the
>> expected Windows HOME, and then executes its command-line parameters.  I
>> changed the target property in the Eclipse shortcut to add the full path to
>> this batch file at the front of the command line, and then I have to find
>> the eclipse.exe file and get the desktop icon from it.  I'll have to do
>> this every time I install a new Eclipse distribution.
> 
> Start by solving the issue from its head.
> Fix your %HOMEDRIVE%/%HOMEPATH%/%HOMESHARE%, configure your nsswitch to point
> to an existing profile path.

You problem seems to be with your Windows network profile and Windows programs,
nothing to do with Cygwin.
Fixing the former will probably fix the latter.

But if your work infrastructure does not yet support W10 1809 (do you really
mean that release, not the current 1909 release?) you should not have upgraded,
and any breakage is down to you.

For Cygwin options see:

https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-desc

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.



More information about the Cygwin mailing list