Bug #63697 [Opn->Csd]: 'Download diff as a patch' doesn't consider trailing spaces changes

From: Date: Wed, 26 Dec 2012 20:42:22 +0000
Subject: Bug #63697 [Opn->Csd]: 'Download diff as a patch' doesn't consider trailing spaces changes
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9322@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63697&edit=1 ID: 63697 Updated by: yannick@php.net Reported by: shein@php.net Summary: 'Download diff as a patch' doesn't consider trailing spaces changes -Status: Open +Status: Closed Type: Bug Package: Online Doc Editor problem Operating System: Ubuntu 12.10 64-bit PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of yannick.torres@gmail.com Revision: http://git.php.net/?p=web/doc-editor.git;a=commit;h=14709162d86939d9d28bf26063daf5fff1d8f1cf Log: Fix bug #63697 ; Patch provided by shein@php.net. Thanks ;) Previous Comments: ------------------------------------------------------------------------ [2012-12-25 14:07:35] shein@php.net Comment to exec-to-passthru patch: I've changed implementation of SaferExec::execMulti from exec() to ob_start() + passthru(), since exec() trims trailing spaces as noted in http://php.net/manual/en/function.exec.php. ------------------------------------------------------------------------ [2012-12-25 14:05:45] shein@php.net The following patch has been added/updated: Patch Name: exec-to-passthru Revision: 1356444345 URL: https://bugs.php.net/patch-display.php?bug=63697&patch=exec-to-passthru&revision=1356444345 ------------------------------------------------------------------------ [2012-12-05 12:17:35] shein@php.net Description: ------------ The tool generates incorrect patches when patch contains lines that diff only in trailing spaces, for example, in this patch: https://edit.php.net/index.php? patch=ru/features/cookies.xml&project=PHP original line "когда включена директива <link linkend="ini.track-vars">track_vars</link>." should contain trailing space, while patched line doesn't. As you can see in the patch lines are identical - this makes patch(1) reject these hunks. In Expected/Actual result sections I enabled "End-of-line" mode, so it's easier to spot trailing spaces. Expected result: ---------------- conf@conf ~/Downloads $ cat -E patch-1354692276.patch --- ru/features/cookies.xml$ +++ ru/features/cookies.xml$ @@ -1,6 +1,6 @@$ <?xml version="1.0" encoding="utf-8"?>$ <!-- EN-Revision: 297028 Maintainer: shein Status: ready -->$ -<!-- Reviewed: no -->$ +<!-- Reviewed: yes Maintainer: Alex Cooper -->$ <!-- $Revision: 325754 $ -->$ <chapter xml:id="features.cookies" xmlns="http://docbook.org/ns/docbook">$ <title>Cookies</title>$ @@ -35,7 +35,7 @@$ эту возможность, так как она обычно отключена в целях безопасности.$ В более ранних версиях также определяется массив$ <varname>$HTTP_COOKIE_VARS</varname>, но только$ - когда включена директива <link linkend="ini.track-vars">track_vars</link>. $ + когда включена директива <link linkend="ini.track-vars">track_vars</link>.$ (Эта директива всегда включена начиная с версии PHP 4.0.3.)$ </para>$ Actual result: -------------- conf@conf ~/Downloads $ cat -E patch-1354692276.patch --- ru/features/cookies.xml$ +++ ru/features/cookies.xml$ @@ -1,6 +1,6 @@$ <?xml version="1.0" encoding="utf-8"?>$ <!-- EN-Revision: 297028 Maintainer: shein Status: ready -->$ -<!-- Reviewed: no -->$ +<!-- Reviewed: yes Maintainer: Alex Cooper -->$ <!-- $Revision: 325754 $ -->$ <chapter xml:id="features.cookies" xmlns="http://docbook.org/ns/docbook">$ <title>Cookies</title>$ @@ -35,7 +35,7 @@$ эту возможность, так как она обычно отключена в целях безопасности.$ В более ранних версиях также определяется массив$ <varname>$HTTP_COOKIE_VARS</varname>, но только$ - когда включена директива <link linkend="ini.track-vars">track_vars</link>.$ + когда включена директива <link linkend="ini.track-vars">track_vars</link>.$ (Эта директива всегда включена начиная с версии PHP 4.0.3.)$ </para>$ ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63697&edit=1

« previous php.doc.bugs (#9322) next »