git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] apply: handle Subversion diffs with /dev/null gracefully

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2018, 18:01 UTC
Message-ID
<xmqqsha29lnt.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<7858c01a2c92a55f86611335bbdcc93c94bc69d2.1518654532.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 5 quoted lines
>  	} else {
> -		if (!starts_with(line, "/dev/null\n"))
> +		if (!is_dev_null(line))
>  			return error(_("git apply: bad git-diff - expected /dev/null on line %d"), state->linenr);
>  	}

Yup. This seems to be the last explicit/manual check with the string "/dev/null" (instead of using is_dev_null(), which is how it should be and already is done in codepaths that guesses -p value and decides if it is a creation or a deletion patch).

Looks good.  Will queue.
Show 13 quoted lines
> diff --git a/t/t4135-apply-weird-filenames.sh b/t/t4135-apply-weird-filenames.sh
> index b14b8085786..c7c688fcc4b 100755
> --- a/t/t4135-apply-weird-filenames.sh
> +++ b/t/t4135-apply-weird-filenames.sh
> @@ -100,7 +100,7 @@ deleted file mode 100644
>  -
>  EOF
>  
> -test_expect_failure 'apply handles a diff generated by Subversion' '
> +test_expect_success 'apply handles a diff generated by Subversion' '
>  	>Makefile &&
>  	git apply -p2 diff-from-svn &&
>  	test_path_is_missing Makefile
Previous: Johannes Schindelin
Message 4 of 4 in “Teach `git apply` to accept Subversion-generated diffs”
  1. 0/2 Teach `git apply` to accept Subversion-generated diffsJohannes Schindelin, Feb 15, 2018
  2. 1/2 apply: demonstrate a problem applying svn diffsJohannes Schindelin, Feb 15, 2018
  3. 2/2 apply: handle Subversion diffs with /dev/null gracefullyJohannes Schindelin, Feb 15, 2018
  4. Junio C HamanoFeb 15, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.