Sfoglia il codice sorgente

Improve subtree update scripts

Willy-JL 1 anno fa
parent
commit
5abd2bddaf
2 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 2 0
      .utils/bulk-update-subtrees.sh
  2. 6 2
      .utils/update-subtree.sh

+ 2 - 0
.utils/bulk-update-subtrees.sh

@@ -11,3 +11,5 @@ for file in **/.gitsubtree; do
     echo -e "\n\nUpdating ${subtree}..."
     bash .utils/update-subtree.sh "${subtree}"
 done
+
+notify-send -a Git -i git "Subtree bulk update finished" "Double check merge commits" &> /dev/null | true

+ 6 - 2
.utils/update-subtree.sh

@@ -24,9 +24,13 @@ while read repo branch subdir; do
     fi
     if grep "Automatic merge failed; fix conflicts and then commit the result." <<< "$result" > /dev/null; then
         echo "MERGE_MSG: Merge ${path} from ${repo}"
-        echo "Waiting for current index to be resolved..."
         notify-send -a Git -i git "Subtree merge failed" "Resolve current index to continue" &> /dev/null | true
-        while ! git diff --quiet || ! git diff --cached --quiet || ! git merge HEAD &> /dev/null; do
+        while true; do
+            echo "Resolve current index then press Enter..."
+            read
+            if git diff --quiet && git diff --cached --quiet && git merge HEAD &> /dev/null; then
+                break
+            fi
             sleep 1
         done
     fi