From c3f9c79293c93b7b01645ba48a01dfb453beed63 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 24 Jul 2022 12:09:50 -0400 Subject: km/magit-update-or-auto-commit: Improve message for new file --- lisp/km-magit.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 95ce2a7..1f9caa9 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -57,12 +57,14 @@ a proper commit." (cl-case (length files) (0 (user-error "No tracked files with changes")) (1 - (magit-run-git "commit" "--all" "--message" - (concat (funcall (if no-directory - #'file-name-nondirectory - #'identity) - (car files)) - ": Update"))) + (let ((file (car files))) + (magit-run-git "commit" "--all" "--message" + (concat (funcall (if no-directory + #'file-name-nondirectory + #'identity) + file) + (and (magit-rev-verify (concat "HEAD:" file)) + ": Update"))))) (t (km/magit-auto-commit))))) -- cgit v1.2.3