unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Eli Zaretskii <eliz@gnu.org>, 55039@debbugs.gnu.org
Subject: bug#55039: [PATCH] Use VC-relative file names in ChangeLog entries
Date: Tue, 06 Sep 2022 14:34:58 +0000	[thread overview]
Message-ID: <87o7vsfu5p.fsf@posteo.net> (raw)
In-Reply-To: <871qsooenn.fsf@posteo.net> (Philip Kaludercic's message of "Tue,  06 Sep 2022 14:45:00 +0200")

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

Philip Kaludercic <philipk@posteo.net> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Eli Zaretskii <eliz@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?


[-- Attachment #2: Type: text/plain, Size: 1355 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 261 bytes --]


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?

  reply	other threads:[~2022-09-06 14:34 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 14:19 bug#55039: [PATCH] Use VC-relative file names in ChangeLog entries Philip Kaludercic
2022-04-20 16:01 ` Eli Zaretskii
2022-09-06 11:13   ` Lars Ingebrigtsen
2022-09-06 11:24     ` Eli Zaretskii
2022-09-06 11:30       ` Lars Ingebrigtsen
2022-09-06 12:45     ` Philip Kaludercic
2022-09-06 14:34       ` Philip Kaludercic [this message]
2022-09-06 14:39         ` Lars Ingebrigtsen
2022-09-06 14:58         ` Robert Pluim
2022-09-06 15:02           ` Philip Kaludercic
2022-09-06 15:46         ` Eli Zaretskii
2022-09-06 20:11           ` Philip Kaludercic
2022-09-08  7:07             ` Eli Zaretskii
2022-09-08  8:45               ` Philip Kaludercic
2022-09-08  9:20                 ` Eli Zaretskii
2022-09-08 12:11                 ` Lars Ingebrigtsen
2022-09-08 12:19                   ` Visuwesh
2022-09-08 12:33                     ` Lars Ingebrigtsen
2022-09-08 12:43                       ` Philip Kaludercic
2022-09-08 12:44                         ` Lars Ingebrigtsen
2022-09-08 12:53                           ` Philip Kaludercic
2022-09-08 12:56                             ` Lars Ingebrigtsen
2022-09-11  8:16                               ` Philip Kaludercic
2022-09-11 11:08                                 ` Lars Ingebrigtsen
2022-09-08 12:56                             ` Robert Pluim
2022-09-08 13:10                               ` Lars Ingebrigtsen
2022-09-08 13:13                       ` Visuwesh
2022-09-08 12:52                     ` Robert Pluim
2022-09-06 16:13         ` Juri Linkov
2022-09-06 20:10     ` Philip Kaludercic
2022-09-07 10:08       ` Robert Pluim
2022-09-07 12:48       ` Lars Ingebrigtsen
2022-09-07 13:27       ` Eli Zaretskii
2022-09-07 15:53         ` Philip Kaludercic
2022-09-07 18:12           ` Eli Zaretskii
2022-09-07 18:27             ` Philip Kaludercic
2022-09-07 18:46               ` Eli Zaretskii
2022-09-07 21:23                 ` Philip Kaludercic
2022-09-08  5:38                   ` Eli Zaretskii
2022-09-08  6:22                     ` Philip Kaludercic
2022-09-08  2:58         ` Richard Stallman
2022-09-08  6:18           ` Philip Kaludercic
2022-04-22  3:03 ` Richard Stallman
2022-04-22  5:29   ` Eli Zaretskii
2022-04-23  3:46     ` Richard Stallman
2022-04-23  6:17       ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7vsfu5p.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=55039@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).