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, 18:44 UTC
Message-ID
<45843E95.2000101@midwinter.com>
In-Reply-To
<em1e1v$lse$1@sea.gmane.org>
Jakub Narebski wrote:
> Works if you use "git mv dir dir.real".
>   

This came up during my testing of snapshot backups. The *real* sequence is more like

$ git checkout -b new-snapshot $ rsync /live/directory . $ git add .

In other words, I don't know in advance that there's a rename or (short of turning on verbose rsync output and parsing it) which parts of the tree have changed at all. So I can't easily use git-mv here.

It still feels like a bug that "git add" can fail with no useful diagnostic. It actually took me a fair while to figure out what was going on here -- at first I thought it was having trouble with symlinks in general, then with absolute-path symlinks (which the actual symlink in question is), then I thought maybe it was a corrupt index. It wasn't until I went back and looked at the previous snapshot that I was overlaying this one on top of that I realized there used to be a directory where that symlink lives now.

Previous: Jakub NarebskiNext: A Large Angry SCM
Message 3 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.