From 6e0de30947797b84e17bdbbecb703d31d75b8a71 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Wed, 9 Jun 2010 14:41:50 -0700 Subject: [PATCH 1/2] Make sure magit-log-edit-set-fields works properly when there are no headers. Before, if there were no headers but there was a header line, an extra header line was added. --- magit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit.el b/magit.el index c03ad68d..f4c32c08 100644 --- a/magit.el +++ b/magit.el @@ -3115,7 +3115,7 @@ Prefix arg means justify as well." (let ((buf (get-buffer-create magit-log-edit-buffer-name))) (with-current-buffer buf (goto-char (point-min)) - (if (search-forward-regexp (format "^\\([A-Za-z0-9-_]+:.*\n\\)+%s" + (if (search-forward-regexp (format "^\\([A-Za-z0-9-_]+:.*\n\\)*%s" (regexp-quote magit-log-header-end)) nil t) (delete-region (match-beginning 0) (match-end 0))) From f0c05ea93d4dd90b623ebd914864fe75bf2da234 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Wed, 9 Jun 2010 14:50:59 -0700 Subject: [PATCH 2/2] Don't add info to the edit log when a commit is successfully applied. Previously, if a commit was successfully applied and committed, its information was still added to the edit log. This wasn't useful. Now the information is only added if the commit wasn't committed (e.g. with a) or if it was committed (with A) but the commit failed. --- magit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magit.el b/magit.el index f4c32c08..ca46de7f 100644 --- a/magit.el +++ b/magit.el @@ -3479,7 +3479,7 @@ With prefix argument, changes in staging area are kept. ,@(if (not docommit) (list "--no-commit")) ,commit) nil noerase))) - (when (or (not docommit) success) + (when (or (not docommit) (not success)) (cond (revert (magit-log-edit-append (magit-format-commit commit "Reverting \"%s\"")))