From 6ebf0f7f761a9287078fe4447c65c078e172cda1 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Fri, 22 Jul 2022 13:39:29 -0400
Subject: [PATCH] try working around the "no merge base" problem

---
 ci-tools/update-production | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ci-tools/update-production b/ci-tools/update-production
index 52079d5e..7892bce0 100755
--- a/ci-tools/update-production
+++ b/ci-tools/update-production
@@ -78,17 +78,22 @@ describe_update() {
     local TARGET_BRANCH=$1
     shift
 
-    local NOTES=$(git diff origin/"$TARGET_BRANCH"...origin/"$SOURCE_BRANCH" -- DEPLOYMENT-NOTES.rst)
+    # Since production production (target) should not diverge from develop
+    # (source) it is fine to use `..` instead of `...` in the git ranges here.
+    # `...` encounters problems related to discovering the merge base because
+    # of the way GitLab manages the git checkout on CI (I think).
+
+    local NOTES=$(git diff origin/"$TARGET_BRANCH"..origin/"$SOURCE_BRANCH" -- DEPLOYMENT-NOTES.rst)
 
     # There often are no notes and that makes for boring reading so toss in a
     # diffstat as well.
-    local DIFFSTAT=$(git diff --stat origin/"$TARGET_BRANCH"...origin/"$SOURCE_BRANCH")
+    local DIFFSTAT=$(git diff --stat origin/"$TARGET_BRANCH"..origin/"$SOURCE_BRANCH")
 
     local WHEN=$(git log --max-count=1 --format='%cI' origin/"$TARGET_BRANCH")
 
     # Describe all of the MRs that were merged into the source branch that are
     # about to be merged into the target branch.
-    local MR=$(describe_merge_requests origin/"$TARGET_BRANCH"...origin/"$SOURCE_BRANCH" "$SOURCE_BRANCH")
+    local MR=$(describe_merge_requests origin/"$TARGET_BRANCH"..origin/"$SOURCE_BRANCH" "$SOURCE_BRANCH")
 
     echo "\
 Changes from $SOURCE_BRANCH since $WHEN
-- 
GitLab