summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2023-04-16 12:10:06 +0200
committersternenseemann <sternenseemann@systemli.org>2023-05-19 16:33:56 +0200
commit6dcc0ab9b50e8a152407b409285a311cc13e3085 (patch)
tree5281e7bb7459c265c0141db931ba07f8e46b34af
parent682790aee0f2de043134d3f5a40a66f483ae374c (diff)
downloadnixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar.gz
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar.bz2
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar.lz
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar.xz
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.tar.zst
nixpkgs-6dcc0ab9b50e8a152407b409285a311cc13e3085.zip
maintainers/haskell/merge-and-open-pr: only push haskell-updates
If we want to push only one branch, we'll have to specify branch and
remote explicitly. Pushing to origin doesn't work for everyone, since
some of us have a origin remote that can't be pushed to. Using plain
`git push` has the problem that it'll try pushing all checked out
branchs which fails e.g. if some branches (staging, staging-next, …) are
behind their remote counterparts.

The solution is to require everyone to configure a per branch pushRemote
for haskell-updates which will then be used by merge-and-open-pr.sh.
-rwxr-xr-xmaintainers/scripts/haskell/merge-and-open-pr.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/maintainers/scripts/haskell/merge-and-open-pr.sh b/maintainers/scripts/haskell/merge-and-open-pr.sh
index 8b292ca50c8..cdba24f0c20 100755
--- a/maintainers/scripts/haskell/merge-and-open-pr.sh
+++ b/maintainers/scripts/haskell/merge-and-open-pr.sh
@@ -53,6 +53,10 @@ if ! gh auth status 2>/dev/null ; then
   die "You must setup the \`gh\` command.  Run \`gh auth login\`."
 fi
 
+# Make sure this is configured before we start doing anything
+push_remote="$(git config branch.haskell-updates.pushRemote \
+  || die 'Can'\''t determine pushRemote for haskell-updates. Please set using `git config branch.haskell-updates.pushremote <remote name>`.')"
+
 # Fetch nixpkgs to get an up-to-date origin/haskell-updates branch.
 echo "Fetching origin..."
 git fetch origin >/dev/null
@@ -89,8 +93,8 @@ echo "Regenerating Hackage packages..."
 ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast --do-commit
 
 # Push these new commits to the haskell-updates branch
-echo "Pushing commits just created to the remote haskell-updates branch..."
-git push
+echo "Pushing commits just created to the remote $push_remote/haskell-updates branch..."
+git push "$push_remote" haskell-updates
 
 # Open new PR
 new_pr_body=$(cat <<EOF