git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: diff --diff-filter on modified but locally deleted files

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2016, 18:34 UTC
Message-ID
<xmqq8tvv9rcd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAHd499D50TLMYtAovTF80ev0=2u=9yyMNcq6-he3Ba2kXzqW9g@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
Show 9 quoted lines
> My use case is that I do a merge from branch A to branch B. Branch A
> modified a file which is already deleted on B some time before the
> merge.
>
> When I do a `git status -sb`, these locally deleted but remotely
> modified files show up as "DU".
>
> I want to invoke git status or diff (or something else) to get a list
> of these specific conflicts (locally deleted, remotely modified).

As far as "git diff [--cached]" (which is "compare HEAD with the working tree through index") is concerned, these paths are in the "U"nmerged category, so you'd give "U" to diff-filter to view them. Of course, that would give you other kinds of unmerged entries.

If you know they show up as DU, why not "grep DU" in that output?
Previous: Robert DaileyNext: Robert Dailey
Message 2 of 3 in “diff --diff-filter on modified but locally deleted files”
  1. Robert DaileyAug 17, 2016
  2. Junio C HamanoAug 17, 2016
  3. Robert DaileyAug 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.