Bug 410568 - "/etc/gitconfig" not read by JGit
Summary: "/etc/gitconfig" not read by JGit
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 2.3   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 4.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-12 05:08 EDT by Jérôme de Vivie CLA
Modified: 2015-06-26 03:48 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme de Vivie CLA 2013-06-12 05:08:41 EDT
Hi,

In version "org.eclipse.jgit/2.3.1.201302201838-r", parameters defined in system configuration file "/etc/gitconfig" are not taken into account by jgit.  For example, "receive.denyNonFastForwards=true" is not honored.

The cmd line client "git" is installed under /usr/bin/git. We do not have any others installation of git on this machine. "git config -l" is able to read all these parameters.

My guess is that jgit is not able to find installation path of "git" but i don't know why?


BR
Jérôme
Comment 1 Robin Rosenberg CLA 2013-07-07 18:01:48 EDT
The man page for git says the system wide configuration is $(prefix)/etc/gitconfig, so that's how we look for it. 

This is apparently not true.
Comment 2 Robin Rosenberg CLA 2013-07-08 18:10:57 EDT
Meanwhile, set the system property jgit.gitprefix=/
Comment 3 Robin Rosenberg CLA 2013-08-10 17:00:07 EDT
Maybe I should add that I don't know a clean/reliable way of finding the prefix that the command line Git uses.
Comment 4 Sebastian Schuberth CLA 2015-05-21 07:42:17 EDT
FYI, I have a proposed fix for this pending at [1]. I'd appreciate a review.

[1] https://git.eclipse.org/r/#/c/48146/