{"thread":{"id":"6862","subject":"test suite failures because cmp behaves oddly","startedAt":"2007-02-17T21:25:12Z","lastAt":"2007-02-17T23:16:08Z","messageCount":3,"participants":["Johannes Sixt","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34894","messageId":"200702172225.12758.johannes.sixt@telecom.at","threadId":"6862","inReplyTo":null,"subject":"test suite failures because cmp behaves oddly","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-02-17T21:25:12Z","receivedAt":"2007-02-17T21:25:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Does anyone know how 'cmp' can signal success when its output is redirected \nto /dev/null, even if the compared files are different?\n\n$ cmp M.sum actual7.sum; echo $?\nM.sum actual7.sum differ: char 20, line 2\n1\n$ cmp M.sum actual7.sum > /dev/null; echo $?\n0\n$ bash --version\nGNU bash, version 3.1.17(1)-release (i586-suse-linux)\n$ cmp --version\ncmp (GNU diffutils) 2.8.7\n[...]\n\nDue to this behavior I see reproducible failures in the test suite, unless the \ntests are run in --verbose mode:\n\n$ make GIT_TEST_OPTS=-i t1002-read-tree-m-u-2way.sh\n*** t1002-read-tree-m-u-2way.sh ***\n*   ok 1: setup\n*   ok 2: 1, 2, 3 - no carry forward\n*   ok 3: 4 - carry forward local addition.\n*   ok 4: 5 - carry forward local addition.\n*   ok 5: 6 - local addition already has the same.\n* FAIL 6: 7 - local addition already has the same.\n        rm -f .git/index nitfol bozbar rezrov frotz &&\n             git-read-tree --reset -u $treeH &&\n             echo frotz >frotz &&\n             git-update-index --add frotz &&\n             echo frotz frotz >frotz &&\n             git-read-tree -m -u $treeH $treeM &&\n             git-ls-files --stage >7.out &&\n             diff -U0 M.out 7.out &&\n             check_cache_at frotz dirty &&\n             sum bozbar frotz nitfol >actual7.sum &&\n             if cmp M.sum actual7.sum; then false; else :; fi &&\n             : dirty index should have prevented -u from checking it out. &&\n             echo frotz frotz >frotz1 &&\n             diff frotz frotz1 &&\n             rm -f frotz1\nmake: *** [t1002-read-tree-m-u-2way.sh] Error 1\n\n\nHas anyone seen something like this?\n\n-- Hannes\n"},{"id":"34898","messageId":"7v3b54s7y3.fsf@assigned-by-dhcp.cox.net","threadId":"6862","inReplyTo":"200702172225.12758.johannes.sixt@telecom.at","subject":"Re: test suite failures because cmp behaves oddly","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-17T23:03:32Z","receivedAt":"2007-02-17T23:03:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <johannes.sixt@telecom.at> writes:\n\n> Does anyone know how 'cmp' can signal success when its output is redirected \n> to /dev/null, even if the compared files are different?\n>\n> $ cmp M.sum actual7.sum; echo $?\n> M.sum actual7.sum differ: char 20, line 2\n> 1\n> $ cmp M.sum actual7.sum > /dev/null; echo $?\n> 0\n> ...\n> Has anyone seen something like this?\n\nI vaguely recall this reported long time ago from one of the\nregulars on the list, but googling or gmane search came up\nempty.\n"},{"id":"34900","messageId":"Pine.LNX.4.63.0702180015470.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6862","inReplyTo":"7v3b54s7y3.fsf@assigned-by-dhcp.cox.net","subject":"Re: test suite failures because cmp behaves oddly","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-17T23:16:08Z","receivedAt":"2007-02-17T23:16:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 17 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Sixt <johannes.sixt@telecom.at> writes:\n> \n> > Does anyone know how 'cmp' can signal success when its output is redirected \n> > to /dev/null, even if the compared files are different?\n> >\n> > $ cmp M.sum actual7.sum; echo $?\n> > M.sum actual7.sum differ: char 20, line 2\n> > 1\n> > $ cmp M.sum actual7.sum > /dev/null; echo $?\n> > 0\n> > ...\n> > Has anyone seen something like this?\n> \n> I vaguely recall this reported long time ago from one of the\n> regulars on the list, but googling or gmane search came up\n> empty.\n\nWas me. AFAIR it was fixed in CVS.\n\nCiao,\nDscho\n"}]}