pungi-rocky/sync-from-upstream

21 lines
537 B
Plaintext
Raw Normal View History

2022-06-02 13:38:49 +00:00
#!/bin/bash
2022-06-07 17:58:28 +00:00
HOWMANY="-$1"
if [ -z $1 ]; then
HOWMANY="-1"
fi
2022-06-02 13:38:49 +00:00
2022-08-05 18:35:28 +00:00
BRANCH=$(git branch --show-current)
2022-09-11 17:14:42 +00:00
if [[ ! "${BRANCH}" =~ "r9s" ]]; then
2022-08-05 18:35:28 +00:00
echo "Not a lookahead branch."
exit 1
fi
2022-06-02 13:38:49 +00:00
echo "Fetching from upstream"
git fetch https://gitlab.com/redhat/centos-stream/release-engineering/pungi-centos.git centos-9-stream
echo "Formatting patch and applying..."
2022-06-07 17:58:28 +00:00
git format-patch --stdout ${HOWMANY} FETCH_HEAD | sed -e 's|centos/|rocky/|' | git apply
2022-06-02 13:38:49 +00:00
echo "!! DIFF OF CHANGES !!"
git --no-pager diff HEAD
echo "You may now commit and push."