unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Stefan Kangas <stefan@marxist.se>
Cc: emacs-devel@gnu.org
Subject: Re: File names in ChangeLog entries
Date: Tue, 30 Nov 2021 20:07:12 +0000	[thread overview]
Message-ID: <87pmqhl85r.fsf@posteo.net> (raw)
In-Reply-To: <CADwFkmnccrJrt_bgMrm6+tEr+xU7_Mg8xR_xopLijeTMPx8f+w@mail.gmail.com> (Stefan Kangas's message of "Tue, 30 Nov 2021 11:19:55 -0800")

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

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-VC-relative-file-names-in-ChangeLog-entries.patch --]
[-- Type: text/x-patch, Size: 1285 bytes --]

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


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


(Something is currently wrong with my Savannah account so I wouldn't be
able to push the change myself).

-- 
	Philip Kaludercic

  reply	other threads:[~2021-11-30 20:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 19:19 File names in ChangeLog entries Stefan Kangas
2021-11-30 20:07 ` Philip Kaludercic [this message]
2021-11-30 22:01 ` Philipp Stephani
2021-11-30 23:24   ` Stefan Kangas
2021-12-01  3:24     ` Eli Zaretskii
2021-11-30 23:56   ` Andreas Schwab
2021-12-01  3:26     ` Eli Zaretskii
2021-11-30 23:16 ` Stefan Monnier
2021-11-30 23:55   ` Stefan Kangas
2021-12-01  3:32     ` Eli Zaretskii
2021-12-01  3:29   ` Eli Zaretskii
2021-12-01 13:39     ` Stefan Monnier
2021-12-01 13:52       ` Eli Zaretskii
2021-12-01 16:51         ` Stefan Monnier
2021-12-01 17:02           ` Eli Zaretskii
2021-12-01 17:28             ` Karl Fogel
2021-12-01 18:46             ` Stefan Monnier
2021-12-01 19:12               ` Eli Zaretskii
2021-12-01 19:22               ` Thien-Thi Nguyen
2021-12-01 19:32                 ` Eli Zaretskii
2021-12-01 20:49                   ` Thien-Thi Nguyen
2021-12-02  6:37                     ` Eli Zaretskii
2021-12-01 21:03                   ` Stefan Monnier
2021-12-01 21:50                     ` Stefan Kangas
2021-12-01 22:21                       ` Stefan Monnier
2021-12-01 23:14                         ` Stefan Kangas
2021-12-02  6:43                           ` Karl Fogel
2021-12-02  7:10                             ` Stefan Monnier
2021-12-02  9:12                             ` Juri Linkov
2021-12-02 10:08                               ` Eli Zaretskii
2021-12-02 21:09                                 ` Stefan Monnier
2021-12-03  7:36                                   ` Eli Zaretskii
2021-12-03 12:57                                     ` Stefan Monnier
2021-12-03 13:06                                       ` Eli Zaretskii
2021-12-02 22:11                                 ` Karl Fogel
2021-12-02 11:02                             ` Stefan Kangas
2021-12-03  2:43                               ` Karl Fogel
2021-12-02  7:12                         ` Eli Zaretskii
2021-12-02  7:34                           ` Stefan Monnier
2021-12-02  8:33                             ` Eli Zaretskii
2021-12-02  6:40                       ` Eli Zaretskii
2021-12-02 16:59                     ` Matt Armstrong
2021-12-01  6:11 ` Alfred M. Szmidt

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=87pmqhl85r.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=stefan@marxist.se \
    /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).