--- /dev/null
+#!/bin/bash
+
+. ./.jprojects.sh || exit 255
+
+for project in ${LIST}; do
+ if [ "${project}" = "jprojects-scripts" ]
+ then
+ echo "$0: Skipping jprojects-scripts ..."
+ continue
+ elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
+ then
+ echo "$0: Project '${project}' does not exist."
+ continue
+ elif [ ! -f "${JPROJECTS_HOME}/${project}/.gitcommits" ]
+ then
+ # No .gitcommits file, skip this silently
+ continue
+ fi
+
+ COMMIT_IDS=`cat "${JPROJECTS_HOME}/${project}/.gitcommits"`
+ COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits"
+
+ echo "$0: Cherry-picking on project '${project}' ..."
+ for commit in ${COMMIT_IDS}; do
+ cd "${JPROJECTS_HOME}/${project}"
+ echo "$0: Working on commit '${commit}' ..."
+ FOUND_ID=`git rev-list "${commit}" --max-count=1 2>&1`
+ STATUS="$?"
+
+ if [ "${STATUS}" != "0" ]
+ then
+ echo "$0: Found invalid commit id '${commit}' or status '${STATUS}'."
+ echo "$0: Maybe forgot git-remote add <project-name>-local <local-path> ?"
+ exit 1
+ fi
+
+ git cherry-pick -S "${commit}" || exit 255
+
+ echo "$0: Removing commit from list ..."
+ REMAINING_IDS=`cat ${COMMITS_FILE} | grep -v "${commit}"`
+ echo "${REMAINING_IDS}" > ${COMMITS_FILE}
+ done
+
+ rm -f "${COMMITS_FILE}"
+done
+
+echo "$0: All done."
+exit 0