# -*- mode: conf -*- [DEFAULT] # --- global settings # avoid hangs due to SSH connection sharing jobs = 1 # custom actions to be configured repository-by-repository, that do # nothing by default git_sync = : git_rebase = : git_autoci = : # avoid pushing non-matching branches, while trying to avoid errors # from trying to push to read-only remotes git_push = git push-all # find dirty working directories, i.e., uncommitted changes, untracked # files and stashes git_isclean = git is-clean # --- Plugin for dgit repos # actually shipped with upstream mr, but use an include command that # will always work include = cat ~/src/dotfiles/lib/mr/dgit # --- git-svn # include = [ -e "/usr/share/mr/git-svn" ] && cat /usr/share/mr/git-svn # --- Sensible pulls # Redefine git_update to avoid an unconditional `git pull`, which can # result in unwanted merge commits all over $HOME (this has to come # after we include the dgit lib, which also redefines git_update) git_update = git pull-safe # --- Adam Spiers' plugin for managing dotfile symlinks with mr # actually shipped with upstream mr, but use an include command that # will always work include = # stow is not available on Windows if [ -e "$HOME/src/dotfiles/lib/mr/stow" ] \ && ! [ "$(perl -e 'print $^O')" = "msys" ]; then cat "$HOME/src/dotfiles/lib/mr/stow" fi # --- joeyh's code for specifying what machine we're on for repo skip # --- tests, plus my code for detecting Git-on-Windows lib = win32() { test "$(perl -e 'print $^O')" = "msys" } # if win32; then hostname=$(hostname) else hostname=$(hostname -s) fi # whoami="$(whoami)" # cut off the machine name on Windows win32 && whoami=${whoami##*\\} # on() { for host in $@; do if [ "${host%@*}" != "${host#*@}" ]; then if [ "$whoami" != "${host%@*}" ]; then continue fi host="${host#*@}" fi if [ "$hostname" = "$host" ]; then return 0 fi done return 1 } workstation() { on swhitton@zephyr spwhitton@hephaestus spwhitton@iris } mine() { workstation || on spwhitton@athena } # tucson() { # on artemis shortgeese athena hephaestus iris # } gcrypt() { which git-remote-gcrypt >/dev/null 2>/dev/null } # --- run a command on athena in a sane environment # lib = # athena_cmd () { # # here we rely on the fact that ssh already passes argument # # through `/bin/sh -c' (note use of single-quotes in this # # function) # ssh athena 'cd $HOME/'"$1"' && . $HOME/.shenv && '"$2" # } # --- standard procedures lib = homedir_mkdirs() { ( cd $HOME mkdir -p \ .ssh \ tmp \ src \ lib \ lib/athena \ lib/backup \ local/mutt \ local/mpd \ local/anacron/spool \ local/src \ local/bin \ local/big \ local/lib \ local/pub \ local/auth touch src/.mrconfig chmod 700 local/auth # [ -L "src/build-area" ] || ln -s -T /tmp/debuild src/build-area ) } # --- primary dotfiles repository [$HOME/src/dotfiles] checkout = git clone https://git.spwhitton.name/dotfiles.git dotfiles stowable = true # `git pull-safe` will often fail because host-specific branch needs # to be force-pushed. So just try updating master update = git remote update && git merge-ff master # use `git dotfiles-rebase` instead # rebase = # # usual rebasing pattern. Per dotfiles repo policy (excluding # # win32 case), the branch being rebased will always be rebaseable # # on master, since it is only checked out and committed to on this # # host # branch="$(git rev-parse --abbrev-ref HEAD)" # hostname="$(hostname -s)" # if [ "$branch" = "win32" -o "$branch" = "$hostname" -o "$branch" = "develacc-$hostname" ]; then # git rebase master # fi fixups = # Use a rebasing workflow since I'm the only person who ever # commits to this repo git config branch.master.rebase true git config branch.autosetuprebase always # if win32; then ( cd ~/src/dotfiles/bin && cmd "/C win32setup.bat" ) else # Manually symlink ~/.mrconfig so that we can always use mr # even if dotfiles are unstowed. Called 'home-mrconfig' to # avoid mr loading the file when pwd is within ~/src/dotfiles/ ln -sf $HOME/src/dotfiles/home-mrconfig $HOME/.mrconfig # # Ensure that ~/src/dotfiles/home-mrconfig not stowed ln -sf $HOME/src/dotfiles/.stow-global-ignore $HOME # Ensure that ~/src/.mrconfig is trusted else `mr stowable` # will always return false and so `mr stow` will never do # anything, which can be an awkward situation to recover from ln -sf $HOME/src/dotfiles/.mrtrust $HOME # homedir_mkdirs chmod -Rf 600 $HOME/local/auth/* || true # $HOME/src/dotfiles/bin/loadcron || true $HOME/src/dotfiles/bin/loadsshkeys || true fi # clean-ups so that initial stow will be successful pre_stow = homedir_mkdirs $HOME/src/dotfiles/bin/unskel # set up Emacs conf & libs post_stow = $HOME/src/dotfiles/bin/bytecompile-emacsd post_restow = $HOME/src/dotfiles/bin/bytecompile-emacsd # --- private dotfiles repositories [$HOME/src/priv] checkout = git clone gcrypt::rsync://athena:/srv/gcrypt/priv.git priv stowable = true # this repository can't be checked out until we install # git-remote-gcrypt skip = (! gcrypt) || (! workstation) fixups = chmod 600 .passwddb.pet \ .gnupg/*.kbx \ .gnupg/private-keys-v1.d/*.key git config remote.origin.gcrypt-publish-participants true git config remote.origin.gcrypt-participants 0x0F56D0553B6D411B # git config gcrypt.publish-participants true # git config gcrypt.participants 0x0F56D0553B6D411B autoci = git add .passwddb.pet .labbook.gpg .gnupg/pubring.kbx git commit -a -m \ "auto passwddb, pubring and labbook commit on $(hostname -s)" || true pre_update = mr autoci # since dotfiles repo also stows into ~/.gnupg, and athpriv repo stows # into ~/.duply, make the dirs first pre_stow = homedir_mkdirs post_stow = load-trustdb [$HOME/src/athpriv] checkout = git clone athenap:athpriv athpriv stowable = true skip = ! mine # since priv repo also stows into ~/.duply, make the dir first pre_stow = homedir_mkdirs # --- hosts configuration [$HOME/src/propellor] checkout = git clone athena:propellor propellor --branch spw3conf post_checkout = cd propellor # get new release tags for merging into 'spw3conf' and 'debian' branches git remote add -f upstream https://git.joeyh.name/git/propellor.git # This hook sets up .dir-locals.el to make it easier to follow # Propellor's coding style. We have to use a hook because # .dir-locals.el and the cabal sandbox must be nuked when working # with dgit on the 'debian' branch cp ~/lib/hooks/propellor-post-checkout ~/src/propellor/.git/hooks/post-checkout chmod 755 .git/hooks/post-checkout echo ".dir-locals.el" >> .git/info/exclude fixups = # check that the link isn't already in place before making the link # because otherwise we get an infinite loop of links that breaks propellor [ -L ~/.propellor ] || ln -sf ~/src/propellor ~/.propellor # my preferences when using propellor for configuring my own machines git config propellor.spin-branch spw3conf git config propellor.forbid-dirty-spin true skip = ! workstation # --- personal website source [$HOME/src/wiki] checkout = git clone athena:wiki skip = ! mine # --- ~/src repos with special config [$HOME/src/dgit] checkout = git clone athena:dgit post_checkout = cd propellor git remote add -f ian git://git.chiark.greenend.org.uk/~ianmdlvl/dgit.git dgit fetch sid # Ian's git server gives an error when my script tries to find the # tags there push = git push-all --no-tags skip = lazy # [$HOME/src/ublock-origin] # checkout = git clone 'https://anonscm.debian.org/git/pkg-mozext/ublock-origin.git' 'ublock-origin' # # beta, rc and alpha tags get deleted by upstream so there will very # # often be unpushed tags # push = git push-all --no-tags # skip = lazy # --- radicale collections [$HOME/lib/radicale] checkout = git clone athenap:radicale radicale skip = ! on spwhitton@athena # could use /usr/share/mr/git-annex helper to simplify the following # configuration of annexes (overriding its update definition to avoid # --content) but probably not flexible enough for all that's going on # in the below # --- primary git annex [$HOME/lib/annex] checkout = git clone gcrypt::rsync://athena:/srv/gcrypt/annex.git annex post_checkout = cd annex git annex init git annex enableremote athena rsyncurl=athena:/srv/rsync/annex skip = ! workstation update = git annex sync --no-content origin sync = git annex sync --no-content origin push = git annex sync --no-content origin git annex sync --content athena git annex sync --no-content origin fixups = git config push.default matching git config remote.origin.gcrypt-publish-participants true git config remote.origin.gcrypt-participants 0x0F56D0553B6D411B # git config gcrypt.publish-participants true # git config gcrypt.participants 0x0F56D0553B6D411B git config annex.startupscan false git config annex.autocommit true # needed for `git annex sync` git config remote.origin.annex-ignore true # --- personal website big files annex [$HOME/lib/wikiannex] checkout = git clone athena:wikiannex.git # this repo uses direct mode on athena, so status won't work status = git annex status post_checkout = cd wikiannex git annex init git config remote.origin.annex-ignore false # ^ the git-annex-init sets this wrong if [ "$(hostname -s)" = "athena" ]; then git annex direct fi # if workstation; then # git remote add bkupsd /media/${USER}/bkupsd/git/athena/wikiannex.git # git remote add m3 /media/${USER}/m3/git/athena/wikiannex.git # fi update = git annex sync --no-content # no pull in direct mode push = git annex sync --content skip = ! mine # --- git annex for university stuff [$HOME/lib/dionysus] checkout = git clone athenap:dionysus post_checkout = cd dionysus git annex init git annex direct status = git annex status update = git annex sync --no-content push = git annex sync --content sync = sync-for-dionysus # origin remote is just for keeping a backup copy of metadata. athena # remote, in $HOME on athena, contains a copy of content. At present, # origin remote only updated by sysmaint script (run weekly) fixups = git config push.default matching git config annex.startupscan false git config annex.autocommit true # needed for ga sync git config remote.origin.annex-ignore true skip = ! workstation # --- git annex for podcasts # [$HOME/lib/podcasts] # checkout = git clone athenap:podcasts # post_checkout = # cd podcasts # git annex init # status = git annex status # update = git annex --no-content sync # push = git annex --no-content sync # # origin remote is just for keeping a backup copy of metadata. athena # # remote, in $HOME on athena, contains a copy of content. At present, # # origin remote only updated by sysmaint script (run weekly) # fixups = # git config push.default matching # git config annex.startupscan false # git config annex.autocommit true # needed for ga sync # git config remote.origin.annex-ignore true # skip = ! workstation # --- git annex for use with rtorrent [$HOME/lib/rt] checkout = git clone gcrypt::rsync://athena:/srv/gcrypt/rt.git rt post_checkout = cd rt git annex init if [ -d "$(hostname -s)" ]; then mkdir -p $HOME/local/rt cd $HOME/local/rt touch .duplicity-ignore mkdir -p session incomplete if ! [ -e "complete" ]; then ln -s $HOME/lib/rt/complete complete fi if ! [ -e "watch" ]; then ln -s $HOME/lib/rt/$(hostname -s) watch fi fi status = git annex status --fast update = git annex sync --no-content origin push = git annex sync --no-content origin autoci = (git annex add . && git commit -m "auto commit on $(hostname -s)") || true fixups = git config push.default matching # git config gcrypt.publish-participants true git config remote.origin.gcrypt-publish-participants true git config remote.origin.gcrypt-participants 0x0F56D0553B6D411B git config annex.startupscan false git config annex.autocommit true # needed for `git annex sync` git config remote.origin.annex-ignore true skip = ! workstation pre_update = mr autoci # --- source code repositories registered to their own mr config file # dummy repo for chainloading [src] chain = true checkout = : update = : status = : clean = : commit = : record = : fetch = : push = : diff = : log = : grep = : isclean = : autoci = : sync = : # --- my personal documents. Override my global update command back # --- to the myrepos default so that git automatically pulls and # --- merges. Skipped on non-local hosts [$HOME/doc] checkout = git clone athenap:doc doc update = git pull "$@" skip = ! mine # set file modification times to last commit for deft.el # (commented out because no longer using deft) #fixups = git-utime # before pulling, automatically commit in the same way that my cron job does pre_update = win32 || doccheckin # ... and let me do it manually autoci = doccheckin || true # quick syncs sync = doccheckin && git pull && git push # --- static websites on web host boxes [$HOME/public_html] clone = git clone https://git.spwhitton.name/sageweb public_html skip = ! on spwhitton@sage [$HOME/html] clone = git clone https://git.spwhitton.name/sdfweb html skip = ! [ "$(domainname)" = "SDF" ] # --- my offline e-mail (& machine's postfix queue) [$HOME/.fmail] checkout = mkdir ~/.fmail movemail sync = movemail update = movemail push = movemail status = : clean = : commit = : record = : fetch = : diff = : log = : grep = : autoci = : isclean = : skip = ! [ -e "$HOME/.fmail/inbox" ] # this is slower than other repos for which sync is defined, so have # it go last order = 12