summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-17 21:56:26 +0200
committerThanos Apollo <[email protected]>2024-02-17 21:56:26 +0200
commitc3d9f9b1b1ccb1018e66b6767ee5cb0b191858d0 (patch)
tree8793965fe8b0e6830cc1d59683150fde4351c3e2 /gnosis.el
parent2b05af78537170bd53ccbd07f998b9a4082eb3b6 (diff)
Add gnosis-git--process
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 0750e87..49f917d 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1025,6 +1025,18 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face."
(funcall func-name id)))
(error "Malformed note type: '%s'" type))))
+(defun gnosis-git--process (command)
+ "Start a git process with COMMAND."
+ (let ((proc (start-process "*git-gnosis*" nil "git" command)))
+ ;; Filter for password prompt
+ (set-process-filter proc (lambda (proc string)
+ (when (string-match "Password\\|password\\|passphrase" string)
+ (process-send-string proc (read-passwd "Password: ")))))
+ ;; Set sentinel to delete process when done
+ (set-process-sentinel proc (lambda (proc event)
+ (when (eq 'exit (process-status proc))
+ (unless (process-live-p proc)
+ (delete-process proc)))))))
(defun gnosis-review-commit (note-num)
"Commit review session on git repository.