emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#35420: closed (Support git in ediff-patch-file)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#35420: closed (Support git in ediff-patch-file)
Date: Sun, 05 May 2019 19:53:02 +0000

Your message dated Sun, 05 May 2019 22:51:56 +0300
with message-id <address@hidden>
and subject line Re: bug#35420: Support git in ediff-patch-file
has caused the debbugs.gnu.org bug report #35420,
regarding Support git in ediff-patch-file
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
35420: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35420
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Support git in ediff-patch-file Date: Thu, 25 Apr 2019 00:38:43 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
This patch adds support for git patches to ediff-patch-file:

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

--- End Message ---
--- Begin Message --- Subject: Re: bug#35420: Support git in ediff-patch-file Date: Sun, 05 May 2019 22:51:56 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
>> 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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]