Created
April 10, 2025 10:47
-
-
Save kcxt/adea59dc8d2646ec4d09710387776547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check we got at least 3 args | |
if [ $# -lt 3 ]; then | |
echo "Usage: $0 start url end [git-send-email options]" | |
exit 1 | |
fi | |
start="$1" | |
url="$2" | |
end="$3" | |
shift 3 | |
push_ref() { | |
git rev-parse --abbrev-ref --symbolic-full-name $1 | |
} | |
if [ "$start" = "{}" ]; then | |
#start=$(git describe --all --abbrev=0 --exclude "*$(push_ref HEAD)") | |
# Match "vXXXX" tags, e.g. v6.13-rc2, v2025.04-rc2, etc. | |
start=$(git describe --tags --abbrev=0 --match "v*") | |
echo "Using start: $start" | |
fi | |
end_tag=$(git describe --tags --abbrev=0) | |
if [ "$(git rev-parse $end_tag)" != "$(git rev-parse $start)" ]; then | |
echo "Using $end_tag as end" | |
end=$end_tag | |
fi | |
pull=$(mktemp /tmp/git-pull-XXXXXXX.pull) | |
echo "From: $(git config user.name) <$(git config user.email)>" >> $pull | |
echo "Date: $(date -R)" >> $pull | |
echo "Subject: [PULL] Please pull $end" >> $pull | |
echo >> $pull | |
git request-pull "$start" "$url" "$end" >> $pull | |
git send-email --annotate "$@" $pull | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment