From: Michael Heerdegen <michael_heerdegen@web.de>
To: Arseny Sher <sher-ars@yandex.ru>
Cc: help-gnu-emacs@gnu.org
Subject: Re: epatch for multifile patches
Date: Wed, 08 Mar 2017 15:58:43 +0100 [thread overview]
Message-ID: <87d1drizmk.fsf@drachen> (raw)
In-Reply-To: <87fuinhoyi.fsf@yandex.ru> (Arseny Sher's message of "Wed, 08 Mar 2017 16:34:29 +0300")
Arseny Sher <sher-ars@yandex.ru> 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.
next prev parent reply other threads:[~2017-03-08 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 13:34 epatch for multifile patches Arseny Sher
2017-03-08 14:35 ` Arseny Sher
2017-03-08 14:58 ` Michael Heerdegen [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-03-08 11:57 Arseny Sher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1drizmk.fsf@drachen \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
--cc=sher-ars@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).