{"thread":{"id":"9371","subject":"bug in t3700-add.sh?","startedAt":"2007-08-03T20:51:37Z","lastAt":"2007-08-03T21:29:43Z","messageCount":3,"participants":["Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"49628","messageId":"fcaeb9bf0708031351g5e585a4bj849fbf2ec3720a18@mail.gmail.com","threadId":"9371","inReplyTo":null,"subject":"bug in t3700-add.sh?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2007-08-03T20:51:37Z","receivedAt":"2007-08-03T20:51:37Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nRunning test 17, I got this output:\n\n* expecting success:\n        git rm --cached -f file symlink &&\n        (\n                echo \"100644 $(git hash-object -w stage1) 1     file\"\n                echo \"100755 $(git hash-object -w stage2) 2     file\"\n                echo \"100644 $(printf $s | git hash-object -w -t blob\n--stdin) 1        symlink\"\n                echo \"120000 $(printf $s | git hash-object -w -t blob\n--stdin) 2        symlink\"\n        ) | git update-index --index-info &&\n        git config core.filemode 0 &&\n        git config core.symlinks 0 &&\n        echo new > file &&\n        echo new > symlink &&\n        git add file symlink &&\n        git ls-files --stage | grep \"^100755 .* 0       file$\" &&\n        git ls-files --stage | grep \"^120000 .* 0       symlink$\"\n\nrm 'file'\nrm 'symlink'\nprintf: usage: printf [-v var] format [arguments]\nprintf: usage: printf [-v var] format [arguments]\n100755 3e757656cf36eca53338e520d134963a44f793f8 0       file\n120000 3e757656cf36eca53338e520d134963a44f793f8 0       symlink\n*   ok 17: git add with filemode=0, symlinks=0 prefers stage 2 over stage 1\n\nI don't know if \"printf $s\" was intentional because $s was empty and\ncaused printf to print out help usage. I have feeling that there is\nsomething wrong here. Anyone can clarify?\n\nJohannes Sixt CC'd as he added this code.\n-- \nDuy\n"},{"id":"49632","messageId":"7vabt8mhse.fsf@assigned-by-dhcp.cox.net","threadId":"9371","inReplyTo":"fcaeb9bf0708031351g5e585a4bj849fbf2ec3720a18@mail.gmail.com","subject":"Re: bug in t3700-add.sh?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-03T21:26:09Z","receivedAt":"2007-08-03T21:26:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Nguyen Thai Ngoc Duy\" <pclouds@gmail.com> writes:\n\n> Running test 17, I got this output:\n\nGaah.  Those $s seem completely bogus.\n\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex b52fde8..a27c593 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -131,8 +131,8 @@ test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over st\n \t(\n \t\techo \"100644 $(git hash-object -w stage1) 1\tfile\"\n \t\techo \"100755 $(git hash-object -w stage2) 2\tfile\"\n-\t\techo \"100644 $(printf $s | git hash-object -w -t blob --stdin) 1\tsymlink\"\n-\t\techo \"120000 $(printf $s | git hash-object -w -t blob --stdin) 2\tsymlink\"\n+\t\techo \"100644 $(echo 1 | git hash-object -w -t blob --stdin) 1\tsymlink\"\n+\t\techo \"120000 $(echo 2 | git hash-object -w -t blob --stdin) 2\tsymlink\"\n \t) | git update-index --index-info &&\n \tgit config core.filemode 0 &&\n \tgit config core.symlinks 0 &&\n"},{"id":"49633","messageId":"7v643wmhmg.fsf@assigned-by-dhcp.cox.net","threadId":"9371","inReplyTo":"fcaeb9bf0708031351g5e585a4bj849fbf2ec3720a18@mail.gmail.com","subject":"Re: bug in t3700-add.sh?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-03T21:29:43Z","receivedAt":"2007-08-03T21:29:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Nguyen Thai Ngoc Duy\" <pclouds@gmail.com> writes:\n\n> Running test 17, I got this output:\n\nGaah.  Those $s seem completely bogus.\n\nThis test only cares to see if the blob type is retained (it\ndoes \"git add\" to the path later to throw away the unmergedness\nand data at higher stage prepared by this step), so it really\ndoes not matter what is fed to hash-object.  But it should be\nhashing a file whose contents is '1' and a symlink to '2'.\n\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex b52fde8..213e924 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -131,8 +131,8 @@ test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over st\n \t(\n \t\techo \"100644 $(git hash-object -w stage1) 1\tfile\"\n \t\techo \"100755 $(git hash-object -w stage2) 2\tfile\"\n-\t\techo \"100644 $(printf $s | git hash-object -w -t blob --stdin) 1\tsymlink\"\n-\t\techo \"120000 $(printf $s | git hash-object -w -t blob --stdin) 2\tsymlink\"\n+\t\techo \"100644 $(printf 1 | git hash-object -w -t blob --stdin) 1\tsymlink\"\n+\t\techo \"120000 $(printf 2 | git hash-object -w -t blob --stdin) 2\tsymlink\"\n \t) | git update-index --index-info &&\n \tgit config core.filemode 0 &&\n \tgit config core.symlinks 0 &&\n"}]}