Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit requires bash?
JGit requires bash? [message #1655379] Sat, 07 March 2015 03:19 Go to next message
Eclipse Account is currently offline Eclipse AccountFriend
Messages: 2
Registered: March 2015
Junior Member
With jgit-3.7.0.201502260915-r the code fails:
Repository repo = FileRepositoryBuilder.create(dir);

Exception is
40 [main] ERROR org.eclipse.jgit.util.FS - Caught exception in FS.readPipe()
java.io.IOException: Cannot run program "bash" (in directory "C:\test"): CreateProcess error=2,
	at java.lang.ProcessBuilder.start(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at org.eclipse.jgit.util.FS.readPipe(FS.java:431)
	at org.eclipse.jgit.util.FS_Win32.discoverGitPrefix(FS_Win32.java:113)
	at org.eclipse.jgit.util.FS.gitPrefix(FS.java:517)
	at org.eclipse.jgit.util.SystemReader$Default.openSystemConfig(SystemReader.java:92)
	at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:171)
	at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:92)
	at org.eclipse.jgit.storage.file.FileRepositoryBuilder.create(FileRepositoryBuilder.java:110)

Can I use JGit without bash?
Re: JGit requires bash? [message #1681139 is a reply to message #1655379] Tue, 17 March 2015 07:29 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
In FS_Win32.java:113 JGit tries to find native git by running the command "which git" in a bash.
If native git isn't installed or bash or git aren't on the PATH then this command fails. JGit logs
an error to leave a trace that this attempt to find native git failed but will work ok anyway.

JGit tries to find native git in order to locate the system wide git configuration which is located
in a path relative to the native git installation. If it doesn't find a native git installation JGit can't
locate this system wide git configuration and hence will ignore it.
Re: JGit requires bash? [message #1694942 is a reply to message #1681139] Sun, 10 May 2015 03:26 Go to previous messageGo to next message
Eclipse Account is currently offline Eclipse AccountFriend
Messages: 2
Registered: March 2015
Junior Member
This issue seems fixed in
https://github.com/eclipse/jgit/commit/ec6ec3b10fb1ef8dd73a499d0b1f7a7d711b84dd

Thank you.
Re: JGit requires bash? [message #1695137 is a reply to message #1694942] Tue, 12 May 2015 08:56 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
correct, this fix avoids the unnecessary exception emitted earlier
Previous Topic:Can't push project to GitHub
Next Topic:Diff/Comparison from history for moved files does not work
Goto Forum:
  


Current Time: Thu Apr 25 21:14:07 GMT 2024

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

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

Back to the top