about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2008-02-04 13:48:24 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2008-02-04 13:48:24 +0100
commit8e7e33acfe174020f641c95d9248075e872df5ed (patch)
tree498d15d4c48bba59dfe60bee4a4a494f457a5c1d
parent937876a43d025e1e8da42a23ef16b0df8f2d8175 (diff)
downloadgitsum-8e7e33acfe174020f641c95d9248075e872df5ed.tar.gz
gitsum-8e7e33acfe174020f641c95d9248075e872df5ed.tar.xz
gitsum-8e7e33acfe174020f641c95d9248075e872df5ed.zip
Show message on empty diff
-rw-r--r--gitsum.el9
1 files 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."