diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-27 11:53:02 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-27 11:53:02 -0700 |
commit | 025ee35dadf207f72691cf55a573dd897728bb00 (patch) | |
tree | 7cbf8e95ef10f835497178ab61872f4e9c510d09 | |
parent | 04ead44c46cc71c9d6f076e84da1e11f9e5d8864 (diff) | |
download | dotfiles-025ee35dadf207f72691cf55a573dd897728bb00.tar.gz |
more Emacs linked working trees, attempt a number of simplifications
-rw-r--r-- | .emacs.d/init.el | 5 | ||||
-rw-r--r-- | .gdbinit | 4 | ||||
-rwxr-xr-x | archive/bin/update-emacs-snapshot | 2 | ||||
-rwxr-xr-x | bin/emacsclient | 31 | ||||
-rw-r--r-- | lib-src/git/includes | 4 | ||||
-rw-r--r-- | lib-src/git/src/emacs/trunk (renamed from lib-src/git/src/emacs) | 0 | ||||
-rw-r--r-- | lib-src/mr/config | 71 |
7 files changed, 61 insertions, 56 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0c60b54c..f7a675d7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -2415,7 +2415,7 @@ Called by '~/src/dotfiles/bin/emacsclient --spw/update-environment'." (string-prefix-p "exited" gdb-inferior-status) (file-in-directory-p (buffer-local-value 'default-directory gud-comint-buffer) - (expand-file-name "~/src/emacs/"))) + (expand-file-name "~/src/emacs/primary/"))) (lambda () (gud-basic-call (if (setq pid (spw/daemon-pid name)) (format "attach %d" pid) @@ -2428,7 +2428,8 @@ Called by '~/src/dotfiles/bin/emacsclient --spw/update-environment'." (kill-buffer gud-comint-buffer)) (gdb-wait-for-pending (lambda () - (let ((default-directory (expand-file-name "~/src/emacs/"))) + (let ((default-directory + (expand-file-name "~/src/emacs/primary/"))) (gdb (if (setq pid (spw/daemon-pid name)) (format "gdb -i=mi --pid=%d src/emacs" pid) (format "gdb -i=mi --args src/emacs %s" arg)))) @@ -1 +1,3 @@ -add-auto-load-safe-path ~/src/emacs/src/.gdbinit +add-auto-load-safe-path ~/src/emacs/trunk/src/.gdbinit +add-auto-load-safe-path ~/src/emacs/release/src/.gdbinit +add-auto-load-safe-path ~/src/emacs/primary/src/.gdbinit diff --git a/archive/bin/update-emacs-snapshot b/archive/bin/update-emacs-snapshot index 11e0c544..3e86fe71 100755 --- a/archive/bin/update-emacs-snapshot +++ b/archive/bin/update-emacs-snapshot @@ -2,7 +2,7 @@ # assumes I've already tested the upstream snapshot via 'melete' branch -# now have a permanent worktree in ~/src/emacs-snapshot +# now have a permanent worktree in ~/src/deb/emacs-snapshot set -e diff --git a/bin/emacsclient b/bin/emacsclient index f9a238c5..2e555710 100755 --- a/bin/emacsclient +++ b/bin/emacsclient @@ -35,8 +35,8 @@ daemon_name= gdbmacs= args= -devel_emacs="$HOME/src/emacs/src/emacs" -devel_emacsclient="$HOME/src/emacs/lib-src/emacsclient" +devel_emacs="$HOME/src/emacs/primary/src/emacs" +devel_emacsclient="$HOME/src/emacs/primary/lib-src/emacsclient" installed_emacs=$(command -v emacs) installed_emacsclient=$(PATH=$(echo "$PATH" \ @@ -158,29 +158,18 @@ fi [ -z "$listener" ] && ! $may_start && ! $want_version && exit 0 -# We start up an in-tree Emacs daemon only when a branch named after this host -# is checked out, packages compiled against my emacs-snapshot Debian packages -# are available, and there isn't a build still in progress -- avoids having to -# consider whether a build is in progress when hitting 'C-i e'. -# -# The purpose of a branch for localhost is to keep track of what upstream -# commit we want to be running on this host (e.g. emacs-29 vs. master), and -# for WIP commits. It doesn't usually need to be pushed anywhere. +# We start up an in-tree Emacs daemon only when the linked worktree exists and +# there isn't a build still in progress. The latter means we avoid having to +# consider whether or not a build is in progress when hitting 'C-i e'. # # We also examine $installed_running here to avoid having the in-tree # emacsclient(1) connect to the installed Emacs. -if ! $want_installed && ! $installed_running \ - && [ -x "$HOME/src/emacs/lib-src/emacsclient" \ - -a -d "/usr/share/emacs-snapshot/site-lisp/elpa" ]; then - make="$(ps h -o pid -C make)" - branch="$(git -C $HOME/src/emacs rev-parse --abbrev-ref HEAD)" -fi - -if [ "$branch" = "$(hostname -s)" ] \ - && ! ( ! $devel_running && [ -n "$make" ] \ - && echo "$make" | xargs pwdx \ - | grep -q "$HOME/src/emacs" ); then +if ! $want_installed && ! $installed_running && [ -x "$devel_emacsclient" ] \ + && ( $devel_running \ + || ! ( make="$(ps h -o pid -C make)" + [ -n "$make" ] && echo "$make" | xargs pwdx \ + | grep -q "$HOME/src/emacs/primary" ) ); then emacs=("$devel_emacs") emacsclient=("$devel_emacsclient") if [ -z "$daemon_name" ] && ! $want_version; then diff --git a/lib-src/git/includes b/lib-src/git/includes index e971702d..6f8114af 100644 --- a/lib-src/git/includes +++ b/lib-src/git/includes @@ -18,8 +18,8 @@ path = ~/src/dotfiles/lib-src/git/src/cl/consfigurator [includeIf "gitdir:~/src/dotfiles/"] path = ~/src/dotfiles/lib-src/git/src/dotfiles -[includeIf "gitdir:~/src/emacs/"] - path = ~/src/dotfiles/lib-src/git/src/emacs +[includeIf "gitdir:~/src/emacs/trunk/"] + path = ~/src/dotfiles/lib-src/git/src/emacs/trunk [includeIf "gitdir:~/src/notmuch/"] path = ~/src/dotfiles/lib-src/git/src/notmuch [includeIf "gitdir:~/src/p5-API-GitForge/"] diff --git a/lib-src/git/src/emacs b/lib-src/git/src/emacs/trunk index 11868dd6..11868dd6 100644 --- a/lib-src/git/src/emacs +++ b/lib-src/git/src/emacs/trunk diff --git a/lib-src/mr/config b/lib-src/mr/config index e5622594..91f2bd53 100644 --- a/lib-src/mr/config +++ b/lib-src/mr/config @@ -313,14 +313,16 @@ isclean = # own usage, on this machine or in general # # - WIP patches of my own -- this branch is used for my own development -# work, at least where that doesn't require long-lived feature branches. +# work, at least where that doesn't require long-lived feature +# branches, or when we are rebasing onto master but need to commit to +# emacs-NN and they're too different to cherry-pick across, etc.. # # A key advantage of using these development builds is that references to -# files in *Help* buffers will be to ~/src/emacs, not to somewhere owned -# by root. Another reason for having a branch for localhost is to keep -# track of what upstream commit we want to be running on this host, and -# which upstream branch we want to rebase onto, e.g. emacs-29 vs. master, -# or some feature branch we want to test here. +# files in *Help* buffers will be to ~/src/emacs/primary, not to somewhere +# owned by root. Another reason for having a branch for localhost is to +# keep track of what upstream commit we want to be running on this host, +# and which upstream branch we want to rebase onto, e.g. emacs-29 +# vs. master, or some feature branch we want to test here. # # This branch doesn't usually need to be pushed anywhere, but if we do # need to push it somewhere for backup purposes, we execute @@ -347,7 +349,7 @@ isclean = # than my development laptop. To do that, first "melete" is updated using # "mr pull", and then I run that build for a day or so. Then # -# % cd ~/src/emacs-snapshot +# % cd ~/src/deb/emacs-snapshot # % debian/merge-snapshot # % dgit sbuild --no-run-lintian # % cp ../emacs-snapshot_29~git202*amd64.deb<TAB> ~/local/develacc/tmp @@ -362,11 +364,12 @@ isclean = # $ /opt/emacs-snapshot/bin/emacs -nw --debug-init # # % sudo virsh destroy develacc.melete.silentflame.com -# % cd ~//src/emacs-snapshot +# % cd ~//src/deb/emacs-snapshot # % reprepro-rebuilder --release # if develacc test was successful # # If need to back out before reprepro-rebuilder: -# % cd ~/src/emacs-snapshot && git reset --hard demeter/athena/unstable +# % cd ~/src/deb/emacs-snapshot +# % git reset --hard demeter/athena/unstable # # It is important to test local installability of the new .deb, probably # in develacc or a sid chroot, before adding to demeter-apt, because @@ -380,7 +383,8 @@ isclean = # # See also bin/emacsclient wrapper script in dotfiles.git. -[src/emacs] +# This worktree: usually the master branch, sometimes some feature branch. +[src/emacs/trunk] checkout = git clone https://git.savannah.gnu.org/git/emacs.git post_clean = ./autogen.sh autoconf post_checkout = @@ -388,18 +392,18 @@ post_checkout = git remote add -f demeter demeter:emacs ||: git -c fetch.fsckObjects=false \ remote add -f debian https://salsa.debian.org/rlb/deb-emacs.git/ ||: - # We might want a branch for localhost on non-workstations, but we only - # automatically create one on workstations. - if workstation; then - if [ -n "$(git for-each-ref '[r]efs/remotes/demeter/'$hostname)" ]; then - git checkout -b "$hostname" demeter/"$hostname" --no-track - else - git checkout -b "$hostname" --no-track - fi - fi ./autogen.sh all -fixups = git rev-parse "$hostname"@{upstream} >/dev/null 2>&1 \ - && git branch --unset-upstream "$hostname" +skip = lazy + +# This worktree: either a detached HEAD or the "$hostname" branch. +[src/emacs/primary] +checkout = git_worktree_checkout "$HOME/src/emacs/trunk" \ + -b "$hostname" --no-track \ + "$(if [ -n "$(git -C $HOME/src/emacs/trunk \ + for-each-ref '[r]efs/remotes/demeter/'"$hostname")" ] + then echo demeter/"$hostname"; else echo master; fi)" +post_clean = ./autogen.sh autoconf +post_checkout = cd primary; ./autogen.sh autoconf # We don't have the "$(hostname -s)" branch's upstream set to origin/master to # avoid accidentally pushing personal commits to Savannah (push.default cannot # help here). So for convenient updates of "$(hostname -s)" to its conceptual @@ -410,21 +414,30 @@ pull = git checkout "$hostname" \ "${1:-$(git reflog $hostname -1 --pretty='%gs' \ --grep-reflog='^pull --rebase --autostash origin ' \ | awk '{print $5}')}" -skip = lazy || ( [ "$MR_ACTION" = pull ] \ - && [ -z "$(git for-each-ref '[r]efs/heads/'$hostname)" ] ) +skip = lazy || git_worktree_skip + +[src/emacs/release] +checkout = git_worktree_checkout "$HOME/src/emacs/trunk" \ + -b emacs-29 origin/emacs-29 +post_clean = ./autogen.sh autoconf +post_checkout = cd release; ./autogen.sh autoconf +skip = lazy || git_worktree_skip + +# src/deb/ contains repos/worktrees used only, or almost only, for packaging +# work, and not for working upstream. -[src/emacs-snapshot] -checkout = git_worktree_checkout "$HOME/src/emacs" \ +[src/deb/emacs-snapshot] +checkout = git_worktree_checkout "$HOME/src/emacs/trunk" \ -b athena/unstable demeter/athena/unstable skip = ! workstation || git_worktree_skip -[src/emacs-dfsg] -checkout = git_worktree_checkout "$HOME/src/emacs" \ +[src/deb/emacs] +checkout = git_worktree_checkout "$HOME/src/emacs/trunk" \ -b deb/emacs/d/sid/master debian/deb/emacs/d/sid/master skip = ! workstation || git_worktree_skip -[src/emacs-non-dfsg] -checkout = git_worktree_checkout "$HOME/src/emacs" \ +[src/deb/emacs-non-dfsg] +checkout = git_worktree_checkout "$HOME/src/emacs/trunk" \ -b deb/emacs-non-dfsg/d/sid/master debian/deb/emacs-non-dfsg/d/sid/master skip = ! workstation || git_worktree_skip |