added 'tvd-stage-and-commit-current-buffer

So now I can enter C-c g ('magit-file-dispatch) and from there press C
which causes  the current  buffer to  be staged  and a  commit be
created in one run.
This commit is contained in:
2023-06-17 15:42:01 +02:00
parent 4b6b9df47a
commit 48a90d2b67

View File

@@ -85,6 +85,16 @@
(transient-append-suffix 'magit-log "l" (transient-append-suffix 'magit-log "l"
'("s" "dired" magit-dired-jump)) '("s" "dired" magit-dired-jump))
;; for a one file commit just do the stage+commit in 1 step just as
;; with git commit -am
(defun tvd-stage-and-commit-current-buffer()
(interactive)
(magit-stage buffer-file-name)
(magit-commit-create))
(transient-append-suffix 'magit-file-dispatch "s"
'("C" "Stage+Commit" tvd-stage-and-commit-current-buffer))
;; after an exhausting discussion on magit#3139 I use this function ;; after an exhausting discussion on magit#3139 I use this function
;; to (kind of) switch to another repository from inside magit-status. ;; to (kind of) switch to another repository from inside magit-status.
(defun tvd-switch-magit-repo () (defun tvd-switch-magit-repo ()