I am trying to implement Git cherry pick for multiple commit Ids at once. But it fails, or either this is not how it should be used.
I am trying to use bash command from here : https://stackoverflow.com/a/2553705/9614476
  #!/bin/bash
  if [ -z $1 ]; then
      echo "Equivalent to running git-cherry-pick on each of the commits in the range specified.";
      echo "";
      echo "Usage:  $0 start^..end";
      echo "";
      exit 1;
  fi
  git rev-list --reverse --topo-order $1 | while read rev
  do
    git cherry-pick $rev || break
  done
I created a target for ant like this :
<target name="git_multi_cherry_pick">
    <echo message="START: MultiMerge"/>
    <exec executable="C:\Program Files\Git\bin\bash.exe" osfamily="windows" failonerror="true">
        <arg value="${gitMultiCherryPick}"/>
        <arg value="${gitCommitIds}"/>
    </exec>
    <exec executable="/bin/bash" osfamily="unix" failonerror="true">
        <arg value="${gitMultiCherryPick}"/>
        <arg value="${gitCommitIds}"/>
    </exec>
</target>
And I am using AntExecutor from Java to call the above target.
AntExecutor code can be found here -  https://github.com/asciidoctor/asciidoctor-ant/blob/master/src/test/java/org/asciidoctor/ant/AntExecutor.java
        Map<String, String> propertiesMap = new HashMap<>();
        propertiesMap.put("gitMultiCherryPick", "git-multi-cherry-pick.sh");
        propertiesMap.put("gitCommitIds", "204a3e81712000d09a2794cc4ef1d090c4280f4e,9c5242d6a15b14032e9fc1f408be3c91026b1e1f");
        List<String> sf_build = AntExecutor.executeAntTask("FullPath \\resources\\build\\build.xml",
                "git_multi_cherry_pick", propertiesMap);
But it fails with this error :
The ' characters around the executable and arguments are
not part of the command., 204a3e81712000d09a2794cc4ef1d090c4280f4e,9c5242d6a15b14032e9fc1f408be3c91026b1e1f, git-multi-cherry-pick.sh, fatal: ambiguous argument '204a3e81712000d09a2794cc4ef1d090c4280f4e,9c5242d6a15b14032e9fc1f408be3c91026b1e1f':
I think that is not how we pass the commitIds. Has anyone used the above bash script before?
 
    