All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Sixt <j6t@kdbg.org>,
	git@vger.kernel.org, Greg Brockman <gdb@mit.edu>,
	Ilari Liusvaara <ilari.liusvaara@elisanet.fi>,
	Elijah Newren <newren@gmail.com>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: [PATCH v2 0/3] apply: handle traditional patches with space in filename
Date: Wed, 18 Aug 2010 20:45:16 -0500	[thread overview]
Message-ID: <20100819014516.GA7175@burratino> (raw)
In-Reply-To: <201008142037.50833.j6t@kdbg.org>

Johannes Sixt wrote:

> Why not just write an explicit test vector? The result of expand will be 
> constant, no?

Sorry for the long delay.  Here's a re-roll, meant to replace
jn/apply-filename-with-sp from pu.

Patch 1 fixes an edge case for git apply -p when traditional patches
have quotation marks in file names (so: an edge case of an edge).
But that is only a side-effect; the main purpose is to rearrange
code to prepare for patch 3.  Except for the commit message, it is
unchanged from the version in pu.

Patch 2 contains the funny-filenames tests.  Testing on Windows would
be welcome.  The test vectors are included in the patch to avoid a
source of non-determinism (for example, GNU diff could stop emiting
traditional patches some day).  The script used to generate them is
provided to make the test easy to change.

Patch 3 is basically as before, except that find_name_traditional()
calls find_name_common() directly now instead of redundantly checking
again for quotes at the beginning of filenames.  As before, the
purpose is to handle patches to files with whitespace in their
names, by trying to use the timestamp instead of arbitrary whitespace
as a name terminator (falling back to the old method if that fails).

Thanks for your help so far.  The code would be much worse without it.

Jonathan Nieder (3):
  apply: split quoted filename handling into new function
  tests: exercise "git apply" with weird filenames
  apply: handle traditional patches with space in filename

 builtin/apply.c                  |  251 ++++++++++++++++++++++++++++++++------
 t/t4120-apply-popt.sh            |   35 +++++-
 t/t4135-apply-weird-filenames.sh |   75 +++++++++++
 t/t4135/.gitignore               |    3 +
 t/t4135/add-plain.diff           |    5 +
 t/t4135/add-with backslash.diff  |    5 +
 t/t4135/add-with quote.diff      |    5 +
 t/t4135/add-with spaces.diff     |    5 +
 t/t4135/add-with tab.diff        |    5 +
 t/t4135/damaged.diff             |    5 +
 t/t4135/diff-plain.diff          |    5 +
 t/t4135/diff-with backslash.diff |    5 +
 t/t4135/diff-with quote.diff     |    5 +
 t/t4135/diff-with spaces.diff    |    5 +
 t/t4135/diff-with tab.diff       |    5 +
 t/t4135/git-plain.diff           |    7 +
 t/t4135/git-with backslash.diff  |    7 +
 t/t4135/git-with quote.diff      |    7 +
 t/t4135/git-with spaces.diff     |    7 +
 t/t4135/git-with tab.diff        |    7 +
 t/t4135/make-patches             |   45 +++++++
 21 files changed, 457 insertions(+), 42 deletions(-)
 create mode 100755 t/t4135-apply-weird-filenames.sh
 create mode 100644 t/t4135/.gitignore
 create mode 100644 t/t4135/add-plain.diff
 create mode 100644 t/t4135/add-with backslash.diff
 create mode 100644 t/t4135/add-with quote.diff
 create mode 100644 t/t4135/add-with spaces.diff
 create mode 100644 t/t4135/add-with tab.diff
 create mode 100644 t/t4135/damaged.diff
 create mode 100644 t/t4135/diff-plain.diff
 create mode 100644 t/t4135/diff-with backslash.diff
 create mode 100644 t/t4135/diff-with quote.diff
 create mode 100644 t/t4135/diff-with spaces.diff
 create mode 100644 t/t4135/diff-with tab.diff
 create mode 100644 t/t4135/git-plain.diff
 create mode 100644 t/t4135/git-with backslash.diff
 create mode 100644 t/t4135/git-with quote.diff
 create mode 100644 t/t4135/git-with spaces.diff
 create mode 100644 t/t4135/git-with tab.diff
 create mode 100755 t/t4135/make-patches

-- 
1.7.2.1.544.ga752d.dirty

  parent reply	other threads:[~2010-08-19  1:47 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11 23:35 What's cooking in git.git (Aug 2010, #02; Wed, 11) Junio C Hamano
2010-08-12  1:41 ` Jonathan Nieder
2010-08-12  2:33   ` Ævar Arnfjörð Bjarmason
2010-08-12  3:15     ` jn/commit-no-change-wo-status (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11)) Jonathan Nieder
2010-08-12  5:47 ` What's cooking in git.git (Aug 2010, #02; Wed, 11) Elijah Newren
2010-08-12 15:49   ` Junio C Hamano
2010-08-12 21:12     ` Elijah Newren
2010-08-12  9:23 ` Johannes Sixt
2010-08-12  9:37   ` Greg Brockman
2010-08-12 10:11     ` Ævar Arnfjörð Bjarmason
2010-08-12 22:08     ` Junio C Hamano
2010-08-12 22:13       ` Greg Brockman
2010-08-12 22:19       ` Junio C Hamano
2010-08-12 10:20   ` Ævar Arnfjörð Bjarmason
2010-08-12 11:35     ` Erik Faye-Lund
2010-08-12 16:50       ` Ævar Arnfjörð Bjarmason
2010-08-12 17:34         ` Chris Packham
2010-08-12 18:35           ` Ævar Arnfjörð Bjarmason
2010-08-12 22:19             ` windows smoke tester (was Re: What's cooking in git.git (Aug 2010, #02; Wed, 11)) Chris Packham
2010-08-12 22:29               ` Ævar Arnfjörð Bjarmason
2010-08-12 22:58                 ` Chris Packham
2010-08-13  1:01                   ` Ævar Arnfjörð Bjarmason
2010-08-14  0:42                     ` Chris Packham
2010-08-14  0:46                       ` Ævar Arnfjörð Bjarmason
2010-08-15  0:54                       ` Tay Ray Chuan
2010-08-15  1:08                         ` Ævar Arnfjörð Bjarmason
2010-08-15 17:39                           ` Tay Ray Chuan
2010-08-12 10:21   ` What's cooking in git.git (Aug 2010, #02; Wed, 11) Ilari Liusvaara
2010-08-12 10:31     ` Johannes Sixt
2010-08-12 15:25       ` Ilari Liusvaara
2010-08-12 12:43   ` Elijah Newren
2010-08-12 22:21     ` Junio C Hamano
2010-08-12 21:58   ` Junio C Hamano
2010-08-12 22:40   ` jn/apply-filename-with-sp (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11)) Jonathan Nieder
2010-08-12 22:46     ` Ævar Arnfjörð Bjarmason
2010-08-12 23:17     ` Junio C Hamano
2010-08-13  0:59       ` Ævar Arnfjörð Bjarmason
2010-08-13 21:44     ` Johannes Sixt
2010-08-14  2:27       ` Jonathan Nieder
2010-08-14 18:37         ` Johannes Sixt
2010-08-15  0:05           ` Jonathan Nieder
2010-08-19  1:45           ` Jonathan Nieder [this message]
2010-08-19  1:46             ` [PATCH 1/3] apply: split quoted filename handling into new function Jonathan Nieder
2010-08-19  1:48             ` [PATCH 2/3] tests: exercise "git apply" with weird filenames Jonathan Nieder
2010-08-19  1:50             ` [PATCH 3/3] apply: handle traditional patches with space in filename Jonathan Nieder
2010-08-19 19:56             ` [PATCH v2 0/3] " Johannes Sixt
2010-08-20  6:26               ` Jonathan Nieder
2010-08-13  0:08   ` jn/svn-fe Jonathan Nieder
2010-08-13 10:18     ` jn/svn-fe Jakub Narebski
2010-08-13 21:33     ` jn/svn-fe Johannes Sixt
2010-08-13 23:47       ` [PATCH v2 jn/svn-fe 0/5] vcs-svn: Port to Windows Jonathan Nieder
2010-08-13 23:59         ` [PATCH 1/5] compat: add strtok_r() Jonathan Nieder
2010-08-14  0:01         ` [PATCH 2/5] vcs-svn: Rename dirent pool to build on Windows Jonathan Nieder
2010-08-14  0:03         ` [PATCH 3/5] vcs-svn: Avoid %z in format string Jonathan Nieder
2010-08-14  0:04         ` [PATCH 4/5] t9010 (svn-fe): use Unix-style path in URI Jonathan Nieder
2010-08-14  0:06         ` [PATCH 5/5] t9010 (svn-fe): avoid symlinks in test Jonathan Nieder

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100819014516.GA7175@burratino \
    --to=jrnieder@gmail.com \
    --cc=gdb@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ilari.liusvaara@elisanet.fi \
    --cc=j6t@kdbg.org \
    --cc=newren@gmail.com \
    --cc=schwab@linux-m68k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.