{"thread":{"id":"27013","subject":"Bug report: git status does not report unmerged entries with copies","startedAt":"2011-04-07T00:34:26Z","lastAt":"2011-04-07T23:36:09Z","messageCount":3,"participants":["Mark Lodato","Martin von Zweigbergk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"165324","messageId":"BANLkTikWVgsX6yEY=d7kEcO5PLMTRwDU_A@mail.gmail.com","threadId":"27013","inReplyTo":null,"subject":"Bug report: git status does not report unmerged entries with copies","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2011-04-07T00:34:26Z","receivedAt":"2011-04-07T00:34:26Z","isPatch":false,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"Commit 4d4d572, \"status: show worktree status of conflicted paths\nseparately\" introduced the following bug:  If one tries to merge two\nbranches with a conflict, where the conflicting file was also copied\nin one of the branches, \"git status\" (but not \"git status -sb\" or\ngit-gui) fails to report the unmerged status.  You can use the below\ntest file to see the error.  A similar test should probably be\nintegrated into one of the existing git-status test files, though you\nmay need to get rid of the \"sed -i\" command.\n\n$ git status\n# On branch master\n# Changes to be committed:\n#\n#       renamed:    file -> copy\n#\n$ git status -sb\n## master\nR  file -> copy\n U file\n\nIn the above, \"git status\" should have reported \"file\" being in an\nunmerged state.  It probably should also mark \"copy\" as a copy, not a\nrename.\n\n-------- 8< --------\n#!/bin/sh\n#\n# Copyright (c) 2011 Mark Lodato\n#\n\ntest_description='git status on merge with copy'\n\n. ./test-lib.sh\n\ntest_expect_success 'setup' '\n        echo first > file &&\n        echo second >> file &&\n        echo third >> file &&\n        echo fourth >> file &&\n        git add file &&\n        git commit -m initial &&\n        git checkout -b branch &&\n        cp file copy &&\n        git add copy &&\n        git commit -m copy &&\n        sed -i -e \"s/second/fifth/\" file &&\n        git add file &&\n        git commit -m fifth &&\n        git checkout master &&\n        sed -i -e \"s/second/sixth/\" file &&\n        git add file &&\n        git commit -m sixth\n'\n\ntest_expect_success 'merge' '\n        ! git merge branch\n'\n\ntest_expect_success 'status' '\n        git status | grep unmerged\n'\n\ntest_done\n"},{"id":"165356","messageId":"alpine.DEB.2.00.1104070948310.25447@debian","threadId":"27013","inReplyTo":"BANLkTikWVgsX6yEY=d7kEcO5PLMTRwDU_A@mail.gmail.com","subject":"Re: Bug report: git status does not report unmerged entries with copies","fromName":"Martin von Zweigbergk","fromEmail":"martin.von.zweigbergk@gmail.com","sentAt":"2011-04-07T13:53:48Z","receivedAt":"2011-04-07T13:53:48Z","isPatch":false,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"\nOn Wed, 6 Apr 2011, Mark Lodato wrote:\n\n> Commit 4d4d572, \"status: show worktree status of conflicted paths\n> separately\" introduced the following bug:  If one tries to merge two\n> branches with a conflict, where the conflicting file was also copied\n> in one of the branches, \"git status\" (but not \"git status -sb\" or\n> git-gui) fails to report the unmerged status.  You can use the below\n> test file to see the error.  A similar test should probably be\n> integrated into one of the existing git-status test files, though you\n> may need to get rid of the \"sed -i\" command.\n> \n> $ git status\n> # On branch master\n> # Changes to be committed:\n> #\n> #       renamed:    file -> copy\n> #\n> $ git status -sb\n> ## master\n> R  file -> copy\n>  U file\n> \n> In the above, \"git status\" should have reported \"file\" being in an\n> unmerged state.  It probably should also mark \"copy\" as a copy, not a\n> rename.\n\nI sent a patch for this not so long ago [1]. It is currently in \"next\"\nas commit d7c9bf2. I think Junio said the plan is to release it in\n1.7.5.\n\n\n/Martin\n\n [1] http://thread.gmane.org/gmane.comp.version-control.git/169289/focus=169887\n"},{"id":"165391","messageId":"BANLkTim6Bn6WQrYCrfmw+B_by-PiSuu-9Q@mail.gmail.com","threadId":"27013","inReplyTo":"alpine.DEB.2.00.1104070948310.25447@debian","subject":"Re: Bug report: git status does not report unmerged entries with copies","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2011-04-07T23:36:09Z","receivedAt":"2011-04-07T23:36:09Z","isPatch":false,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"On Thu, Apr 7, 2011 at 9:53 AM, Martin von Zweigbergk\n<martin.von.zweigbergk@gmail.com> wrote:\n>\n> On Wed, 6 Apr 2011, Mark Lodato wrote:\n>\n>> Commit 4d4d572, \"status: show worktree status of conflicted paths\n>> separately\" introduced the following bug:  If one tries to merge two\n>> branches with a conflict, where the conflicting file was also copied\n>> in one of the branches, \"git status\" (but not \"git status -sb\" or\n>> git-gui) fails to report the unmerged status.\n>\n> I sent a patch for this not so long ago [1]. It is currently in \"next\"\n> as commit d7c9bf2. I think Junio said the plan is to release it in\n> 1.7.5.\n>\n>  [1] http://thread.gmane.org/gmane.comp.version-control.git/169289/focus=169887\n\nAh yes, sorry.  Your commit does fix the problem.  My test script\nreports a failure, but it is only because my grep command was\ninsufficient to properly test.  (At the very least, I should have\ncheck case insensitively.)\n"}]}