diff --git a/scripts/developer/git/setup-aliases b/scripts/developer/git/setup-aliases index 5479ad0dd7ba0e6a620b8edb955bcc0feb1ea1a0..2d996582b0284debddf288a85708702053f53270 100755 --- a/scripts/developer/git/setup-aliases +++ b/scripts/developer/git/setup-aliases @@ -3,14 +3,13 @@ echo "Setting up git aliases..." if ! which clang-format 2>1 1>/dev/null then - echo "ADIOS development requires clang-format to be available in your path." - exit 1 + echo "Warning: ADIOS uses clang-format to enforce style guidelines but no" + echo " clang-format binary was found in tyour path" fi if ! git config alias.clang-format "!scripts/developer/git/git-clang-format" then echo "Error adding clang-format alias" - exit 2 fi exit 0 diff --git a/scripts/developer/git/setup-remotes b/scripts/developer/git/setup-remotes new file mode 100755 index 0000000000000000000000000000000000000000..6dc9e8605ee250da8025bc9b59b51343ae654a70 --- /dev/null +++ b/scripts/developer/git/setup-remotes @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +echo "Checking github username..." +GHUSER=$(git remote get-url origin | sed 's|.*[:/]\([^/]*\)/adios2.git|\1|') +if [ -z "${GHUSER}" ] +then + echo " Warning: Unable to determine github username. Are you sure you" + echo " cloned your fork?" + exit 1 +fi +echo "Using github user ${GHUSER}" + +echo "Adding upstream remote..." +if git remote show upstream > /dev/null 2>&1 +then + echo " Warning: upstream remote already exists; skipping" +else + git remote add upstream https://github.com/ornladios/adios2.git +fi +git fetch --all -p + +echo "Reconfiguring local master branch to use upstream" +git config branch.master.remote upstream +git config branch.master.mergeOptions "--ff-only" +git config merge.log 100 + +exit 0 diff --git a/scripts/developer/setup.sh b/scripts/developer/setup.sh index 27607008e8eb0a4ed5c0ead760070e8bad72c77b..dc4d903dff737599786068ccec19675b17df9d7c 100755 --- a/scripts/developer/setup.sh +++ b/scripts/developer/setup.sh @@ -10,6 +10,9 @@ function test_cmd { cd "${BASH_SOURCE%/*}/../.." +test_cmd scripts/developer/git/setup-remotes \ + "Failed to setup upstream remotes " 2 + test_cmd scripts/developer/git/setup-aliases \ "Failed to setup git aliases" 2