From 47676df45b4fbadf2f246cd73d9a653501b80300 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 16 Apr 2026 11:15:00 +0200 Subject: [PATCH] git: Update git-pull-all --- git/git-pull-all | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/git/git-pull-all b/git/git-pull-all index d63e73c..5131f86 100755 --- a/git/git-pull-all +++ b/git/git-pull-all @@ -78,6 +78,9 @@ while [ $# -gt 0 ]; do shift done +# Collection of failed repos for summary at the end +FAILED_REPOS="" + for REPODIR in $(find "$@" -name .git -type d 2> /dev/null); do REPO=$(dirname ${REPODIR}) @@ -90,7 +93,11 @@ for REPODIR in $(find "$@" -name .git -type d 2> /dev/null); do [ "${response}" = "y" ] || continue fi - git -C ${REPO} remote update + git -C ${REPO} remote update || { + /usr/bin/echo -e "\e[1;31m Failed to update ${REPO}\e[0m" + FAILED_REPOS="${FAILED_REPOS}\n${REPO}" + continue + } if [ -z "$(git -C ${REPO} status -uno | grep 'Your branch is behind')" ] ; then /usr/bin/echo -e "\e[1;32m Already up to date\e[0m" @@ -101,5 +108,10 @@ for REPODIR in $(find "$@" -name .git -type d 2> /dev/null); do fi git -C ${REPO} pull fi - done + +if [ -n "${FAILED_REPOS}" ]; then + echo "" + echo "Failed to update the following repositories:" + echo "${FAILED_REPOS}" +fi -- 2.39.5