summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-11-29 10:19:34 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-11-30 14:20:59 -0700
commita991c88e7ae39d7c94c8733e4bc0d36099b0a626 (patch)
tree0cc1346c6a09a00caed9ef372a3ca30ef7ff6158 /lib-src
parentaf8a88b946689ffa9e330a06e222e73fdb27e888 (diff)
downloaddotfiles-a991c88e7ae39d7c94c8733e4bc0d36099b0a626.tar.gz
replace git-dotfiles-rebase with 'mr pull' and 'mr push' actions
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/mr/config17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib-src/mr/config b/lib-src/mr/config
index 98f3d0d8..48e5e0d7 100644
--- a/lib-src/mr/config
+++ b/lib-src/mr/config
@@ -116,10 +116,21 @@ lib =
[src/dotfiles]
checkout = git clone https://git.spwhitton.name/dotfiles.git dotfiles
# We have a script to update master, and all other branches should be checked
-# out and committed to on only a single host, so no need to pull them, and
-# they'll always be rebaseable.
+# out and committed to on only a single host, so no need to update them here,
+# and they'll always be rebaseable.
update = git dotfiles-update-master
-push = git dotfiles-rebase
+# This is how we update from master on a host that has its own branch.
+pull = git dotfiles-update-master; git co "$hostname" && git rebase master
+# Attempt to ensure tip of master is signed before attempting to push.
+pre_push =
+ if git diff-index --quiet --cached HEAD \
+ && ! git verify-commit-by-fp \
+ 8DC2487E51ABDD90B5C4753F0F56D0553B6D411B master; then
+ branch="$(git rev-parse --abbrev-ref HEAD)"
+ [ "$branch" = master ] || git checkout master
+ git commit -S --amend --no-edit
+ [ "$branch" = master ] || git checkout "$branch"
+ fi
# Restowing is expensive, and most dangling symlinks into ~/.STOW do no harm,
# so we leave it to be run manually -- bstraph stows but does not restow.
# Possibly restowing could be done by locmaint, or we could have hstow skip