From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#55039: [PATCH] Use VC-relative file names in ChangeLog entries Date: Wed, 20 Apr 2022 14:19:39 +0000 Message-ID: <8735i7zvk4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40724"; mail-complaints-to="usenet@ciao.gmane.io" To: 55039@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 20 16:51:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nhBfv-000AOK-3a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Apr 2022 16:51:23 +0200 Original-Received: from localhost ([::1]:40688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhBft-0001f6-Mz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Apr 2022 10:51:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhBBb-0003KF-4X for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2022 10:20:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhBBa-0004zZ-Qe for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2022 10:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nhBBa-00051l-En for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2022 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Apr 2022 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55039 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165046438919296 (code B ref -1); Wed, 20 Apr 2022 14:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Apr 2022 14:19:49 +0000 Original-Received: from localhost ([127.0.0.1]:46989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhBBN-000519-7U for submit@debbugs.gnu.org; Wed, 20 Apr 2022 10:19:49 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhBBL-000511-3b for submit@debbugs.gnu.org; Wed, 20 Apr 2022 10:19:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhBBK-0002qa-Ts for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2022 10:19:46 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:43029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhBBI-0004xi-Km for bug-gnu-emacs@gnu.org; Wed, 20 Apr 2022 10:19:46 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 672A6240026 for ; Wed, 20 Apr 2022 16:19:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1650464382; bh=1pNd4AEQ98EmgAqkZAlVyRFp539jMPB42Bvwfdye9iA=; h=From:To:Subject:Autocrypt:Date:From; b=iF08St16U7OTl1XAwG/Nkw+u0fA/49NIxoFlW6L3e8KnrsWiDUuokWh1PsRR8nYaY 611kWg7Ed6Dpz9nm8vovf1DNJwzqpgxq/EcHHjs/KFcvIoqZN+UiBxTmi5vZJOsQ3d Gi9K9CIPleVourCFW7eFuCsnepvY+nBEZ6c9QMV92h/IGpVj2dvsYy5RaW3sIoYoVi MEMLvx4rJCAr+vOUfqw09+knR65DUUEysBa3o5GehQMnh95nwpF3tY5WbUW7zVyP6v yCnfhNIbCrWzXoBDH5W5jy2ncW5/B+vAIBSW7r41RgYlvrPc5byMiDY7zqpzsCVJy3 H0XZGstkOQU/A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Kk2qd5n0Nz9rxM for ; Wed, 20 Apr 2022 16:19:41 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230299 Archived-At: --=-=-= Content-Type: text/plain Tags: patch By default C-c C-w (log-edit-generate-changelog-from-diff) just uses the file name when generating a changelog message. As it has been requested to use the project relative path name when writing changelog messages, it seems to make sense to generate these automatically as well. Alternatively, this could also be configured using a directory local variable that would be set for emacs.git. In GNU Emacs 29.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-04-19 built on viero Repository revision: d168decab4a03cd48b8b96257c36ffa575c720e6 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Guix System Configured using: 'configure PKG_CONFIG_PATH=/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Use-VC-relative-file-names-in-ChangeLog-entries.patch >From f3f87cab56d1bc1754d9e83a9dd53d0cb48c02b0 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic 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 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--