{"thread":{"id":"43869","subject":"diff --diff-filter on modified but locally deleted files","startedAt":"2016-08-17T18:28:01Z","lastAt":"2016-08-17T18:47:31Z","messageCount":3,"participants":["Robert Dailey","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"299562","messageId":"CAHd499D50TLMYtAovTF80ev0=2u=9yyMNcq6-he3Ba2kXzqW9g@mail.gmail.com","threadId":"43869","inReplyTo":null,"subject":"diff --diff-filter on modified but locally deleted files","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-08-17T18:04:07Z","receivedAt":"2016-08-17T18:28:01Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"My use case is that I do a merge from branch A to branch B. Branch A\nmodified a file which is already deleted on B some time before the\nmerge.\n\nWhen I do a `git status -sb`, these locally deleted but remotely\nmodified files show up as \"DU\".\n\nI want to invoke git status or diff (or something else) to get a list\nof these specific conflicts (locally deleted, remotely modified). I\ntried this:\n\n$ git diff --diff-filter=D --name-status\n\nThis gave me no results. I also tried adding --cached, didn't make a\ndifference. If I just do this:\n\n$ git diff --name-status\n\nThis lists those files as just U instead of DU. So I'm not sure where\nthe \"D\" is coming from in this case.\n\nIs there a way I can get a list of these specific conflicts? I'd like\nto rely on working/index status for this if possible, since as I\nresolve these conflicts I want the list to shorten and only show\nunresolved conflicts of this type. Which rules out a diff range\nbetween B...A that I could do.\n"},{"id":"299564","messageId":"xmqq8tvv9rcd.fsf@gitster.mtv.corp.google.com","threadId":"43869","inReplyTo":"CAHd499D50TLMYtAovTF80ev0=2u=9yyMNcq6-he3Ba2kXzqW9g@mail.gmail.com","subject":"Re: diff --diff-filter on modified but locally deleted files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-17T18:34:58Z","receivedAt":"2016-08-17T18:35:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Dailey <rcdailey.lists@gmail.com> writes:\n\n> My use case is that I do a merge from branch A to branch B. Branch A\n> modified a file which is already deleted on B some time before the\n> merge.\n>\n> When I do a `git status -sb`, these locally deleted but remotely\n> modified files show up as \"DU\".\n>\n> I want to invoke git status or diff (or something else) to get a list\n> of these specific conflicts (locally deleted, remotely modified).\n\nAs far as \"git diff [--cached]\" (which is \"compare HEAD with the\nworking tree through index\") is concerned, these paths are in the\n\"U\"nmerged category, so you'd give \"U\" to diff-filter to view them.\nOf course, that would give you other kinds of unmerged entries.\n\nIf you know they show up as DU, why not \"grep DU\" in that output?\n"},{"id":"299566","messageId":"CAHd499AP9VnQ8cVioc5aPQ7qUPdV=i70o58OW1Sh6uYOMf1W7Q@mail.gmail.com","threadId":"43869","inReplyTo":"xmqq8tvv9rcd.fsf@gitster.mtv.corp.google.com","subject":"Re: diff --diff-filter on modified but locally deleted files","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-08-17T18:47:23Z","receivedAt":"2016-08-17T18:47:31Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"On Wed, Aug 17, 2016 at 1:34 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Robert Dailey <rcdailey.lists@gmail.com> writes:\n>\n>> My use case is that I do a merge from branch A to branch B. Branch A\n>> modified a file which is already deleted on B some time before the\n>> merge.\n>>\n>> When I do a `git status -sb`, these locally deleted but remotely\n>> modified files show up as \"DU\".\n>>\n>> I want to invoke git status or diff (or something else) to get a list\n>> of these specific conflicts (locally deleted, remotely modified).\n>\n> As far as \"git diff [--cached]\" (which is \"compare HEAD with the\n> working tree through index\") is concerned, these paths are in the\n> \"U\"nmerged category, so you'd give \"U\" to diff-filter to view them.\n> Of course, that would give you other kinds of unmerged entries.\n>\n> If you know they show up as DU, why not \"grep DU\" in that output?\n\nI'm happy to do that and in fact considered it, but since\n--diff-filter exists, I figured it might solve the problem. I also\nneed a better understanding of how diff-filter works since it\ntechnically has 2 sides during a merge conflict. I guess it functions\nonly on the right (local) side.\n\nThanks Junio.\n"}]}