-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
Windows 2008 R2 slave launched with cygwin ssh, cygwin git
The change to GitAPI.java in commit 13f6038acc4fa5b5a62413155da6fc8cfcad3fe0 seems to break the git plugin for Windows, at least in some circumstances. The syntax rev^
{commit} gets mangled by cmd because ^ is a quote character. This means that cmd passes rev{commit}to git, which as a cygwin executable being run from Windows, further tries to do wildcard expansion and maps this to revcommit. Putting "" around rev^
{commit} empirically seems to work, though I haven't tried it in the git plugin itself.This C fragment:
#include <stdio.h> int main(int argc, char* argv[]) { int i; for (i = 0; i < argc; ++i) { printf("%s\n", argv[i]); } return 0; }
when compiled with mingw to a native Windows application (a.exe) and invoked from cmd as a.exe a^{b} prints a{b}. When the same fragment is compiled with cygwin gcc to cygwin executable a.exe and is invoked the same way from cmd, it prints ab. Both print a^{b} when invoked from cmd as a.exe "a^{b}".
I'm not sure what the fix is here other than perhaps detecting that this is windows and putting quotes around the argument in Windows.
On another note, I left the Affects Version/s field blank. My Jenkins installation claims that it is using version 1.1.6. Looking at the git repo for the plugin, it appears that 1.1.6 should not have the ^{commit}
fix, yet running strings on plugins/git/WEB-INF/classes/hudson/plugins/git/GitAPI.class clearly shows that my git plugin has that change in it.
- duplicates
-
JENKINS-13007 Git plugin cannot find revision to build on Windows
-
- Closed
-
In case anyone is searching for this, I should mention that this problem manifests itself as this error message in the build output:
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
This is because the command "git rev-parse mastercommit" (in the case of the default, which is to use the master branch) is failing.