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

Re: [RFC] Removing deleted files after checkout

From
Junio C Hamano <junkio@cox.net>
Date
Aug 23, 2005, 21:54 UTC
Message-ID
<7vvf1wnwtl.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0508231713450.23242@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
>> > If you don't use -f, git-checkout-script removes deleted files. Using -f
>> > tells it to ignore the old index, which means that it can't tell the
>> > difference between removed files and files that weren't tracked at all.

Yes and no. "git checkout" assumes that the index file and the working tree somewhat resembles what is in .git/HEAD commit. Since push operation updates .git/HEAD commit without touching the index file, that assumption does not hold.

The update hook gets old commit name and new commit name, so you should be able to do (untested):

    git-read-tree -m -u $old_commit $new_commit

there, of course after making sure that you had old_commit (the first time push happens to a new ref you would not have that one).

Previous: Daniel BarkalowNext: Carl Baldwin
Message 7 of 10 in “[RFC] Removing deleted files after checkout”
  1. Carl BaldwinAug 23, 2005
  2. Daniel BarkalowAug 23, 2005
  3. Carl BaldwinAug 23, 2005
  4. Daniel BarkalowAug 23, 2005
  5. Carl BaldwinAug 23, 2005
  6. Daniel BarkalowAug 23, 2005
  7. Junio C HamanoAug 23, 2005
  8. Carl BaldwinAug 23, 2005
  9. Daniel BarkalowAug 23, 2005
  10. Junio C HamanoAug 24, 2005

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.