diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2023-02-22 18:40:47 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2023-02-23 09:43:47 -0700 |
commit | dc249e80847adfdc9d0c00eaa44963af390ca279 (patch) | |
tree | 89ffafceed2c2c7799f2e30418fc3dc947c198d7 | |
parent | e0d5a0f66d75f3350ecb3cd673ddb7346f8cf3e2 (diff) | |
download | dotfiles-dc249e80847adfdc9d0c00eaa44963af390ca279.tar.gz |
return to using 'git update-index' over 'git annex add'
-rw-r--r-- | .emacs.d/init.el | 12 | ||||
-rw-r--r-- | lib-src/mr/config | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 794caa6b..92fd95fd 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -3179,15 +3179,15 @@ mutt's review view, after exiting EDITOR." (unless (or (string= "gdbmacs" daemon) (spw/on-host-primary-p "athena.silentflame.com")) (user-error "This is not the Gnusmacs you're looking for"))) - (let ((repo (expand-file-name "~/src/athpriv/")) - (news (expand-file-name "~/src/athpriv/News/"))) - (when (file-directory-p news) - (apply #'call-process "git" nil nil nil "-C" news "annex" "add" - (directory-files news nil "^[^.]")) + (let ((repo (expand-file-name "~/src/athpriv/"))) + (when (file-directory-p repo) ;; We want Gnus running on just one machine at once to avoid conflicts ;; in automatic updates to score files. If there are no uncommitted ;; changes then it might be that Gnus is already running somewhere else. - (unless (process-lines "git" "-C" news "status" "-s") + (unless (cl-remove-if-not + (apply-partially #'string-match + "^.. \"?News/.+\\.\\(?:SCORE\\|ADAPT\\)\"?$") + (process-lines "mr" "-d" repo "status")) (if (yes-or-no-p "~/src/athpriv/News/ has no changes; really start Gnus?") (unless (zerop (call-process "mr" nil "*myrepos athpriv update*" diff --git a/lib-src/mr/config b/lib-src/mr/config index d099a32e..ab16c88b 100644 --- a/lib-src/mr/config +++ b/lib-src/mr/config @@ -193,7 +193,14 @@ pre_update = on athena || git annex sync origin athenah pre_push = on athena || git annex sync --content origin athenah post_update = hstow restow ~/src/athpriv post_checkout = hstow stow ~/src/athpriv -pre_status = git annex add News/*.ADAPT News/*.SCORE +# Deal with phantom modifications because git-annex couldn't update the index. +# Avoid calling git-update-index(1) on other score files (including those +# we've already called it on since the last commit) so as to avoid continually +# annexing intermediate versions of score files. +pre_status = git status -s -- News/*.SCORE News/*.ADAPT \ + | perl -MGit=unquote_path,command \ + -wlne'/^ M / and push @up, unquote_path $'"'"'; + END { @up and command qw(update-index -q --refresh), @up }' skip = ! mine post_checkout = |