Files
upgrading-ethereum-book/bin/util/patch_all.sh
2025-05-26 13:04:52 +01:00

32 lines
594 B
Bash
Executable File

#!/bin/bash
#
# Apply a git commit to all branches
#
branches='altair bellatrix capella deneb'
if [ $# -eq 0 ]; then
echo "Usage: $0 <commit>"
exit 1
fi
# Save the starting branch so we can return to it later
start=$(git branch --show-current)
for branch in $branches;
do
[[ $branch == $start ]] && continue
echo "*** Patching $branch"
git switch $branch && git cherry-pick --allow-empty $1
if [ $? -ne 0 ]
then
echo "*** Cherry pick failed on $branch"
echo "*** Aborting"
git cherry-pick --abort
fi
echo
done
git switch $start