From 9615cdaae1f9096525b716cb46d960aaae815974 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 24 Dec 2025 19:06:10 -0600 Subject: [PATCH 1/3] feat: better resilience against listing already included cherry-picks --- containers/debian/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/containers/debian/Dockerfile b/containers/debian/Dockerfile index 4546e083..56f1c8b4 100644 --- a/containers/debian/Dockerfile +++ b/containers/debian/Dockerfile @@ -174,6 +174,10 @@ if [ -n "${SPACK_CHERRYPICKS}" ] ; then SPACK_CHERRYPICKS=$(git -C ${SPACK_ROOT} rev-list --topo-order ${SPACK_CHERRYPICKS} | grep -m $(echo "${SPACK_CHERRYPICKS}" | wc -l) "${SPACK_CHERRYPICKS}" | tac) eval "declare -A SPACK_CHERRYPICKS_FILES_ARRAY=(${SPACK_CHERRYPICKS_FILES})" for hash in ${SPACK_CHERRYPICKS} ; do + if git merge-base --is-ancestor ${hash} HEAD ; then + echo "Skipping already-applied ${hash}" + continue + fi if [ -n "${SPACK_CHERRYPICKS_FILES_ARRAY[${hash}]+found}" ] ; then git -C ${SPACK_ROOT} show ${hash} -- ${SPACK_CHERRYPICKS_FILES_ARRAY[${hash}]//,/ } | patch -p1 -d ${SPACK_ROOT} git -C ${SPACK_ROOT} commit --all --message "$(git -C ${SPACK_ROOT} show --no-patch --pretty=format:%s ${hash})" @@ -212,6 +216,10 @@ if [ -n "${SPACKPACKAGES_CHERRYPICKS}" ] ; then SPACKPACKAGES_CHERRYPICKS=$(git -C ${SPACKPACKAGES_ROOT} rev-list --topo-order ${SPACKPACKAGES_CHERRYPICKS} | grep -m $(echo "${SPACKPACKAGES_CHERRYPICKS}" | wc -l) "${SPACKPACKAGES_CHERRYPICKS}" | tac) eval "declare -A SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY=(${SPACKPACKAGES_CHERRYPICKS_FILES})" for hash in ${SPACKPACKAGES_CHERRYPICKS} ; do + if git merge-base --is-ancestor ${hash} HEAD ; then + echo "Skipping already-applied ${hash}" + continue + fi if [ -n "${SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY[${hash}]+found}" ] ; then git -C ${SPACKPACKAGES_ROOT} show ${hash} -- ${SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY[${hash}]//,/ } | patch -p1 -d ${SPACKPACKAGES_ROOT} git -C ${SPACKPACKAGES_ROOT} commit --all --message "$(git -C ${SPACKPACKAGES_ROOT} show --no-patch --pretty=format:%s ${hash})" From c5266280569cf57f31a720c6f775d8d06739588d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 24 Dec 2025 19:16:11 -0600 Subject: [PATCH 2/3] Apply suggestions from code review --- containers/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/debian/Dockerfile b/containers/debian/Dockerfile index 56f1c8b4..ffaf9273 100644 --- a/containers/debian/Dockerfile +++ b/containers/debian/Dockerfile @@ -174,7 +174,7 @@ if [ -n "${SPACK_CHERRYPICKS}" ] ; then SPACK_CHERRYPICKS=$(git -C ${SPACK_ROOT} rev-list --topo-order ${SPACK_CHERRYPICKS} | grep -m $(echo "${SPACK_CHERRYPICKS}" | wc -l) "${SPACK_CHERRYPICKS}" | tac) eval "declare -A SPACK_CHERRYPICKS_FILES_ARRAY=(${SPACK_CHERRYPICKS_FILES})" for hash in ${SPACK_CHERRYPICKS} ; do - if git merge-base --is-ancestor ${hash} HEAD ; then + if git -C ${SPACK_ROOT} merge-base --is-ancestor "${hash}" HEAD ; then echo "Skipping already-applied ${hash}" continue fi @@ -216,7 +216,7 @@ if [ -n "${SPACKPACKAGES_CHERRYPICKS}" ] ; then SPACKPACKAGES_CHERRYPICKS=$(git -C ${SPACKPACKAGES_ROOT} rev-list --topo-order ${SPACKPACKAGES_CHERRYPICKS} | grep -m $(echo "${SPACKPACKAGES_CHERRYPICKS}" | wc -l) "${SPACKPACKAGES_CHERRYPICKS}" | tac) eval "declare -A SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY=(${SPACKPACKAGES_CHERRYPICKS_FILES})" for hash in ${SPACKPACKAGES_CHERRYPICKS} ; do - if git merge-base --is-ancestor ${hash} HEAD ; then + if git -C ${SPACKPACKAGES_ROOT} merge-base --is-ancestor "${hash}" HEAD ; then echo "Skipping already-applied ${hash}" continue fi From 76cfdfda1d8bee76d0ef47193910c0b3b4d61522 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 25 Dec 2025 10:36:54 -0600 Subject: [PATCH 3/3] fix: grammar Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- containers/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/debian/Dockerfile b/containers/debian/Dockerfile index ffaf9273..29bf371f 100644 --- a/containers/debian/Dockerfile +++ b/containers/debian/Dockerfile @@ -175,7 +175,7 @@ if [ -n "${SPACK_CHERRYPICKS}" ] ; then eval "declare -A SPACK_CHERRYPICKS_FILES_ARRAY=(${SPACK_CHERRYPICKS_FILES})" for hash in ${SPACK_CHERRYPICKS} ; do if git -C ${SPACK_ROOT} merge-base --is-ancestor "${hash}" HEAD ; then - echo "Skipping already-applied ${hash}" + echo "Skipping already applied ${hash}" continue fi if [ -n "${SPACK_CHERRYPICKS_FILES_ARRAY[${hash}]+found}" ] ; then @@ -217,7 +217,7 @@ if [ -n "${SPACKPACKAGES_CHERRYPICKS}" ] ; then eval "declare -A SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY=(${SPACKPACKAGES_CHERRYPICKS_FILES})" for hash in ${SPACKPACKAGES_CHERRYPICKS} ; do if git -C ${SPACKPACKAGES_ROOT} merge-base --is-ancestor "${hash}" HEAD ; then - echo "Skipping already-applied ${hash}" + echo "Skipping already applied ${hash}" continue fi if [ -n "${SPACKPACKAGES_CHERRYPICKS_FILES_ARRAY[${hash}]+found}" ] ; then