{"thread":{"id":"8806","subject":"[PATCH] Test that git add removes stages 1,2,3.","startedAt":"2007-07-02T11:18:06Z","lastAt":"2007-07-02T11:47:32Z","messageCount":4,"participants":["Johannes Sixt","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46226","messageId":"11833750863127-git-send-email-johannes.sixt@telecom.at","threadId":"8806","inReplyTo":null,"subject":"[PATCH] Test that git add removes stages 1,2,3.","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-07-02T11:18:06Z","receivedAt":"2007-07-02T11:18:06Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\ngit add seems to have a bug, where it doesn't remove stages 1,2,3\nif a stage 0 entry is already in the index.\n\nHere is a test (on top of maint) for the kind soul who wants to fix\nthis border case.  Feel free to merge this patch into your patch\nthat provides the fix.\n\n-- Hannes\n\n t/t3700-add.sh |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ad8cc7d..d7dd6ca 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -110,4 +110,16 @@ test_expect_success 'check correct prefix detection' '\n \tgit add 1/2/a 1/3/b 1/2/c\n '\n \n+test_expect_success 'git add removes unmerged entries' '\n+\tgit rm --cached -f file &&\n+\tfor s in 0 1 2 3\n+\tdo\n+\t\techo \"100644 0123456789012345678901234567890123456789 $s\tfile\"\n+\tdone | git update-index --index-info &&\n+\techo new > file &&\n+\tgit add file &&\n+\tgit ls-files --stage | grep \"^100644 .* 0\tfile$\" &&\n+\t! git ls-files --stage | grep \"^100644 .* [^0]\tfile$\"\n+'\n+\n test_done\n-- \n1.5.2.2.555.g24e57\n"},{"id":"46227","messageId":"1183375431711-git-send-email-johannes.sixt@telecom.at","threadId":"8806","inReplyTo":"11833750863127-git-send-email-johannes.sixt@telecom.at","subject":"[PATCH/amend] Test that git add removes stages 1,2,3.","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-07-02T11:23:51Z","receivedAt":"2007-07-02T11:23:51Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n\nHMPF!\n\nThe test in the original post failed for the wrong reason. :-/\n\n-- Hannes\n\n\n t/t3700-add.sh |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex ad8cc7d..06fc2bf 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -110,4 +110,16 @@ test_expect_success 'check correct prefix detection' '\n \tgit add 1/2/a 1/3/b 1/2/c\n '\n \n+test_expect_success 'git add removes unmerged entries' '\n+\tgit rm --cached -f file || : ignore failure &&\n+\tfor s in 0 1 2 3\n+\tdo\n+\t\techo \"100644 0123456789012345678901234567890123456789 $s\tfile\"\n+\tdone | git update-index --index-info &&\n+\techo new > file &&\n+\tgit add file &&\n+\tgit ls-files --stage | grep \"^100644 .* 0\tfile$\" &&\n+\t! git ls-files --stage | grep \"^100644 .* [^0]\tfile$\"\n+'\n+\n test_done\n-- \n1.5.2.2.555.g24e57\n"},{"id":"46229","messageId":"Pine.LNX.4.64.0707021232510.4438@racer.site","threadId":"8806","inReplyTo":"11833750863127-git-send-email-johannes.sixt@telecom.at","subject":"Re: [PATCH] Test that git add removes stages 1,2,3.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-02T11:34:44Z","receivedAt":"2007-07-02T11:34:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 2 Jul 2007, Johannes Sixt wrote:\n\n> git add seems to have a bug, where it doesn't remove stages 1,2,3\n> if a stage 0 entry is already in the index.\n\nBut how does that happen? I do not know any way to use porcelain to \nachieve that bogus state.\n\nAFAIK stages 1,2,3 are only populated when there are conflicts, in which \ncase there is no stage 0. Literally the only way I see to have both is to \n_make_ update-index put them in there.\n\nPilot error?\n\nCiao,\nDscho\n"},{"id":"46231","messageId":"4688E5D4.6BA7EB7F@eudaptics.com","threadId":"8806","inReplyTo":"Pine.LNX.4.64.0707021232510.4438@racer.site","subject":"Re: [PATCH] Test that git add removes stages 1,2,3.","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-07-02T11:47:32Z","receivedAt":"2007-07-02T11:47:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin wrote:\n> On Mon, 2 Jul 2007, Johannes Sixt wrote:\n> \n> > git add seems to have a bug, where it doesn't remove stages 1,2,3\n> > if a stage 0 entry is already in the index.\n> \n> But how does that happen? I do not know any way to use porcelain to\n> achieve that bogus state.\n\nI'm aware of that; so I said \"border case\" in the original post.\n\n> Pilot error?\n\nOh, yes :) It noticed this when I was tweaking the test for git add with\nsymlinks=false that I posted.\n\n-- Hannes\n"}]}