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

Re: git-add fails after file type change

From
Steven Grimm <koreth@midwinter.com>
Date
Dec 16, 2006, 22:40 UTC
Message-ID
<458475DF.6040809@midwinter.com>
In-Reply-To
<7vodq3cxl7.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Maybe "git add" should internally use ADD_CACHE_OK_TO_REPLACE
> (or error out and have an option to enable it)?
>   

That sounds right to me. Maybe there are cases where this isn't true, but -- especially given the recent move toward making "git add" the suggested porcelain command for updating the index -- I want "git add foo" to stick the current contents of "foo" into the index, regardless of what might have been there under that name previously. I'll grant that it's not a super-common use case to rename or delete a directory and put a file in its place, but it's IMO not an unreasonable thing to want git to track without undue hassle, given that it claims to support renames. I'm fine with having to supply an extra option to get that automatic behavior.

But barring that, the patch would at least have saved me a lot of head-scratching.

-Steve
Previous: Junio C HamanoNext: Steven Grimm
Message 6 of 11 in “git-add fails after file type change”
  1. Steven GrimmDec 16, 2006
  2. Jakub NarebskiDec 16, 2006
  3. Steven GrimmDec 16, 2006
  4. A Large Angry SCMDec 16, 2006
  5. Junio C HamanoDec 16, 2006
  6. Steven GrimmDec 16, 2006
  7. Steven GrimmDec 17, 2006
  8. Junio C HamanoDec 17, 2006
  9. Junio C HamanoDec 17, 2006
  10. git-add: remove conflicting entry when adding.Junio C Hamano, Dec 17, 2006
  11. Junio C HamanoDec 16, 2006

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.