From 31660bd34441ccacfa28c57e1d5c39a2f6e9338e Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 4 Feb 2008 15:50:23 +0100 Subject: Remove git-diff crud that confuses diff-mode --- gitsum.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gitsum.el b/gitsum.el index d28e65e..91d0c61 100644 --- a/gitsum.el +++ b/gitsum.el @@ -37,6 +37,7 @@ This mode is meant to be activated by `M-x gitsum' or pressing `s' in git-status ;; Undo doesn't work in read-only buffers else. (defun gitsum-undo () "Undo some previous changes. + Repeat this command to undo more changes. A numeric argument serves as a repeat count." (interactive) @@ -54,9 +55,10 @@ A numeric argument serves as a repeat count." (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)))) + (insert diff) + (goto-char (point-min)) + (delete-matching-lines "^index \\|^diff --git "))) + (set-buffer-modified-p nil))) (defun gitsum-commit () "Commit the patch as-is, asking for a commit message." -- cgit 1.4.1