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

git reveals a bug in (some versions) BSD diff

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 12, 2005, 12:32 UTC
Message-ID
<Pine.LNX.4.63.0508121424500.24891@wgmdd8.biozentrum.uni-wuerzburg.de>
Hi,

big was my surprise when my daily routine of "git pull" && "make test" failed. "git bisect" revealed that commit 8e832e: "String comparison of test is done with '=', not '=='." was the culprit.

But it isn't. The version of diff present on my iBook (OS 10.2.8) does not work properly in this case:

	(echo a; echo b | tr -d '\012') >frotz.2
	(echo a; echo c; echo b | tr -d '\012') >frotz.3
	diff -u frotz.2 frotz.3
yields
	--- a1  2005-08-12 14:24:19.000000000 +0200
	+++ a2  2005-08-12 14:24:27.000000000 +0200
	@@ -1,2 +1,3 @@
	 a
	+c
	 b

Note the missing "\ No newline at end of file". The same happens on sourceforge's compile farm's OS 10.1 server, but not on its OS 10.2 server.

How to go about that? Silently ignore the missing line in apply.c? Force users to update their diff to a sane version?

Ciao, Dscho

Next: Junio C Hamano
Message 1 of 4 in “git reveals a bug in (some versions) BSD diff”
  1. Johannes SchindelinAug 12, 2005
  2. Junio C HamanoAug 12, 2005
  3. Johannes SchindelinAug 12, 2005
  4. Junio C HamanoAug 12, 2005

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.