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 multifile Date: Wed, 08 Mar 2017 17:12:44 +0300 Message-ID: <6572911488982364@web26m.yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1488982950 1896 195.159.176.226 (8 Mar 2017 14:22:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 14:22:30 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 15:22:26 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 1clcTx-00006K-PP for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 15:22:25 +0100 Original-Received: from localhost ([::1]:56686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clcU3-0002gm-Tb for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 09:22:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clcKn-0000jG-Th for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:12:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clcKg-0001dM-J6 for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:12:54 -0500 Original-Received: from forward18h.cmail.yandex.net ([87.250.230.160]:34573) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clcKg-0001ce-5N for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:12:50 -0500 Original-Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward18h.cmail.yandex.net (Yandex) with ESMTP id 626E022C46 for ; Wed, 8 Mar 2017 17:12:45 +0300 (MSK) Original-Received: from web26m.yandex.ru (web26m.yandex.ru [37.140.138.117]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YIWiJP36K9-Cic87Z9A; Wed, 08 Mar 2017 17:12:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1488982364; bh=sYvFd/Y9m6Ihcvkb687hk0WkcR2RaXjedTPI1OJGKsc=; h=From:To:Subject:Message-Id:Date; b=ELVtM7TtMCuhvuYJjlROfY4TXDJ/jQy76uBMk5Lzig6UHmLkKX14cR8ed8Ph1Oepe vo45/iQ1Og4OSLDUw1mawTnDQ+Z8+gDMfXgZ9Nw31poC0I6Wt8bDp1q83lbDUWRDN0 at7SRxO11xidvx+DBgqDG82X4R+pXKwul08y61rE= Authentication-Results: mxback6j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by web26m.yandex.ru with HTTP; Wed, 08 Mar 2017 17:12:44 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.250.230.160 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:112459 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. -- Arseny Sher