summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-12-27 12:03:38 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-12-27 12:03:38 -0700
commite9dcb2841273bdfc0a5059bd59e9155f3f55c637 (patch)
tree0be6df7ffde5f14cd4fa982b9b08de630d54b837 /lib-src
parent237e92dfbb507b081a4592808bf82a0e89fc4493 (diff)
downloaddotfiles-e9dcb2841273bdfc0a5059bd59e9155f3f55c637.tar.gz
src/emacs/primary 'mr pull': check we found a branch & output hint
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/mr/config13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib-src/mr/config b/lib-src/mr/config
index 2a7673c2..1a2aa363 100644
--- a/lib-src/mr/config
+++ b/lib-src/mr/config
@@ -409,11 +409,16 @@ post_checkout = cd primary; ./autogen.sh autoconf
# help here). So for convenient updates of "$(hostname -s)" to its conceptual
# upstream, we have this definition. "pull" not "update" because we want to
# update from upstream deliberately, not as part of automated updates.
-pull = git checkout "$hostname" \
- && git pull --rebase --autostash origin \
- "${1:-$(git reflog $hostname -1 --pretty='%gs' \
- --grep-reflog='^pull --rebase --autostash origin ' \
+pull =
+ branch="${1:-$(git reflog $hostname -1 --pretty='%gs' \
+ --grep-reflog='^pull --rebase --autostash origin' \
| awk '{print $5}')}"
+ if [ -n "$branch" ]; then
+ git co "$hostname"
+ git pull --rebase --autostash origin "$branch"
+ else
+ echo >&2 "Don't know what to pull; try 'mr pull BRANCH'."; exit 1
+ fi
skip = lazy || git_worktree_skip
[src/emacs/release]