Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 24 lines (18 sloc) 552 Bytes
#!/bin/bash
if [ "$(basename $PWD)" != 'nso-arroyo' ]; then
echo "Error: $PWD doesn't look like nso-arroyo"
exit 1
fi
MR_LIST=$(glab mr list --label lab | grep '^!')
BRANCH=$(echo "$MR_LIST" | grep -Eo ' (\([^ ]*\))$' | grep -o '[^ ()]*' | sed -e 's|^|origin/|')
echo "=== MR_LIST ==="
echo "$MR_LIST"
echo "=== BRANCH List ==="
echo "$BRANCH"
set -xe
git remote update
git checkout lab
git reset --hard origin/main
git merge -m "Automatically generated lab branch combining the following MRs:
${MR_LIST}" ${BRANCH}
git push origin lab --force