From unknown Sun Jun 22 04:13:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35420: Support git in ediff-patch-file Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Apr 2019 21:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 35420@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15561421065810 (code B ref -1); Wed, 24 Apr 2019 21:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Apr 2019 21:41:46 +0000 Received: from localhost ([127.0.0.1]:56644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJPeE-0001VZ-5g for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJPe7-0001VB-EG for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:33565) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJPe2-0000en-6b for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJPe1-00056A-4s for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:41:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJPcN-0007tA-RC for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:39:52 -0400 Received: from gecko.birch.relay.mailchannels.net ([23.83.209.66]:48703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJPcN-0007rI-93 for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:39:51 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 771623E533F for ; Wed, 24 Apr 2019 21:39:48 +0000 (UTC) Received: from pdx1-sub0-mail-a90.g.dreamhost.com (unknown [100.96.28.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2E9D13E4BFC for ; Wed, 24 Apr 2019 21:39:48 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a90.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 24 Apr 2019 21:39:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Imminent-Arithmetic: 48f35d59356cc010_1556141988288_2228781223 X-MC-Loop-Signature: 1556141988287:3005225113 X-MC-Ingress-Time: 1556141988287 Received: from pdx1-sub0-mail-a90.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTP id A2A717FEE5 for ; Wed, 24 Apr 2019 14:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=16EbBFvVDjyUkUQ4KBuj3v8gLe4=; b=dpZY5FDDegMJYtBMB 5xPc+JZPRZKTfKO6bCEPvDdS07fNbcF9SIuhoU9RwrfNiQ0CiKYeNVNFA/s5iJD5 ZvCQ6gBTbDcYJu8DCUg4jOAFLb7i/xBivIK6A/sQSN/N0oE0lYQQwSNlQ9Np9boQ 2VZiR3V25O6MwZ/+hrOMJpvd/I= Received: from mail.jurta.org (m91-129-101-0.cust.tele2.ee [91.129.101.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTPSA id 528957FEF2 for ; Wed, 24 Apr 2019 14:39:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a90 From: Juri Linkov Organization: LINKOV.NET Date: Thu, 25 Apr 2019 00:38:43 +0300 Message-ID: <87y33zytgc.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrhedvgdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutddurddtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtuddrtddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.209.66 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain This patch adds support for git patches to ediff-patch-file: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ediff-ptch.git.patch diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 4178b5a8c0..5c71c2c8cb 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -297,11 +297,15 @@ ediff-fixup-patch-map ;; file names. This is a heuristic intended to improve guessing (let ((default-directory (file-name-directory filename))) (unless (or (file-name-absolute-p base-dir1) - (file-name-absolute-p base-dir2) - (not (file-exists-p base-dir1)) - (not (file-exists-p base-dir2))) - (setq base-dir1 "" - base-dir2 ""))) + (file-name-absolute-p base-dir2)) + (if (and (file-exists-p base-dir1) + (file-exists-p base-dir2)) + (setq base-dir1 "" + base-dir2 "") + (when (and (string-match-p "^a/" base-dir1) + (string-match-p "^b/" base-dir2)) + (setq base-dir1 "a/" + base-dir2 "b/"))))) (or (string= (car proposed-file-names) "/dev/null") (setcar proposed-file-names (ediff-file-name-sans-prefix --=-=-=-- From unknown Sun Jun 22 04:13:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35420: Support git in ediff-patch-file Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 06:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 35420@debbugs.gnu.org Received: via spool by 35420-submit@debbugs.gnu.org id=B35420.155617288728867 (code B ref 35420); Thu, 25 Apr 2019 06:15:02 +0000 Received: (at 35420) by debbugs.gnu.org; 25 Apr 2019 06:14:47 +0000 Received: from localhost ([127.0.0.1]:57253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJXeg-0007VW-Sl for submit@debbugs.gnu.org; Thu, 25 Apr 2019 02:14:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJXef-0007VK-7f for 35420@debbugs.gnu.org; Thu, 25 Apr 2019 02:14:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJXeZ-0003E7-Pv; Thu, 25 Apr 2019 02:14:39 -0400 Received: from [176.228.60.248] (port=1338 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJXeZ-0002hV-4z; Thu, 25 Apr 2019 02:14:39 -0400 Date: Thu, 25 Apr 2019 09:14:21 +0300 Message-Id: <83a7ge1uiq.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87y33zytgc.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 25 Apr 2019 00:38:43 +0300) References: <87y33zytgc.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Thu, 25 Apr 2019 00:38:43 +0300 > > + (when (and (string-match-p "^a/" base-dir1) > + (string-match-p "^b/" base-dir2)) > + (setq base-dir1 "a/" > + base-dir2 "b/"))))) I think I saw the file names begin with i/ and w/ instead of a/ and b/. Not sure when/why this happens. From unknown Sun Jun 22 04:13:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35420: Support git in ediff-patch-file Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 35420@debbugs.gnu.org, Juri Linkov Received: via spool by 35420-submit@debbugs.gnu.org id=B35420.15561788075420 (code B ref 35420); Thu, 25 Apr 2019 07:54:02 +0000 Received: (at 35420) by debbugs.gnu.org; 25 Apr 2019 07:53:27 +0000 Received: from localhost ([127.0.0.1]:57351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJZCA-0001PL-OQ for submit@debbugs.gnu.org; Thu, 25 Apr 2019 03:53:26 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:56161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJZC8-0001P3-O6 for 35420@debbugs.gnu.org; Thu, 25 Apr 2019 03:53:25 -0400 Received: by mail-wm1-f52.google.com with SMTP id o25so7951506wmf.5 for <35420@debbugs.gnu.org>; Thu, 25 Apr 2019 00:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version; bh=NMlUoJbM2ETRtOOg+EBPDWVigiwnEU98GaZbRCfTWXs=; b=NMvJfPuY2U1uARH0V5FtajxYS2IvunnibDRUF565aurHoipFyEUNDvP10xf/CmXIx4 gHF4oLvk38/NY/ZgY+Nyje07CygV7nDPfxchaW1CYQApmyhNbHrXjzYKP9HI49QfVV0k fJ/Dbq7Thoq4eJueE1PK5Ifv8B74LZ06DCrNwBOUDcp2NQqLVTL6pygYlYDuovC+Uz9g TuWk2sSdNRNmpX73JyrFpY7FDqHqEpQCQGrj/95BN/4akYTTM655t8bjk2QqYxd31efb hLBpeTqRXz5JAGYLwxLP2sqtjt+ZeWfxkzXP+wCq76NMfownYCGaf3b+Q6vDDlQLU+Mo hntg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=NMlUoJbM2ETRtOOg+EBPDWVigiwnEU98GaZbRCfTWXs=; b=Jx/W3AXVa1pnpfMedfc3rh5zPB1cq7ZAbBXARQyEzxv/rB95FnWRCpFNoegb7SW7oI IIPZ0+ZO2TiRdYzJgXcf5unRzpmem/4AwI7stpN1xNvUBmDf3cMwwmF1dr8NtB2tSnBK B/9prCxgIX807rWC+h4TpToYp3U1tcN581/ugOz6TzHEKvs9eyKNHrxCdD2uynF81aLN GXYjGPDxJqTfFtF0mM/BZeBDfSRpYZyc4K6ab9aMqVUYPZABqe3p70exRuNJW7ONGd/7 MfOtwoDuEHXaJ1RWRTVTEWP45y7dNjGQkhhySb9/QaFcZsXLcKkflz+l/58MeYkJyFTK m8/A== X-Gm-Message-State: APjAAAUjx/ptnFIDEK8KoMy38P7+JLDP7Oex6fSsjmidLctl3Yd0CnEf ltXixc2pbmPYBpR/LrRBZUzVXK6e X-Google-Smtp-Source: APXvYqyZjoTTZyeTHV+WGUH1mLQGd+cjzKifElNVFQ2S1EQPRnSGCHrtTvS19kX2G34bfySRAeLlFw== X-Received: by 2002:a05:600c:28b:: with SMTP id 11mr2258112wmk.129.1556178798329; Thu, 25 Apr 2019 00:53:18 -0700 (PDT) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id c139sm8456684wmd.26.2019.04.25.00.53.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Apr 2019 00:53:17 -0700 (PDT) From: Robert Pluim References: <87y33zytgc.fsf@mail.linkov.net> <83a7ge1uiq.fsf@gnu.org> Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Thu, 25 Apr 2019 09:53:16 +0200 In-Reply-To: <83a7ge1uiq.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Apr 2019 09:14:21 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) >>>>> On Thu, 25 Apr 2019 09:14:21 +0300, Eli Zaretskii said: >> From: Juri Linkov Date: Thu, 25 Apr 2019 >> 00:38:43 +0300 >> >> + (when (and (string-match-p "^a/" base-dir1) + (string-match-p >> "^b/" base-dir2)) + (setq base-dir1 "a/" + base-dir2 "b/"))))) Eli> I think I saw the file names begin with i/ and w/ instead of Eli> a/ and b/. Not sure when/why this happens. You get i/, w/ and/or c/ when you run 'git diff' inside your working tree, depending on whether the changed file is in the 'i'ndex, 'w'orking tree, or 'c'ache (also known as the staging area). Things like 'git format-patch' and 'git show' use a/ and b/ by default. And of course, since this is git, you can tell it to use other prefixes using '--src-prefix' and '--dst-prefix'. Robert From unknown Sun Jun 22 04:13:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35420: Support git in ediff-patch-file Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Robert Pluim Cc: 35420@debbugs.gnu.org, juri@linkov.net Received: via spool by 35420-submit@debbugs.gnu.org id=B35420.155618202310173 (code B ref 35420); Thu, 25 Apr 2019 08:48:02 +0000 Received: (at 35420) by debbugs.gnu.org; 25 Apr 2019 08:47:03 +0000 Received: from localhost ([127.0.0.1]:57403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJa22-0002e0-ER for submit@debbugs.gnu.org; Thu, 25 Apr 2019 04:47:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJa1y-0002dU-Gz for 35420@debbugs.gnu.org; Thu, 25 Apr 2019 04:46:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJa1t-0005Nu-48; Thu, 25 Apr 2019 04:46:53 -0400 Received: from [176.228.60.248] (port=2851 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJa1s-0005E8-EA; Thu, 25 Apr 2019 04:46:52 -0400 Date: Thu, 25 Apr 2019 11:46:33 +0300 Message-Id: <83wojizd3q.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Robert Pluim on Thu, 25 Apr 2019 09:53:16 +0200) References: <87y33zytgc.fsf@mail.linkov.net> <83a7ge1uiq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Juri Linkov , 35420@debbugs.gnu.org > Date: Thu, 25 Apr 2019 09:53:16 +0200 > > You get i/, w/ and/or c/ when you run 'git diff' inside your working > tree, depending on whether the changed file is in the 'i'ndex, > 'w'orking tree, or 'c'ache (also known as the staging area). Things > like 'git format-patch' and 'git show' use a/ and b/ by default. > > And of course, since this is git, you can tell it to use other > prefixes using '--src-prefix' and '--dst-prefix'. Thanks. I guess we'd like to support these use cases as well, right? Also, what's the situation with hg? Is it similar? From unknown Sun Jun 22 04:13:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35420: Support git in ediff-patch-file Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 09:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 35420@debbugs.gnu.org, juri@linkov.net Received: via spool by 35420-submit@debbugs.gnu.org id=B35420.155618357712454 (code B ref 35420); Thu, 25 Apr 2019 09:13:02 +0000 Received: (at 35420) by debbugs.gnu.org; 25 Apr 2019 09:12:57 +0000 Received: from localhost ([127.0.0.1]:57439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJaR6-0003En-0i for submit@debbugs.gnu.org; Thu, 25 Apr 2019 05:12:57 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:32790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJaR4-0003Ea-79 for 35420@debbugs.gnu.org; Thu, 25 Apr 2019 05:12:54 -0400 Received: by mail-wr1-f54.google.com with SMTP id s18so4410986wrp.0 for <35420@debbugs.gnu.org>; Thu, 25 Apr 2019 02:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=h3qdRLoY7G3Xs3ScthjUUwiJeDfKlQhf1d171b6qvQA=; b=VPJK4ny1BEvm1wFozeI3lCpk72lWXKaVjvgl2LAIu57MSPv/CH4WcUXYKujh9b0olk metX29zxB7Jjif6u4mytcKc96yFsdXcuyeX7czVRj55NWIF1BXyJePQbBab3S+VlfcFk A4ctnlcBJFadu+jJ3sokvaoHMMZwbTPnuEugMbdNdbszu7b3P6bv9HYYbW3I+lpITG3D NsPM0ZjZrhODns/BeK29vfHaOtQjenrfij6TuNnCA71pzjBmc6/O3R0VI+Rma3AUOA22 w8qrKEs9AeVepfTyhK85NIP7VPRY//2dQ+cjJwcm8EsDd7ODUARmsfLCMbjVcBaIMh3t gQDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=h3qdRLoY7G3Xs3ScthjUUwiJeDfKlQhf1d171b6qvQA=; b=IzwVEF00rSSwlAiFL33ZM487F6aoIHOlYO1GfBEIs12+1DBy7s9j4SmURS514rsOXL nhpPWq7zfrDaxxYwlBCEys9yEPqnGTTQJZdJCqmuHZGRunQmTejMWcHRIyRQ4KSzaMcy vxooNC5u8/KkIMkrRNd6O+H4HeIf7At82DkHRZYzOXJBtfusnis0py6CZOp3fKcFVdvc qR5EKWVJH+QlJIctIWJ7jHdG1s48iUKukbv2J8Jm0HTtnF7tTRVvN3Ek6hV2fDZxp/wX yLeWnpwO+qtis8Q8L/qTFsx97OYCjZheKOxucyNr0XqsIM/Eous+6mRLza+UBcsuK02B TRoA== X-Gm-Message-State: APjAAAU/WOy7yS4Hw1QgunSmhoDu31BCF3zYWrSLLajGRUr3lNtKwj2I r9xjbxHBXlPaaFvye7wo3hKBjZsr X-Google-Smtp-Source: APXvYqxwkm6tg+u87UUj5N39s/69JwSWJsKDOCru1Gve2xDRQ2VfY3E7HgA7VK7Tmh9E1O8ocm6SJQ== X-Received: by 2002:a5d:4087:: with SMTP id o7mr26344350wrp.9.1556183567903; Thu, 25 Apr 2019 02:12:47 -0700 (PDT) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id z6sm2140056wrw.87.2019.04.25.02.12.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Apr 2019 02:12:46 -0700 (PDT) From: Robert Pluim References: <87y33zytgc.fsf@mail.linkov.net> <83a7ge1uiq.fsf@gnu.org> <83wojizd3q.fsf@gnu.org> Mail-Copies-To: never Gmane-Reply-To-List: yes Date: Thu, 25 Apr 2019 11:12:45 +0200 In-Reply-To: <83wojizd3q.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Apr 2019 11:46:33 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Thu, 25 Apr 2019 11:46:33 +0300, Eli Zaretskii said: >> From: Robert Pluim Cc: Juri Linkov >> , 35420@debbugs.gnu.org Date: Thu, 25 Apr 2019 >> 09:53:16 +0200 >>=20 >> You get i/, w/ and/or c/ when you run 'git diff' inside your >> working tree, depending on whether the changed file is in the >> 'i'ndex, 'w'orking tree, or 'c'ache (also known as the staging >> area). Things like 'git format-patch' and 'git show' use a/ and >> b/ by default. >>=20 >> And of course, since this is git, you can tell it to use other >> prefixes using '--src-prefix' and '--dst-prefix'. Eli> Thanks. I guess we'd like to support these use cases as Eli> well, right? Yes, that would be a good improvement. Eli> Also, what's the situation with hg? Is it similar? I don=CA=BCt use hg, but based on a quick test it uses a/ and b/ Robert From unknown Sun Jun 22 04:13:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Juri Linkov Subject: bug#35420: closed (Re: bug#35420: Support git in ediff-patch-file) Message-ID: References: <87k1f4vfvn.fsf@mail.linkov.net> <87y33zytgc.fsf@mail.linkov.net> X-Gnu-PR-Message: they-closed 35420 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 35420@debbugs.gnu.org Date: Sun, 05 May 2019 19:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1557085982-13355-1" This is a multi-part message in MIME format... ------------=_1557085982-13355-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35420: Support git in ediff-patch-file which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35420@debbugs.gnu.org. --=20 35420: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35420 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1557085982-13355-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35420-done) by debbugs.gnu.org; 5 May 2019 19:52:25 +0000 Received: from localhost ([127.0.0.1]:54945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNNBR-0003SW-84 for submit@debbugs.gnu.org; Sun, 05 May 2019 15:52:25 -0400 Received: from palegreen.birch.relay.mailchannels.net ([23.83.209.140]:50103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNNBP-0003SN-HU for 35420-done@debbugs.gnu.org; Sun, 05 May 2019 15:52:24 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3559D5C429A; Sun, 5 May 2019 19:52:22 +0000 (UTC) Received: from pdx1-sub0-mail-a53.g.dreamhost.com (unknown [100.96.28.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E5D065C41AB; Sun, 5 May 2019 19:52:21 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a53.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Sun, 05 May 2019 19:52:22 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Eight-Coil: 6f4826a851351434_1557085942053_3486732904 X-MC-Loop-Signature: 1557085942053:2687763348 X-MC-Ingress-Time: 1557085942053 Received: from pdx1-sub0-mail-a53.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a53.g.dreamhost.com (Postfix) with ESMTP id 9E69480972; Sun, 5 May 2019 12:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Uxac/DR7QB5xa73RGtq+4zWwmhM=; b= n7k8RH6xrJoWjxFZ9a3WOnoQOT7ZT/MaVjwjskPdAqHIuYmEes25or/5E6+cn71r HF90JgTn324796BV9uLo3edq59kGosELnSVSFO5k4cAc9zMM2bxrFEseCHvLo6Ep Wdnqe/ppIJttAu7+CivZVAqNtFx3HAqkJRvXKGVRipQ= Received: from mail.jurta.org (m91-129-107-198.cust.tele2.ee [91.129.107.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a53.g.dreamhost.com (Postfix) with ESMTPSA id CDA308096D; Sun, 5 May 2019 12:52:19 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a53 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#35420: Support git in ediff-patch-file Organization: LINKOV.NET References: <87y33zytgc.fsf@mail.linkov.net> <83a7ge1uiq.fsf@gnu.org> <83wojizd3q.fsf@gnu.org> Date: Sun, 05 May 2019 22:51:56 +0300 In-Reply-To: <83wojizd3q.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Apr 2019 11:46:33 +0300") Message-ID: <87k1f4vfvn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrjeehgdduhedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrdduleeknecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrudelkedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35420-done Cc: Robert Pluim , 35420-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> You get i/, w/ and/or c/ when you run 'git diff' inside your working >> tree, depending on whether the changed file is in the 'i'ndex, >> 'w'orking tree, or 'c'ache (also known as the staging area). Things >> like 'git format-patch' and 'git show' use a/ and b/ by default. >> >> And of course, since this is git, you can tell it to use other >> prefixes using '--src-prefix' and '--dst-prefix'. > > Thanks. I guess we'd like to support these use cases as well, right? I implemented support for these cases as well and pushed to master. ------------=_1557085982-13355-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Apr 2019 21:41:46 +0000 Received: from localhost ([127.0.0.1]:56644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJPeE-0001VZ-5g for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJPe7-0001VB-EG for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:33565) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJPe2-0000en-6b for submit@debbugs.gnu.org; Wed, 24 Apr 2019 17:41:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJPe1-00056A-4s for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:41:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJPcN-0007tA-RC for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:39:52 -0400 Received: from gecko.birch.relay.mailchannels.net ([23.83.209.66]:48703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJPcN-0007rI-93 for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 17:39:51 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 771623E533F for ; Wed, 24 Apr 2019 21:39:48 +0000 (UTC) Received: from pdx1-sub0-mail-a90.g.dreamhost.com (unknown [100.96.28.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2E9D13E4BFC for ; Wed, 24 Apr 2019 21:39:48 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a90.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 24 Apr 2019 21:39:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Imminent-Arithmetic: 48f35d59356cc010_1556141988288_2228781223 X-MC-Loop-Signature: 1556141988287:3005225113 X-MC-Ingress-Time: 1556141988287 Received: from pdx1-sub0-mail-a90.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTP id A2A717FEE5 for ; Wed, 24 Apr 2019 14:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=16EbBFvVDjyUkUQ4KBuj3v8gLe4=; b=dpZY5FDDegMJYtBMB 5xPc+JZPRZKTfKO6bCEPvDdS07fNbcF9SIuhoU9RwrfNiQ0CiKYeNVNFA/s5iJD5 ZvCQ6gBTbDcYJu8DCUg4jOAFLb7i/xBivIK6A/sQSN/N0oE0lYQQwSNlQ9Np9boQ 2VZiR3V25O6MwZ/+hrOMJpvd/I= Received: from mail.jurta.org (m91-129-101-0.cust.tele2.ee [91.129.101.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTPSA id 528957FEF2 for ; Wed, 24 Apr 2019 14:39:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a90 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Support git in ediff-patch-file Organization: LINKOV.NET Date: Thu, 25 Apr 2019 00:38:43 +0300 Message-ID: <87y33zytgc.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrhedvgdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutddurddtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtuddrtddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.209.66 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain This patch adds support for git patches to ediff-patch-file: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ediff-ptch.git.patch diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 4178b5a8c0..5c71c2c8cb 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -297,11 +297,15 @@ ediff-fixup-patch-map ;; file names. This is a heuristic intended to improve guessing (let ((default-directory (file-name-directory filename))) (unless (or (file-name-absolute-p base-dir1) - (file-name-absolute-p base-dir2) - (not (file-exists-p base-dir1)) - (not (file-exists-p base-dir2))) - (setq base-dir1 "" - base-dir2 ""))) + (file-name-absolute-p base-dir2)) + (if (and (file-exists-p base-dir1) + (file-exists-p base-dir2)) + (setq base-dir1 "" + base-dir2 "") + (when (and (string-match-p "^a/" base-dir1) + (string-match-p "^b/" base-dir2)) + (setq base-dir1 "a/" + base-dir2 "b/"))))) (or (string= (car proposed-file-names) "/dev/null") (setcar proposed-file-names (ediff-file-name-sans-prefix --=-=-=-- ------------=_1557085982-13355-1--