summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 9b6c3cd..d4af9d3 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -46,6 +46,18 @@ a proper commit."
(interactive)
(magit-run-git "commit" "--all" "--message=auto"))
+(defun km/magit-update-or-auto-commit ()
+ (interactive)
+ (let ((files (delete-dups (nconc (magit-modified-files)
+ (magit-staged-files)))))
+ (cl-case (length files)
+ (0 (user-error "No tracked files with changes"))
+ (1
+ (magit-run-git "commit" "--all" "--message"
+ (concat (car files) ": Update")))
+ (t
+ (km/magit-auto-commit)))))
+
;;;###autoload
(defun km/magit-show-commit-at-point (&optional choose-project)
"Show commit point.