[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File names in ChangeLog entries
From: |
Philip Kaludercic |
Subject: |
Re: File names in ChangeLog entries |
Date: |
Tue, 30 Nov 2021 20:07:12 +0000 |
Stefan Kangas <stefan@marxist.se> writes:
> I recommend using `add-change-log-entry-other-window' bound to `C-x 4 a'
> to get this right.
As I use C-c C-w in log-edit, I would appreciate it if a patch like this
could be merged:
>From f3f87cab56d1bc1754d9e83a9dd53d0cb48c02b0 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Tue, 30 Nov 2021 21:05:42 +0100
Subject: [PATCH] Use VC-relative file names in ChangeLog entries
* lisp/vc/diff-mode.el (diff-add-log-current-defuns): Check
vc-root-dir to prepend the project path to the file being modified.
See https://mail.gnu.org/archive/html/emacs-devel/2021-11/msg02195.html
---
lisp/vc/diff-mode.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 057ffcd06e..40749754d8 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2343,7 +2343,10 @@ diff-add-log-current-defuns
;; hunks (e.g., "diff --git ..." etc).
(re-search-forward diff-hunk-header-re nil t)
(setq hunk-end (save-excursion (diff-end-of-hunk)))
- (pcase-let* ((filename (substring-no-properties (diff-find-file-name)))
+ (pcase-let* ((filename (substring-no-properties
+ (file-relative-name
+ (diff-find-file-name)
+ (vc-root-dir))))
(=lines 0)
(+lines 0)
(-lines 0)
--
2.34.0
(Something is currently wrong with my Savannah account so I wouldn't be
able to push the change myself).
--
Philip Kaludercic