all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#35420: Support git in ediff-patch-file
@ 2019-04-24 21:38 Juri Linkov
  2019-04-25  6:14 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2019-04-24 21:38 UTC (permalink / raw)
  To: 35420

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

This patch adds support for git patches to ediff-patch-file:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ediff-ptch.git.patch --]
[-- Type: text/x-diff, Size: 995 bytes --]

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-05 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 21:38 bug#35420: Support git in ediff-patch-file Juri Linkov
2019-04-25  6:14 ` Eli Zaretskii
2019-04-25  7:53   ` Robert Pluim
2019-04-25  8:46     ` Eli Zaretskii
2019-04-25  9:12       ` Robert Pluim
2019-05-05 19:51       ` Juri Linkov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.