#!/bin/bash # ━━━━━━━━━━━━━━━ # flow-downstream - Flow downstream all newly commited changes of the present repository # ━━━━━━━━━━━━━━━ # # Automating the steps of `~/work/maintenance_manual.brec` § Publication. echo if [ ! -L ~/project/`project-proper-path` ]; then # The `~/project/` repository is real. echo 'Go to `~/project/` repository' echo '━━━━━━━━━━━━━━━━━' pushd ~/project/`project-proper-path`/ || exit 1 echo echo 'Pull from `~/work/`' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' git fetch origin master --verbose || exit 1 read -p '...' echo echo 'Merge the changes' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' (git checkout master && git merge --ff-only FETCH_HEAD) || exit 1 read -p '...' echo echo 'Rebase branch `reluk.ca` atop the merger' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' (git checkout reluk.ca && git rebase master) || exit 1 read -p '...' echo echo 'Push to `~/work/` the rebase' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' git push ~/work/`project-proper-path`/ +reluk.ca:reluk.ca --force-with-lease || exit 1 read -p '...' echo echo 'Return to `~/work/`' echo '━━━━━━━━━━━━━━━━━━' popd || exit 1 echo echo 'Push to `public` repository' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' (c='git push --force-with-lease public'; $c master:master && (echo; $c reluk.ca:reluk.ca)) \ || exit 1 # echo '(omitted)' else # The `~/project/` repository is a mere soft-link to the `~/work/` repository. echo 'Push to `public` repository' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' (c='git push --force-with-lease public'; $c master:master) || exit 1 # echo '(omitted)' fi repo=`realpath $PWD` # This (command substitution) implicitly strips the trailing newline. if [ $repo != '/home/mike/work/ethic' ]; then # See `~/work/ethic/working_notes.brec` § safeguarding my moral rights to the present work. read -p '...' echo echo 'Thence to Git Hub' echo '┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈' (cd ~/var/repo/git/`project-token-name`.git/ && git push github --mirror) || exit 1 # echo '(omitted pending Internet)' fi echo