{"thread":{"id":"1481","subject":"git reveals a bug in (some versions) BSD diff","startedAt":"2005-08-12T12:32:54Z","lastAt":"2005-08-12T16:30:42Z","messageCount":4,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7116","messageId":"Pine.LNX.4.63.0508121424500.24891@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1481","inReplyTo":null,"subject":"git reveals a bug in (some versions) BSD diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-08-12T12:32:54Z","receivedAt":"2005-08-12T12:32:54Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nbig was my surprise when my daily routine of \"git pull\" && \"make test\" \nfailed. \"git bisect\" revealed that commit 8e832e: \"String comparison of \ntest is done with '=', not '=='.\" was the culprit.\n\nBut it isn't. The version of diff present on my iBook (OS 10.2.8) does not \nwork properly in this case:\n\n\t(echo a; echo b | tr -d '\\012') >frotz.2\n\t(echo a; echo c; echo b | tr -d '\\012') >frotz.3\n\tdiff -u frotz.2 frotz.3\n\nyields\n\n\t--- a1  2005-08-12 14:24:19.000000000 +0200\n\t+++ a2  2005-08-12 14:24:27.000000000 +0200\n\t@@ -1,2 +1,3 @@\n\t a\n\t+c\n\t b\n\nNote the missing \"\\ No newline at end of file\". The same happens on \nsourceforge's compile farm's OS 10.1 server, but not on its OS 10.2 \nserver.\n\nHow to go about that? Silently ignore the missing line in apply.c? Force \nusers to update their diff to a sane version?\n\nCiao,\nDscho\n"},{"id":"7123","messageId":"7vd5ojxiny.fsf@assigned-by-dhcp.cox.net","threadId":"1481","inReplyTo":"Pine.LNX.4.63.0508121424500.24891@wgmdd8.biozentrum.uni-wuerzburg.de","subject":"Re: git reveals a bug in (some versions) BSD diff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-12T15:46:09Z","receivedAt":"2005-08-12T15:46:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Note the missing \"\\ No newline at end of file\". The same happens on \n> sourceforge's compile farm's OS 10.1 server, but not on its OS 10.2 \n> server.\n>\n> How to go about that? Silently ignore the missing line in apply.c? Force \n> users to update their diff to a sane version?\n\nHmph.  We could tackle this two ways.  We probably _could_\nspecial case the trailing newline case if this problem is\nwidespread, but a more general solution would be to teach\ngit-apply '--fuzz'.  On the other hand, we could configure to\nuse gdiff (or whatever GNU diff is called on those hosts with\nbroken diff command) at the build time.  Probably it would be\nthe bast to have an explicit option --fuzz to git-apply.\n"},{"id":"7126","messageId":"Pine.LNX.4.63.0508121801310.26333@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1481","inReplyTo":"7vd5ojxiny.fsf@assigned-by-dhcp.cox.net","subject":"Re: git reveals a bug in (some versions) BSD diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-08-12T16:04:19Z","receivedAt":"2005-08-12T16:04:19Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 12 Aug 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Note the missing \"\\ No newline at end of file\". The same happens on \n> > sourceforge's compile farm's OS 10.1 server, but not on its OS 10.2 \n> > server.\n> >\n> > How to go about that? Silently ignore the missing line in apply.c? Force \n> > users to update their diff to a sane version?\n> \n> Hmph.  We could tackle this two ways.  We probably _could_\n> special case the trailing newline case if this problem is\n> widespread, but a more general solution would be to teach\n> git-apply '--fuzz'.  On the other hand, we could configure to\n> use gdiff (or whatever GNU diff is called on those hosts with\n> broken diff command) at the build time.  Probably it would be\n> the bast to have an explicit option --fuzz to git-apply.\n\nI'd prefer to deprecate that diff program by telling so in the test. \nSomething along the lines \"blabla. If this fails, chances are you have a \nborked diff. Try GNU diff...\"\n\nCiao,\nDscho\n\nBTW: On my system, gdiff does not exist.\n"},{"id":"7131","messageId":"7vk6irw219.fsf@assigned-by-dhcp.cox.net","threadId":"1481","inReplyTo":"Pine.LNX.4.63.0508121801310.26333@wgmdd8.biozentrum.uni-wuerzburg.de","subject":"Re: git reveals a bug in (some versions) BSD diff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-12T16:30:42Z","receivedAt":"2005-08-12T16:30:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I'd prefer to deprecate that diff program by telling so in the test. \n> Something along the lines \"blabla. If this fails, chances are you have a \n> borked diff. Try GNU diff...\"\n\nWouldn't it give the people with broken diff a false impression\nthat their \"git diff\" actually produces a good result when it\ndoes not?\n"}]}