Simple git command i try to execute with java ProcessBuilder , working find when i run it in linux with results returned. this is the command :
git -C /home/mlxx log -1 "72xxxxxxxxe700d6bbe06" --pretty=format:"%s"
when i try to execute it in java
ProcessBuilder pb = new ProcessBuilder()
.command("git","-C","/home/mlxx","log","1","72xxxxxxxxe700d6bbe06","--pretty=format:\"%s\"").directory("/bin/bash");
The int exit = p.waitFor(); returns 128 error code
now according to this link : Start GitLog with Java Process Builder which face the same problem
i tried to do :
ProcessBuilder pb = new ProcessBuilder()
.command("/usr/bin","-c""git","-C","/home/mlxx","log","1","72xxxxxxxxe700d6bbe06","--pretty=format:\"%s\"")
The int exit = p.waitFor(); returns 1 error c0de
what is wrong here ?
other commands working just fine in linux via java?