3 . ./.jprojects.sh || exit 255
5 for project in ${LIST}; do
6 if [ "${project}" = "jprojects-scripts" ]
8 echo "$0: Skipping jprojects-scripts ..."
10 elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
12 echo "$0: Project '${project}' does not exist."
16 COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits"
18 if [ ! -f "${COMMITS_FILE}" ]
20 # No .gitcommits file, skip this silently
24 COMMIT_IDS=$(cat "${COMMITS_FILE}")
26 if [ -n "${COMMIT_IDS}" ]
28 cd "${JPROJECTS_HOME}/${project}"
29 echo "$0: Fetching all for project '${project}' ..."
33 echo "$0: Nothing to cherry-pick for '${project}'."
38 echo "$0: Cherry-picking on project '${project}' ..."
39 for commit in ${COMMIT_IDS}; do
40 echo "$0: Working on commit '${commit}' ..."
41 FOUND_ID=$(git rev-list "${commit}" --max-count=1 2>&1)
44 if [ "${STATUS}" != "0" ]
46 echo "$0: Found invalid commit id '${commit}' or status '${STATUS}'."
47 echo "$0: Maybe forgot git-remote add <project-name>-local <local-path> ?"
51 git cherry-pick -S "${commit}" || exit 255
53 echo "$0: Removing commit from list ..."
54 REMAINING_IDS=$(cat ${COMMITS_FILE} | grep -v "${commit}")
55 echo "${REMAINING_IDS}" > ${COMMITS_FILE}
58 rm -f "${COMMITS_FILE}"