AMR/git_merge.sh

43 lines
1.6 KiB
Bash
Raw Normal View History

2019-05-20 14:16:53 +02:00
#######################################################################
# To push new commits to the premaster branch, run: #
# bash git_premaster.sh "commit message" #
2019-11-29 19:43:23 +01:00
# This creates auto version numbering in DESCRIPTION and NEWS.md. #
2019-05-20 14:16:53 +02:00
# #
# After successful CRAN checks, merge it to the master branch with: #
# bash git_merge.sh #
2019-11-29 19:43:23 +01:00
# #
# To prerelease a new version number, run: #
# bash git_premaster.sh "v0.x.x" FALSE "0.x.x" #
2019-05-20 14:16:53 +02:00
#######################################################################
# stash current changes
# git stash --quiet
# go to master
git checkout master --quiet
echo "• changed branch to master"
2019-05-20 14:16:53 +02:00
# import everything from premaster
2019-06-01 20:40:49 +02:00
git merge premaster --quiet
2019-05-20 14:16:53 +02:00
# and send it to git
2019-06-01 20:40:49 +02:00
git push --quiet
echo "• pushed changes to master"
2019-05-20 14:16:53 +02:00
# return to premaster
git checkout premaster --quiet
echo "• changed branch back to premaster"
2019-06-01 20:40:49 +02:00
git status --short
2019-10-07 15:12:42 +02:00
echo
2019-06-01 20:40:49 +02:00
2019-10-07 15:12:42 +02:00
read -p "Use R-hub to simulate all CRAN checks (y/N)? " choice
case "$choice" in
y|Y|j|J ) ;;
* ) exit 1;;
esac
2019-10-11 19:16:49 +02:00
Rscript -e "rhub::check(devtools::build(), platform = c('debian-clang-devel', 'debian-gcc-devel', 'fedora-clang-devel', 'fedora-gcc-devel', 'windows-x86_64-devel', 'debian-gcc-patched', 'solaris-x86-patched', 'debian-gcc-release', 'windows-x86_64-release', 'macos-elcapitan-release', 'windows-x86_64-oldrel'))"
2019-10-07 15:12:42 +02:00
echo
2019-05-20 14:16:53 +02:00
# and get stashed changes back
# git stash apply --quiet