3 . ./.jprojects.sh || exit 255
5 for project in ${LIST}; do
6 COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits"
8 if [ "${project}" = "jprojects-scripts" ]
10 echo "$0: Skipping jprojects-scripts ..."
12 elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
14 echo "$0: Project '${project}' does not exist."
16 elif [ ! -f "${COMMITS_FILE}" ]
18 # No .gitcommits file, skip this silently
22 COMMIT_IDS=`cat "${COMMITS_FILE}"`
24 if [ -n "${COMMIT_IDS}" ]
26 cd "${JPROJECTS_HOME}/${project}"
27 echo "$0: Pulling all for project '${project}' ..."
30 echo "$0: Nothing to cherry-pick for '${project}'."
35 echo "$0: Cherry-picking on project '${project}' ..."
36 for commit in ${COMMIT_IDS}; do
37 echo "$0: Working on commit '${commit}' ..."
38 FOUND_ID=`git rev-list "${commit}" --max-count=1 2>&1`
41 if [ "${STATUS}" != "0" ]
43 echo "$0: Found invalid commit id '${commit}' or status '${STATUS}'."
44 echo "$0: Maybe forgot git-remote add <project-name>-local <local-path> ?"
48 git cherry-pick -S "${commit}" || exit 255
50 echo "$0: Removing commit from list ..."
51 REMAINING_IDS=`cat ${COMMITS_FILE} | grep -v "${commit}"`
52 echo "${REMAINING_IDS}" > ${COMMITS_FILE}
55 rm -f "${COMMITS_FILE}"