GNU bug report logs - #55039
[PATCH] Use VC-relative file names in ChangeLog entries

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Wed, 20 Apr 2022 14:20:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philip Kaludercic <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 55039 <at> debbugs.gnu.org
Subject: bug#55039: [PATCH] Use VC-relative file names in ChangeLog entries
Date: Tue, 06 Sep 2022 14:34:58 +0000
[Message part 1 (text/plain, inline)]
Philip Kaludercic <philipk <at> posteo.net> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>>> First, I think this must be customizable, because different projects
>>> have different conventions.
>>
>> This was several months ago -- Philip, did you do any further work in
>> this direction?
>
> No I hadn't, but I can take tackle it again as this shouldn't be that
> difficult.

Something like this should be enough, at least functionality wise,
right?

[Message part 2 (text/plain, inline)]
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 322d4abd31..1f0eec0d66 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2336,6 +2336,12 @@ diff-undo
   (let ((inhibit-read-only t))
     (undo arg)))
 
+(defcustom diff-relative-names-in-changelog nil
+  "Use relative file names when generating ChangeLog messages."
+  :type 'boolean
+  :safe #'booleanp
+  :version "29.1")
+
 (defun diff-add-log-current-defuns ()
   "Return an alist of defun names for the current diff.
 The elements of the alist are of the form (FILE . (DEFUN...)),
@@ -2374,9 +2380,11 @@ diff-add-log-current-defuns
           (re-search-forward diff-hunk-header-re nil t)
         (setq hunk-end (save-excursion (diff-end-of-hunk)))
         (pcase-let* ((filename (substring-no-properties
-                                (file-relative-name
-                                   (diff-find-file-name)
-                                   (vc-root-dir))))
+                                (if diff-relative-names-in-changelog
+                                    (file-relative-name
+                                     (diff-find-file-name)
+                                     (vc-root-dir))
+                                  (diff-find-file-name))))
                      (=lines 0)
                      (+lines 0)
                      (-lines 0)
[Message part 3 (text/plain, inline)]
Assuming nobody objects to the name of the option, should this be
documented in NEWS and/or in the Manual?  Also, as the entire point of
the patch was that emacs.git is using relative path names, should a
.dir-locals.el variable be set to ensure this is done?

This bug report was last modified 2 years and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.