Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » JGit requires bash?
JGit requires bash? [message #1655379] Fri, 06 March 2015 22:19 Go to next message
Eclipse UserFriend
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 03:29 Go to previous messageGo to next message
Eclipse UserFriend
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] Sat, 09 May 2015 23:26 Go to previous messageGo to next message
Eclipse UserFriend
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 04:56 Go to previous message
Eclipse UserFriend
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: Sat Nov 08 01:46:33 EST 2025

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

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

Back to the top