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

Re: [PATCH,RFC] Implement 'git rm --if-missing'

From
David Christensen <david@endpoint.com>
Date
Jul 16, 2008, 19:43 UTC
Message-ID
<D5EB71BB-FEA1-4900-AB72-914367B029AB@endpoint.com>
In-Reply-To
<20080716185811.GA3517@xp.machine.xx>
On Jul 16, 2008, at 1:58 PM, Peter Baumann wrote:
Show 34 quoted lines
> On Wed, Jul 16, 2008 at 11:48:42AM -0700, Junio C Hamano wrote:
>> Ciaran McCreesh <ciaran.mccreesh@googlemail.com> writes:
>>
>>> git rm --if-missing will only remove files if they've already been  
>>> removed from
>>> disk.
>>
>> This probably is a borderline with feaping creaturism.  What's the  
>> use of
>> it in a real workflow that you need this for?
>>
>> "git add -u" may be too broad in that it also adds anything  
>> modified, but
>> so is --if-missing too broad in that it removes anything removed,  
>> and if
>> you are going to limit by giving pathspecs _anyway_, then...
>>
>> Old timers might just do:
>>
>> 	git diff --name-only --diff-filter=D |
>>        git update-index --remove --stdin
>>
>> ;-)
>>
>
> Ah. This comes in handy. I already searched for a command to delete  
> all
> missing files. After reading through the fine manual of 'git rm', I  
> went
> to git update-index but didn't come up with a solution to my problem.
>
> But I have to say, an argument to 'git rm' would be preferable than  
> the
> above plumping.
Wouldn't:
git rm $(git ls-files --deleted)
do the trick, or am I missing something?
Regards,

David -- David Christensen End Point Corporation david@endpoint.com

Previous: Peter Baumann
Message 6 of 6 in “Implement 'git rm --if-missing'”
  1. Implement 'git rm --if-missing'Ciaran McCreesh, Jul 16, 2008
  2. Petr BaudisJul 16, 2008
  3. Avery PennarunJul 16, 2008
  4. Junio C HamanoJul 16, 2008
  5. Peter BaumannJul 16, 2008
  6. David ChristensenJul 16, 2008

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.