Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to change the location of the system configuration file?
How to change the location of the system configuration file? [message #750061] Tue, 25 October 2011 15:55 Go to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
Hi,

We seem to have a problem with line endings. Thousands of files show up dirty in the Synchronize view. In
http://dev.eclipse.org/mhonarc/lists/egit-dev/msg01732.html there's the advice to set core.autocrlf=false.

Unfortunately I can't seem to change the system config file at all. For reasons I can't remember anymore that file's
location is shown as C:\Program Files (x86)\Git\etc\gitconfig in Eclipse and that file is write protected.

How to change the location of the system configuration file?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to change the location of the system configuration file? [message #752681 is a reply to message #750061] Wed, 26 October 2011 13:32 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
AFAIK newer Windows versions are protecting files under "Program Files" so you need administrative privileges to change them and AFAIK there is no way to sudo from a Java application.

JGit tries to use the same location used by native git, in order to detect that it searches for git in the PATH. On my Mac this e.g. points at /usr/local/git. The system configuration is then stored in the etc folder under this path.

This means there are the following ways how you can resolve this configuration problem
- modify the system configuration using a native editor started with administrative privileges
- modify the user configuration in your home directory instead
- install native git into a not protected folder
- manually override the path to the git installation folder by setting the Java system property "jgit.gitprefix" to the path you want. But: this may lead to inconsistent behavior as this way native git might see a different configuration than EGit/JGit.

Unfortunately this probably will not solve your original problem as JGit doesn't yet fully support autocrlf [1].

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=301775
Re: How to change the location of the system configuration file? [message #753720 is a reply to message #752681] Fri, 28 October 2011 13:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
Am 26.10.2011 15:32, schrieb Matthias Sohn:
> AFAIK newer Windows versions are protecting files under "Program Files" so you need administrative privileges to
> change them and AFAIK there is no way to sudo from a Java application.
> JGit tries to use the same location used by native git, in order to detect that it searches for git in the PATH. On my
> Mac this e.g. points at /usr/local/git. The system configuration is then stored in the etc folder under this path.
> This means there are the following ways how you can resolve this configuration problem
> - modify the system configuration using a native editor started with administrative privileges
> - modify the user configuration in your home directory instead
Thanks for your explanations. I think I'll go this route.

> - install native git into a not protected folder
> - manually override the path to the git installation folder by setting the Java system property "jgit.gitprefix" to
> the path you want. But: this may lead to inconsistent behavior as this way native git might see a different
> configuration than EGit/JGit.
>
> Unfortunately this probably will not solve your original problem as JGit doesn't yet fully support autocrlf [1].
>
> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=301775
Okay, it seems as if there's some progress. When the fix is on the nightly site, will we have to create new clones?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to change the location of the system configuration file? [message #753867 is a reply to message #753720] Sat, 29 October 2011 17:25 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Eike Stepper skrev 2011-10-28 15.45:
> Am 26.10.2011 15:32, schrieb Matthias Sohn:
>> AFAIK newer Windows versions are protecting files under "Program Files" so you need administrative privileges to change them and AFAIK there is no way to sudo from a Java
>> application.
>> JGit tries to use the same location used by native git, in order to detect that it searches for git in the PATH. On my Mac this e.g. points at /usr/local/git. The system
>> configuration is then stored in the etc folder under this path.
>> This means there are the following ways how you can resolve this configuration problem
>> - modify the system configuration using a native editor started with administrative privileges
>> - modify the user configuration in your home directory instead
> Thanks for your explanations. I think I'll go this route.
>
>> - install native git into a not protected folder
>> - manually override the path to the git installation folder by setting the Java system property "jgit.gitprefix" to the path you want. But: this may lead to inconsistent
>> behavior as this way native git might see a different configuration than EGit/JGit.

Java has a preferences API, maybe we should use that instead of the Eclipse preferences? That way both
Eclipse and command line JGit would see the same setting.

>> Unfortunately this probably will not solve your original problem as JGit doesn't yet fully support autocrlf [1].
>>
>> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=301775
> Okay, it seems as if there's some progress. When the fix is on the nightly site, will we have to create new clones?

That should not be necessary. You might want to test-drive the patch yourself, building
the plugin using maven isn't hard. Pointing Eclipse to the update site is probably the hardest part :)

If you do test it, please try to make it fail. We are people that insist on
hearing bad news immediately.

-- robin
Previous Topic:Synchronize view hangs
Next Topic:Potential Locking Issue on Project Import
Goto Forum:
  


Current Time: Tue Mar 19 07:02:37 GMT 2024

Powered by FUDForum. Page generated in 0.02962 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top