From 006de80905d9628e51687975c08d2a080adc5ca4 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 8 Feb 2024 18:29:11 +0200 Subject: Add gnosis-auto-push Boolean value, when t auto pushes with git --- gnosis.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnosis.el b/gnosis.el index 88655cf..dcc6450 100644 --- a/gnosis.el +++ b/gnosis.el @@ -74,10 +74,10 @@ between two strings to consider them as similar." :type 'integer :group 'gnosis) -(defcustom gnosis-push-command nil - "Command to run to push " - :type 'string - group 'gnosis) +(defcustom gnosis-auto-push nil + "Automatically run `git push' at the end of every review session." + :type 'boolean + :group 'gnosis) (defvar gnosis-images-dir (expand-file-name "images" gnosis-dir) "Gnosis images directory.") @@ -1036,6 +1036,8 @@ NOTE-NUM: The number of notes reviewed in the session." (shell-command (concat git " add " (shell-quote-argument "gnosis.db"))) (shell-command (concat git " commit -m " (shell-quote-argument (concat (format "Total notes for session: %d " note-num))))) + (when gnosis-auto-push + (shell-command (concat git " push"))) (message "Review session finished. %d notes reviewed." note-num))) (defun gnosis-review--session (notes) -- cgit v1.2.3