From: Juri Linkov <juri@jurta.org>
To: 16170-done@debbugs.gnu.org
Subject: bug#16170: Customizable log-edit commit messages
Date: Thu, 19 Dec 2013 01:52:45 +0200 [thread overview]
Message-ID: <87sitrutqs.fsf@mail.jurta.org> (raw)
In-Reply-To: <87fvpsgvmd.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 17 Dec 2013 02:38:02 +0200")
> Currently the commit message is hard-coded that might be unsuitable
> to other projects with different conventions. This patch leaves the
> current default unchanged, and moves it to a separate function,
> so a set of messages could by easily configured in `log-edit-hook'.
> Adding `save-excursion' to `log-edit-insert-cvs-template' was
> necessary to not move point set by `message-position-point' in
> `log-edit-insert-message-template'.
This is a useful addition to accompany log-edit-insert-filenames
to insert the names of files that don't require ChangeLog entry,
but should be mentioned in the commit message:
=== modified file 'lisp/vc/log-edit.el'
--- lisp/vc/log-edit.el 2013-12-04 00:37:33 +0000
+++ lisp/vc/log-edit.el 2013-12-18 23:52:35 +0000
@@ -137,6 +137,7 @@
log-edit-insert-cvs-template
log-edit-insert-changelog
log-edit-insert-filenames
+ log-edit-insert-filenames-without-changelog
log-edit-show-files)))
(defcustom log-edit-mode-hook (if (boundp 'vc-log-mode-hook) vc-log-mode-hook)
@@ -664,6 +666,21 @@
(insert "Affected files: \n"
(mapconcat 'identity (log-edit-files) " \n")))
+(defun log-edit-insert-filenames-without-changelog ()
+ "Insert the list of files that have no ChangeLog message."
+ (interactive)
+ (let ((files
+ (delq nil
+ (mapcar
+ (lambda (file)
+ (unless (or (cdr-safe (log-edit-changelog-entries file))
+ (equal (file-name-nondirectory file) "ChangeLog"))
+ file))
+ (log-edit-files)))))
+ (when files
+ (goto-char (point-max))
+ (insert (mapconcat 'identity files ", ") ": "))))
+
(defun log-edit-add-to-changelog ()
"Insert this log message into the appropriate ChangeLog file."
(interactive)
prev parent reply other threads:[~2013-12-18 23:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 0:38 bug#16170: Customizable log-edit commit messages Juri Linkov
2013-12-18 23:52 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sitrutqs.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=16170-done@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.