From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Arseny Sher Newsgroups: gmane.emacs.bugs Subject: bug#26028: 26.0.50; epatch for multifile patches Date: Wed, 08 Mar 2017 20:29:52 +0300 Message-ID: <87varjfzhr.fsf@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488994465 16249 195.159.176.226 (8 Mar 2017 17:34:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 17:34:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 26028@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 18:34:19 2017 Return-path: Envelope-to: geb-bug-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 1clfTV-00032P-Qf for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 18:34:10 +0100 Original-Received: from localhost ([::1]:57605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clfTb-0001Ls-OG for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Mar 2017 12:34:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clfTS-0001It-OB for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:34:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clfTO-0000it-4W for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:34:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clfTO-0000ip-17 for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1clfTN-0006za-SA for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Arseny Sher Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2017 17:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26028 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148899439126699 (code B ref -1); Wed, 08 Mar 2017 17:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Mar 2017 17:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:46565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clfSY-0006wX-VH for submit@debbugs.gnu.org; Wed, 08 Mar 2017 12:33:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clfPd-0006qH-TM for submit@debbugs.gnu.org; Wed, 08 Mar 2017 12:30:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clfPW-0007q5-TR for submit@debbugs.gnu.org; Wed, 08 Mar 2017 12:30:04 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clfPW-0007q1-QU for submit@debbugs.gnu.org; Wed, 08 Mar 2017 12:30:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clfPU-0000Ov-Mx for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:30:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clfPR-0007pB-EF for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:30:00 -0500 Original-Received: from forward13h.cmail.yandex.net ([87.250.230.155]:51185) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1clfPQ-0007o2-Sh for bug-gnu-emacs@gnu.org; Wed, 08 Mar 2017 12:29:57 -0500 Original-Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [IPv6:2a02:6b8:0:f05::116]) by forward13h.cmail.yandex.net (Yandex) with ESMTP id 624022209A for ; Wed, 8 Mar 2017 20:29:54 +0300 (MSK) Original-Received: from smtp2h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id 4D7427819F6 for ; Wed, 8 Mar 2017 20:29:53 +0300 (MSK) Original-Received: by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OZKz1EonFv-TrRaV1qC; Wed, 08 Mar 2017 20:29:53 +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=1488994193; bh=mvl2ZIDJYANlEWdddQp+HuyR9OzlJvMML2usxqe7tY4=; h=From:To:Subject:Date:Message-ID; b=ZsprDKVIBLJ9ymtHgLVMi2K3+G2Ji6Kuu3oUVilkloH53sMCnUCHlnWqDOmxU+i4y OHag0jMqBvWnXtkC/wlxR4f87ZbZ52v2YMpJzOcLGS0gDcg2yNY68/kkzzzJMaWtNc FNcRyXTrc4w3/gyoSej2Vry06SH6CtN+6/1zTj6M= Authentication-Results: smtp2h.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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 08 Mar 2017 12:33:10 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130345 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." If I understand this correctly, my scenario should work, so it seems like a bug. I tried it on GNU Emacs versions 25.1, 25.2 RC2 and daily build 26.0.50.2, sometimes on clean Emacs (emacs -q), and sometimes with unified diff format (diff -u), the result is the same. I use GNU/Linux, Linux Mint 17 (based on Ubuntu 14.04). Below goes autogenerated info from report-emacs-bug. In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-10-26 built on lgw01-50 Windowing system distributor 'The X.Org Foundation', version 11.0.11501000 System Description: Linux Mint 17 Qiana Recent messages: my-misc loaded Loading /home/ars/.emacs.d/recentf...done Cleaning up the recentf list...done (0 removed) my-text-processing loaded Loading font-lock...done my-windows-frames-funcs loaded coding styles loaded my-gdb-stuff loaded Loading quail/cyrillic...done For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --build=x86_64-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib --program-suffix=-snapshot --with-modules=yes --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' CPPFLAGS=-D_FORTIFY_SOURCE=2 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS Important settings: value of $LC_ALL: en_US.UTF-8 value of $LC_MONETARY: ru_RU.UTF-8 value of $LC_NUMERIC: ru_RU.UTF-8 value of $LC_TIME: ru_RU.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: gud-tooltip-mode: t diff-hl-flydiff-mode: t global-diff-hl-mode: t diff-auto-refine-mode: t global-flycheck-mode: t projectile-mode: t ivy-mode: t show-paren-mode: t my-global-fci-mode: t global-linum-mode: t dired-omit-mode: t delete-selection-mode: t cua-mode: t recentf-mode: t savehist-mode: t global-undo-tree-mode: t global-auto-revert-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: ~/.emacs.d/static_packages/all-the-icons.el/all-the-icons hides ~/.emacs.d/static_packages/all-the-icons /usr/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/26.0.50/lisp/textmodes/ispell /usr/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/26.0.50/lisp/textmodes/flyspell /usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/26.0.50/lisp/language/thai-word Features: (shadow sort mail-extr emacsbug message puny format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils colir color ggtags etags xref project windmove quail gud my-gdb-stuff diff-hl-flydiff diff-hl edmacro kmacro face-remap vc-hg vc-git vc-dir ewoc vc vc-dispatcher diff-mode flycheck json map find-func rx subr-x coding-styles cc-styles cc-align cc-engine cc-vars cc-defs projectile advice grep compile comint ansi-color ibuf-ext ibuffer ibuffer-loaddefs ivy ivy-overlay ffap thingatpt xcscope ring paren disp-table fill-column-indicator easy-mmode linum dired-x dired dired-loaddefs my-windows-frames-funcs all-the-icons all-the-icons-faces data-weathericons data-octicons data-fileicons data-faicons data-alltheicons font-lock+ cl dash my-text-processing drag-stuff delsel cua-base recentf tree-widget wid-edit savehist undo-tree diff autorevert filenotify wombat-theme my-misc finder-inf tex-site info package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 288745 21478) (symbols 48 35267 1) (miscs 40 517 1228) (strings 32 74748 9913) (string-bytes 1 2122820) (vectors 16 35442) (vector-slots 8 683178 9673) (floats 8 665 276) (intervals 56 444 300) (buffers 976 13) (heap 1024 41802 1607))