summaryrefslogtreecommitdiff
path: root/.config/emacs/init.el
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-23 05:53:52 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-23 05:53:52 +0200
commitf9f358d564e77e12466318731498d6e67f3209a9 (patch)
tree29c30b5c0495d316b7e2cc22500e46b71f4c2f1f /.config/emacs/init.el
parentc2330d7ebec3a3a3cfbe96b41beefbd5ce7919c6 (diff)
emacs: Add magit option to ‘push all’
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r--.config/emacs/init.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index f3d10cd..3f01602 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -396,7 +396,20 @@ mode requires settings additional variables, those should be listed in
(use-package magit
:custom
(magit-display-buffer-function
- #'magit-display-buffer-same-window-except-diff-v1))
+ #'magit-display-buffer-same-window-except-diff-v1)
+ :config
+ (transient-define-suffix x-magit-push-current-to-all-remotes (args)
+ "Push the current branch to all remotes."
+ :if #'magit-get-current-branch
+ (interactive (list (magit-push-arguments)))
+ (run-hooks 'magit-credential-hook)
+ (let ((branch (magit-get-current-branch)))
+ (dolist (remote (magit-list-remotes))
+ (magit-run-git-async
+ "push" "-v" args remote
+ (format "refs/heads/%s:refs/heads/%s" branch branch)))))
+ (transient-append-suffix 'magit-push '(1 -1)
+ '("a" "all branches" x-magit-push-current-to-all-remotes)))
(use-package magit-todos
:after magit