From 484708ac1665b955bf5ceaf2f783921c663a8883 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 7 Mar 2026 16:03:16 +0100 Subject: [PATCH] fix: on Android, do not exceed process limit --- lisp/android-setup.el | 2 ++ scripts/android-repair-git | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 scripts/android-repair-git diff --git a/lisp/android-setup.el b/lisp/android-setup.el index c35239361de568bae42d9e0dc3b04aa747e05770..fc592c34a4f1d911c0188ac59f14b19347ffb325 100644 --- a/lisp/android-setup.el +++ b/lisp/android-setup.el @@ -10,6 +10,8 @@ (customize-set-variable 'touch-screen-display-keyboard t) + (setq elpaca-queue-limit 3) + (with-eval-after-load 'evil (evil-define-key nil evil-normal-state-map [mouse-1] 'mouse-set-point diff --git a/scripts/android-repair-git b/scripts/android-repair-git new file mode 100644 index 0000000000000000000000000000000000000000..17e270275a36b3ee8b5d0a884119e0bccfb6084c --- /dev/null +++ b/scripts/android-repair-git @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# On Android, I have this issue... When too many repos are being +# cloned, it fails. Then I have to go over them one by one and either +# remove them or checkout the main branch after fetching. So this is a +# possible workaround. In the future, elpaca-queue-limit should take +# care of this on new devices I will use. + +checkout() +{ + if git show-ref --verify --quiet refs/remotes/origin/main; then + git checkout -b main origin/main + elif git show-ref --verify --quiet refs/remotes/origin/master; then + git checkout -b master origin/master + else + echo "ERROR: No main or master branch found in $repo" >&2 + fi +} + +for repo in ~/.emacs.d/stateful/elpaca/repos/*; do + count=$(ls "$repo" | wc -l) + + if [[ $count -eq 0 ]]; then + echo "Found, $repo" + + (cd "$repo" && git fetch --all && checkout) + fi +done