The following git command works in the Android Studio Terminal
git --no-pager show -s --format=\'%an <%ae>\' c1ff6aa
But it doesn\'t work whe
Use the "array" syntax to execute it:
groovy:000> ["git", "--no-pager", "show", "-s", "--format='%an <%ae>'"].execute().text
===> 'John Doe '
Without properly separated params there is some hickup and the command results in an error:
groovy:000> sout = new StringBuilder()
===>
groovy:000> serr = new StringBuilder()
===>
groovy:000> p="git --no-pager show -s --format='%an <%ae>'".execute()
===> java.lang.UNIXProcess@5dcb4f5f
groovy:000> p.consumeProcessOutput(sout,serr)
===> null
groovy:000> p.waitFor()
// XXX exit code!
===> 128
groovy:000> serr
// XXX error
===> fatal: ambiguous argument '<%ae>'': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'