From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Arseny Sher Newsgroups: gmane.emacs.help Subject: epatch for multifile patches Date: Wed, 08 Mar 2017 16:34:29 +0300 Message-ID: <87fuinhoyi.fsf@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488983092 16539 195.159.176.226 (8 Mar 2017 14:24:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 14:24:52 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 15:24:47 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clcWB-0003V2-OO for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 15:24:43 +0100 Original-Received: from localhost ([::1]:56705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clcWH-0004cD-S2 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 09:24:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clbji-0006cc-7R for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 08:34:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clbje-0007vb-BS for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 08:34:38 -0500 Original-Received: from forward15j.cmail.yandex.net ([5.255.227.179]:44224) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clbjd-0007us-Tp for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 08:34:34 -0500 Original-Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [77.88.29.84]) by forward15j.cmail.yandex.net (Yandex) with ESMTP id 56AA522B15 for ; Wed, 8 Mar 2017 16:34:31 +0300 (MSK) Original-Received: from smtp1p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1p.mail.yandex.net (Yandex) with ESMTP id 41E331780BBA for ; Wed, 8 Mar 2017 16:34:30 +0300 (MSK) Original-Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 38SooOYpUs-YUYKTkmk; Wed, 08 Mar 2017 16:34:30 +0300 (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1488980070; bh=c/B2FJt8xJ8EP55oj31J0wZoV8YblI63oujR1e6RsQA=; h=From:To:Subject:Date:Message-ID; b=tykHPESEy/8cLnr/kqI/82a+x/ZTq11wYiyI0gd7hYgwFAxkWphjE+IW80ROEj1iY wGo4oljDxaoT+hMZdRg1dPFMpbHyHRABDO0itzdlzuHcznAhI55HSjHtjzgAg2gSc4 Nqampw2UcL7wSXa5bGH3JCu05/17Pe96ZKrw1D+I= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.255.227.179 X-Mailman-Approved-At: Wed, 08 Mar 2017 09:21:42 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112461 Archived-At: Hello, I am having trouble using epatch while applying multifile patches. Consider the following simple example: ars@ars-thinkpad ~/tmp $ mkdir -p old/src ars@ars-thinkpad ~/tmp $ echo "void main() { }" > old/src/hello.c ars@ars-thinkpad ~/tmp $ mkdir -p new/src ars@ars-thinkpad ~/tmp $ echo "int main() { return 0; }" > new/src/hello.c ars@ars-thinkpad ~/tmp $ diff -cr old/ new/ > tmp.patch ars@ars-thinkpad ~/tmp $ cat tmp.patch diff -cr old/src/hello.c new/src/hello.c *** old/src/hello.c 2017-03-08 14:29:24.743846995 +0300 --- new/src/hello.c 2017-03-08 14:29:32.399846824 +0300 *************** *** 1 **** ! void main() { } --- 1 ---- ! int main() { return 0; } Now I start emacs and do M-x epatch. First of all, it asks me for patch buffer or file, I point to '~/tmp/tmp.patch'. Then it asks for directory to patch, I say '~/tmp/old' and ediff complains Ediff has inferred that /home/ars/tmp/old/hello.c is assumed to be the target for this patch. However, this file does not exist. Please enter an alternative patch target ... because it ignores the path ('src' directory in this case) to the file. Ediff manual says: "Ediff can recognize multi-file patches only if they are in the context format or GNU unified format. All other patches are treated as 1-file patches. Ediff is [hopefully] using the same algorithm as patch to determine which files need to be patched." So, if I understood it correctly, this should work. Is it a bug or what? I tried it on GNU Emacs versions 25.1, 25.2 RC2 and daily build 26.0.50.2, the result is the same. I use GNU/Linux, Ubuntu 14.04.