Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': No
JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': No [message #1713972] Mon, 09 November 2015 08:55 Go to next message
Anselm D. is currently offline Anselm D.Friend
Messages: 49
Registered: October 2015
Member
Hi,

I am using jgit-cli at a linux system:

$java -jar ~/jgit-cli.jar config --list
ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': No such file or directory

after that the "config list" is displayed.
Which configuration file jgit expects?

[Updated on: Mon, 09 November 2015 09:03]

Report message to a moderator

Re: JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': N [message #1713986 is a reply to message #1713972] Mon, 09 November 2015 09:43 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
which jgit version are you using ?
Re: JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': N [message #1713987 is a reply to message #1713972] Mon, 09 November 2015 09:44 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
In a "jgit config --list" command jgit has to look at three different locations for config files and merge them together.

1) the $GIT_DIR/config file for the repo you are currently in.
2) the "global" settings in your home directory: $HOME/.gitconfig
3) the system settings. This file is located at a platform specific place. On my unix platform it is /etc/gitconfig and on my windows box it is c:\Program Files\Git\mingw64\etc\gitconfig. JGit determines the location of this file by executing "GIT_EDITOR=echo git config --system --edit". What does your platform return when you run this command in a bash?

It seems that in your case jgit thinks it should search for the system wide config file at /usr/local/git/etc/gitconfig but this directory does not exist. Right?


Ciao
Chris
Re: JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': N [message #1715732 is a reply to message #1713987] Wed, 25 November 2015 14:44 Go to previous messageGo to next message
Anselm D. is currently offline Anselm D.Friend
Messages: 49
Registered: October 2015
Member
Thank you for the explanation.

I recognized the configuration has "multi stages". For trouble shooting I am looking for tool support so i do not to have to find each file and to have a look at them separately (especially when i am moving between different git implementations and Operating Systems).

I would like to know, which config entry is used and from which stage (repo config file/global/system) it is taken/overwritten and where the config files are stored. Additional i would like to know, what are the default values and which configuration entries are supported from the git/jgit version i am using.

A subset of my wishes should be done by config --list, but for jgit-cli it fails, if a configuration file (or a repository config file) is missing.

At my windows system git (scm) says:
System (does not exist): C:/Program Files/Git/mingw64/etc/gitconfig"
Global: "D:/Users/xyzzy/.gitconfig"

git at linux:
global: ~/.gitconfig

git config --system --edit
fatal: Could not switch to '/usr/local/git/etc/': No such file or directory

for my windows and a Linux system:
jgit-cli: config --list
fatal: error: can't find git directory

jgit-cli: config --global edit
fatal: error: can't find git directory


Re: JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': N [message #1715853 is a reply to message #1715732] Thu, 26 November 2015 16:10 Go to previous messageGo to next message
Anselm D. is currently offline Anselm D.Friend
Messages: 49
Registered: October 2015
Member
However, it is not important, hopefully i have the rights to create an empty file.
Re: JGIT-CLI@linux config --list: ERROR FS:512 - fatal: Could not switch to '/usr/local/git/etc/': N [message #1715882 is a reply to message #1715853] Fri, 27 November 2015 08:00 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
Ideally you should not have to look at different config files when switching implementations. Our goal is that JGit looks at exactly the same files as native git. The document defining this is https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES. Whenever we look with JGit at different files I think thats a bug and should be fixed if possible. But JGit developers have the same problem: How to determine the path of e.g. the system wide config file when running on windows. For that JGit calls "GIT_EDITOR=echo git config --system --edit" to determine that path.
Currently JGit doesn't support to tell you from which config file a certain effective config setting was taken. JGit doesn't even tell you where systemConfig and globalConfig are located. But this could be added. Maybe you want to contribute that? Extensions to FileBasedConfig.java could reveal the base config file for a certain config. And an utility method based on that could determine from where a certain config setting is taken.


Ciao
Chris
Previous Topic:JGIT/EGIT@Windows/NTFS; duplicate tags / case insensitive
Next Topic:EGIT/GIT Eclipse contribution : difficulties with setup
Goto Forum:
  


Current Time: Tue Apr 23 08:19:52 GMT 2024

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

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

Back to the top