From 8e7e33acfe174020f641c95d9248075e872df5ed Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 4 Feb 2008 13:48:24 +0100 Subject: Show message on empty diff --- gitsum.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gitsum.el b/gitsum.el index 9ac106d..50fa09a 100644 --- a/gitsum.el +++ b/gitsum.el @@ -49,7 +49,10 @@ A numeric argument serves as a repeat count." (insert "# Directory: " default-directory "\n") (insert "# Use n and p to navigate and k to kill a hunk. u is undo, g will refresh.\n") (insert "# Edit the patch as you please and press 'c' to commit.\n\n") - (insert (shell-command-to-string "git diff")) + (let ((diff (shell-command-to-string "git diff"))) + (if (zerop (length diff)) + (insert "## No changes. ##") + (insert diff))) (set-buffer-modified-p nil) (goto-char (point-min)))) @@ -77,7 +80,9 @@ A numeric argument serves as a repeat count." (shell-command-on-region (point-min) (point-max) "git apply --cached")) (shell-command-on-region (point-min) (point-max) - "git commit -F- --cleanup=strip")) + "git commit -F- --cleanup=strip") + (with-current-buffer log-edit-parent-buffer + (gitsum-refresh))) (defun gitsum () "Entry point into gitsum-diff-mode." -- cgit 1.4.1