From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: epatch for multifile patches Date: Wed, 08 Mar 2017 15:58:43 +0100 Message-ID: <87d1drizmk.fsf@drachen> References: <87fuinhoyi.fsf@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488985171 6228 195.159.176.226 (8 Mar 2017 14:59:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 14:59:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Arseny Sher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 15:59: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 1cld3g-0000Wi-7W for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 15:59:20 +0100 Original-Received: from localhost ([::1]:56838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cld3j-00046s-Bv for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 09:59:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cld3H-00046n-FC for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:58:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cld3D-0007ay-Cy for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:58:55 -0500 Original-Received: from mout.web.de ([212.227.15.3]:49951) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cld3D-0007aj-1s for help-gnu-emacs@gnu.org; Wed, 08 Mar 2017 09:58:51 -0500 Original-Received: from drachen.dragon ([94.218.187.81]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LmQS2-1cD7Zt3PLW-00Ztcg; Wed, 08 Mar 2017 15:58:47 +0100 In-Reply-To: <87fuinhoyi.fsf@yandex.ru> (Arseny Sher's message of "Wed, 08 Mar 2017 16:34:29 +0300") X-Provags-ID: V03:K0:BeoHVRDy/Lmi4a4R7lMQOI20FmhDkkN5UJb+B0dbI/OwMS97bY7 NMrnc0Z4Xk/ZfpZkOx7+T0rfutjKRJekj6IdNO+yRFN5CR7mBjvr6Hi6HZGk58BjX0SukYE KmG3Yce1YuK83XOiXaFuYojpfFkBqgcKL9cNcAI7nOn81SFqtLKv6sB42/K1rjjzmOcI/up yv6/UI+jGeWDiyOxTHdQA== X-UI-Out-Filterresults: notjunk:1;V01:K0:5BWOeaaTYrA=:c0hnBnRApSRh7cns5E79i/ WEuy435OWm1POcF50veUQn9u9RsVvQ9JjY4dW5hIbM9YM8rw/mIwC5jv03Sg/lLHuuRlN6gHT fW3MJOp9av9bMXKO9pF3YQRX47Js/ILUErl+AqSZnKhOgroJtncWdTb5WX+0gb+Lh7v+GR1FK F6egE8FtTurF4uPUUwF/roG2KjnL4iLEDVeyI7UXg0mRen7yma1lpr5xPQcBYEX3ObkeECeCB EYOy2Qzkoxr7KXItpSOzPbrTOQM6Gx6gt7Y0ZG0RWCxaPPEaTglA3PP1n0nxCzKHv7xiemFIg TsOKEnIWS1ScbXsmK9Nwk0ptcc+hsQaaunKdiIPYV4AfjPGPoLD/brwdltVRm2zbFrs4BROZz w228KkCr8IM7A3lZWoCc+qrqnR1VivO+50+wKr/yqGKWtvVCYO//k1ZqZ4RiVED1jgPUMeLvr xcx9RnnzcdmK5mMWkcaCGIiLmT9jzdANlURzPLqb+shn86iKJCqLKq4/Ylw7DrEaHs+7eYk0G 3lxILTfZmpISPvC//Rx6sn8k8ooCDvJrGiQKrFpfYLstqjd76liJhFZsL5eoHLRK+jaB7ziXR THNaPFP5yc/1BGtEwPBkv5GHx/69+E3dmj38YHg6Z7lYiPXh7HUY48AS8HBlHqcKBDAx4FeOs faXhROYed0O8tWYvL74CvwtDBhAnQjLPaluziVz9kiF1GoCsli90YziAMmUFPzjkQl4XqAjtK Vq1A9X2Jrx/XYWKGWXZAJjs+imL3750jAzmxQOWuWmpc6XLX+KSH9jM8SBVxCnf3SfDt1OB3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.3 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:112463 Archived-At: Arseny Sher writes: > 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 asked a similar question some time ago on emacs-dev. My impression was that nobody is actually really using this... The behavior doesn't make sense, so it is a bug. It should not be hard to fix for someone knowing the code. I stepped through the code with edebug, everything is there, just the file paths are treated in a way which is not correct in such cases. If there is no related bug report yet, maybe you can create one (I didn't)? Thanks, Michael.