summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-03-22 16:42:28 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-03-22 16:42:42 -0700
commitddd9111a90f59abedd5065bfb7ac53454f816780 (patch)
treeab6b478e8645787a421319ff4c13c16d9f9e8199 /admin
parent4fab26ba5ac381ce836eff521fc56d8d28570221 (diff)
Compute a better commit message for merges
Problem reported by David Engster in: http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01270.html * admin/gitmerge.el (gitmerge-commit-message): Truncate the computed commit message to at most 72 characters per line. (gitmerge-maybe-resume): Don’t use "-" as the commit message for merges; use the computed commit message instead.
Diffstat (limited to 'admin')
-rw-r--r--admin/gitmerge.el12
1 files changed, 5 insertions, 7 deletions
diff --git a/admin/gitmerge.el b/admin/gitmerge.el
index 74e6f80487..6a52f7a60a 100644
--- a/admin/gitmerge.el
+++ b/admin/gitmerge.el
@@ -331,6 +331,10 @@ is nil, only the single commit BEG is merged."
(if end (list (concat beg "~.." end))
`("-1" ,beg)))
(insert "\n")
+ ;; Truncate to 72 chars so that the resulting ChangeLog line fits in 80.
+ (goto-char (point-min))
+ (while (re-search-forward "^\\(.\\{69\\}\\).\\{4,\\}" nil t)
+ (replace-match "\\1..."))
(buffer-string)))
(defun gitmerge-apply (missing from)
@@ -432,14 +436,8 @@ If so, add no longer conflicted files and commit."
(when mergehead
(with-current-buffer (get-buffer-create gitmerge-output-buffer)
(erase-buffer)
- ;; FIXME: We add "-m-" because the default commit message
- ;; apparently tickles our commit hook:
- ;; Line longer than 78 characters in commit message
- ;; Line longer than 78 characters in commit message
- ;; Line longer than 78 characters in commit message
- ;; Commit aborted; please see the file CONTRIBUTE
(unless (zerop (call-process "git" nil t nil
- "commit" "--no-edit" "-m-"))
+ "commit" "--no-edit"))
(error "Git error during merge - fix it manually"))))
;; Successfully resumed.
t))))