diff options
| author | Paul Eggert | 2016-03-22 16:42:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-03-22 16:42:42 -0700 |
| commit | ddd9111a90f59abedd5065bfb7ac53454f816780 (patch) | |
| tree | ab6b478e8645787a421319ff4c13c16d9f9e8199 /admin | |
| parent | 4fab26ba5ac381ce836eff521fc56d8d28570221 (diff) | |
| download | emacs-ddd9111a90f59abedd5065bfb7ac53454f816780.tar.gz emacs-ddd9111a90f59abedd5065bfb7ac53454f816780.zip | |
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.el | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/admin/gitmerge.el b/admin/gitmerge.el index 74e6f80487b..6a52f7a60a9 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el | |||
| @@ -331,6 +331,10 @@ is nil, only the single commit BEG is merged." | |||
| 331 | (if end (list (concat beg "~.." end)) | 331 | (if end (list (concat beg "~.." end)) |
| 332 | `("-1" ,beg))) | 332 | `("-1" ,beg))) |
| 333 | (insert "\n") | 333 | (insert "\n") |
| 334 | ;; Truncate to 72 chars so that the resulting ChangeLog line fits in 80. | ||
| 335 | (goto-char (point-min)) | ||
| 336 | (while (re-search-forward "^\\(.\\{69\\}\\).\\{4,\\}" nil t) | ||
| 337 | (replace-match "\\1...")) | ||
| 334 | (buffer-string))) | 338 | (buffer-string))) |
| 335 | 339 | ||
| 336 | (defun gitmerge-apply (missing from) | 340 | (defun gitmerge-apply (missing from) |
| @@ -432,14 +436,8 @@ If so, add no longer conflicted files and commit." | |||
| 432 | (when mergehead | 436 | (when mergehead |
| 433 | (with-current-buffer (get-buffer-create gitmerge-output-buffer) | 437 | (with-current-buffer (get-buffer-create gitmerge-output-buffer) |
| 434 | (erase-buffer) | 438 | (erase-buffer) |
| 435 | ;; FIXME: We add "-m-" because the default commit message | ||
| 436 | ;; apparently tickles our commit hook: | ||
| 437 | ;; Line longer than 78 characters in commit message | ||
| 438 | ;; Line longer than 78 characters in commit message | ||
| 439 | ;; Line longer than 78 characters in commit message | ||
| 440 | ;; Commit aborted; please see the file CONTRIBUTE | ||
| 441 | (unless (zerop (call-process "git" nil t nil | 439 | (unless (zerop (call-process "git" nil t nil |
| 442 | "commit" "--no-edit" "-m-")) | 440 | "commit" "--no-edit")) |
| 443 | (error "Git error during merge - fix it manually")))) | 441 | (error "Git error during merge - fix it manually")))) |
| 444 | ;; Successfully resumed. | 442 | ;; Successfully resumed. |
| 445 | t)))) | 443 | t)))) |