diff --git a/.mrconfig b/.mrconfig index 56f6a9223cfacd5c909e45e4e87364a749fc5218..090d612a731746caafb74fdd551fac983c5e67a9 100644 --- a/.mrconfig +++ b/.mrconfig @@ -1,3 +1,6 @@ +[DEFAULT] +git_pullup = "$(dirname "$MR_CONFIG")/bin/pull-from-upstream" + [swh-site] checkout = git clone https://forge.softwareheritage.org/source/puppet-swh-site.git swh-site \ && cd swh-site \ diff --git a/bin/pull-from-upstream b/bin/pull-from-upstream new file mode 100755 index 0000000000000000000000000000000000000000..854b0a6a6986e2f1b264a8f3f2595928fc2efe5f --- /dev/null +++ b/bin/pull-from-upstream @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +if [ -d .git/refs/remotes/upstream ]; then + git fetch upstream + + oldbranch=$(git rev-parse --abbrev-ref HEAD) + + if [ "$oldbranch" != "master" ]; then + git checkout master + fi + + git merge upstream/master + git push origin master:master --tags + + if [ "$oldbranch" != "master" ]; then + git checkout $oldbranch + fi +fi