X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=cherry-jprojects.sh;h=1ecb7945ed71f8769a80eb73076579ea5b5a3cff;hb=d0da6a7f92987d5a81d7d8ba0cd74433d1a2ba6b;hp=38b989023e04c0361898f3362c81af39c9ca4bf8;hpb=e073016c17b3fd2ed31d39c01c456771e8897b21;p=jprojects-scripts.git diff --git a/cherry-jprojects.sh b/cherry-jprojects.sh index 38b9890..1ecb794 100755 --- a/cherry-jprojects.sh +++ b/cherry-jprojects.sh @@ -3,8 +3,6 @@ . ./.jprojects.sh || exit 255 for project in ${LIST}; do - COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits" - if [ "${project}" = "jprojects-scripts" ] then echo "$0: Skipping jprojects-scripts ..." @@ -13,19 +11,24 @@ for project in ${LIST}; do then echo "$0: Project '${project}' does not exist." continue - elif [ ! -f "${COMMITS_FILE}" ] + fi + + COMMITS_FILE="${JPROJECTS_HOME}/${project}/.gitcommits" + + if [ ! -f "${COMMITS_FILE}" ] then # No .gitcommits file, skip this silently continue fi - COMMIT_IDS=`cat "${COMMITS_FILE}"` + COMMIT_IDS=$(cat "${COMMITS_FILE}") if [ -n "${COMMIT_IDS}" ] then cd "${JPROJECTS_HOME}/${project}" - echo "$0: Pulling all for project '${project}' ..." - git pull --all + echo "$0: Fetching all for project '${project}' ..." + git prune + git fetch --all else echo "$0: Nothing to cherry-pick for '${project}'." rm "${COMMITS_FILE}" @@ -35,7 +38,7 @@ for project in ${LIST}; do echo "$0: Cherry-picking on project '${project}' ..." for commit in ${COMMIT_IDS}; do echo "$0: Working on commit '${commit}' ..." - FOUND_ID=`git rev-list "${commit}" --max-count=1 2>&1` + FOUND_ID=$(git rev-list "${commit}" --max-count=1 2>&1) STATUS="$?" if [ "${STATUS}" != "0" ] @@ -48,7 +51,7 @@ for project in ${LIST}; do git cherry-pick -S "${commit}" || exit 255 echo "$0: Removing commit from list ..." - REMAINING_IDS=`cat ${COMMITS_FILE} | grep -v "${commit}"` + REMAINING_IDS=$(cat ${COMMITS_FILE} | grep -v "${commit}") echo "${REMAINING_IDS}" > ${COMMITS_FILE} done