From 760d638704deb0d2661337e4710791655665e04b Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 30 May 2025 07:52:23 -0400 Subject: [PATCH 1/4] Update deploy.sh --- deploy.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/deploy.sh b/deploy.sh index 4027f741..4c6e5061 100755 --- a/deploy.sh +++ b/deploy.sh @@ -63,22 +63,30 @@ then exit 1 fi -msg=`git log -1 --pretty=%B` +# make sure the source branch is up-to-date with origin/source +echo "Fetching content from remote" +git fetch --quiet origin -echo "Checking out source" -git checkout source -echo +COUNT_MISSING="$(git rev-list --count source..origin/source)" +if [ "${COUNT_MISSING}" != 0 ] ; then + echo "Error: the 'source' branch is not up-to-date. Please do a 'git pull'" + exit 1 +fi -echo "Pulling updates to the source" -git pull --quiet origin source -echo +COUNT_EXTRA="$(git rev-list --count origin/source..source)" +if [ "${COUNT_EXTRA}" != 0 ] ; then + echo "Error: the 'source' branch contains changes that have not been merged!" + echo + echo " Please create a PR for these changes. After the PR is merged, " + echo " please pull from the source branch and run the ./deploy.sh script again." + exit 1 +fi -# fetch master -echo "Pulling master" +# Check out master in _site +echo "Checking out master in _site" ( cd _site git checkout --quiet master - git fetch --quiet origin git reset --quiet --hard origin/master # update the documentation? @@ -106,6 +114,7 @@ echo # deploy master ( cd _site + msg=`git log -1 --pretty=%B` # check if there are any changes on master untracked=`git ls-files --other --exclude-standard --directory` From d4d080dfd919abbbee87754579c7910474b71197 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 30 May 2025 08:23:01 -0400 Subject: [PATCH 2/4] Update the README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d23e9f61..a7fa594f 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,17 @@ In order to build the site you will need `jekyll`, see instructions below to ins Making changes to the site ================= -When making changes to the site, you should always work on the `source` branch. After committing your changes to `source`, simply run the `deploy.sh` script. This script will take care of the steps involved to push both the `source` and `master` branches to github. - - ./deploy.sh +When making changes to the site: +1. Start from the lastest version of the source branch with `git checkout source ; git pull`. +2. Create a new branch for your changes with `git checkout -b `. +3. Commit your changes to the branch. +4. Push the changes to github using `git push origin `. +5. Open a pull request (PR) for the branch on github at https://github.com/revbayes/revbayes.github.io +6. After the pull request is merged to the `source` branch on github, move back to the source branch locally with `git checkout source` and fetch the latest version with `git pull`. +7. Now you can run the `deploy.sh` script to update the `master` branch. + +Pull requests for the website do not currently require review, so you can merge them yourself if checks pass. +These checks help to prevent the tutorials from breaking. Setting up jekyll ================= From 94520fbd53854f3119a86afc1d38de80aca2cedf Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 30 May 2025 08:36:02 -0400 Subject: [PATCH 3/4] Also complain about untracked files. --- deploy.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy.sh b/deploy.sh index 4c6e5061..f147e10c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -63,6 +63,13 @@ then exit 1 fi +# make sure there aren't untracked files that will get uploaded to the website +UNTRACKED_FILES=$(git ls-files --others --exclude-standard) +if [ -n "${UNTRACKED_FILES}" ] ; then + echo "Error: Untracked files. Please commit or stash before updating master." + exit 1 +fi + # make sure the source branch is up-to-date with origin/source echo "Fetching content from remote" git fetch --quiet origin From f091d83913eab2e3231bd68493cd6f755f788310 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 30 May 2025 08:36:40 -0400 Subject: [PATCH 4/4] Add --set-upstream --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7fa594f..1d275743 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ When making changes to the site: 1. Start from the lastest version of the source branch with `git checkout source ; git pull`. 2. Create a new branch for your changes with `git checkout -b `. 3. Commit your changes to the branch. -4. Push the changes to github using `git push origin `. +4. Push the changes to github using `git push --set-upstream origin `. 5. Open a pull request (PR) for the branch on github at https://github.com/revbayes/revbayes.github.io 6. After the pull request is merged to the `source` branch on github, move back to the source branch locally with `git checkout source` and fetch the latest version with `git pull`. 7. Now you can run the `deploy.sh` script to update the `master` branch.