[Buildbot-devel] ShellCommand is failing when running with certain parameter

Johannes Ring johannr at simula.no
Wed Aug 21 12:48:02 UTC 2013


On Wed, Aug 21, 2013 at 2:36 PM, Maria Marcano
<mariangemarcano at gmail.com> wrote:
> The following command is failing
>
> factory.addStep(ShellCommand(command=['git', 'log', '--format=%H', '-1',
> '--'], workdir="build/gitrepo"))
>
> with the error
>
>  fatal: invalid --pretty format: H
>
> the error occurs on windows 7 machine, it doesn't happen when it runs on
> mac.
>
>
> if I run the command in a terminal on windows 7 git log --format=%H -1 --
>
> it doesn't fail, it looks like the issue is the parameter "%H"
>
> because running factory.addStep(ShellCommand(command=['git', 'log',  '-1',
> '--'], workdir="build/gitrepo"))
>
> doesn't fail
>
> Do you know how this can be fixed?

Have you tried to escape the % with a backslash? Like this:

factory.addStep(ShellCommand(command=['git', 'log', '--format=\%H',
'-1', '--'], workdir="build/gitrepo"))

Johannes




More information about the devel mailing list