git-repo-merge.sh: Abort when repos have no common commits.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/bin/git-repo-merge.sh new-bii_scripts/bin/git-repo-merge.sh
--- old-bii_scripts/bin/git-repo-merge.sh 2022-09-28 12:28:35.789498959 +0200
+++ new-bii_scripts/bin/git-repo-merge.sh 2022-09-28 12:28:35.789498959 +0200
@@ -48,6 +48,11 @@
# get the last common commit hash of the two repos:
COMMIT=$(comm --nocheck-order -12 <(git -C "$MYREPO" log --reverse --pretty=format:"%H") <(git -C "$OTHERREPO" log --reverse --pretty=format:"%H") | tail -n 1)
+if [ -z "$COMMIT" ]; then
+ echo "ERROR, $MYREPO and $OTHERREPO have no common commits" >&2
+ exit 1
+fi
+
cd $MYREPO
# go to last common commit:
git checkout $COMMIT
patch 15ef262ca4067247bb68e1fee23ca48a60d380bb
Author: Goetz.Pfeiffer@helmholtz-berlin.de
Date: Mon May 30 17:32:23 CEST 2022
* git-repo-merge.sh: Abort when repos have no common commits