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

Re: Do "git add" as a builtin

From
Linus Torvalds <torvalds@osdl.org>
Date
May 18, 2006, 16:35 UTC
Message-ID
<Pine.LNX.4.64.0605180929450.10823@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0605180917060.10823@g5.osdl.org>
On Thu, 18 May 2006, Linus Torvalds wrote:
Show 5 quoted lines
> > 
> > But if people are ok with changing it from a "print a warning and ignore" 
> > into an _error_, we could just move it into "add_cache_entry()".
> 
> This is the incremental patch to do that instead, if you prefer it.
Thinking some more about it, I think I personally much prefer this.

Especially as a quick look-through seems to say that there's actually a path through git-update-index too that allows a unverified filename to get into the index (the new "--unresolve" thing also misses the need to verify the path).

Making it a fatal error makes it more obvious that the user did something fundamentally wrong. And the safety in doing it in add_cache_entry() just makes be happier, particularly in light of the above problem with --unresolve.

That still leaves the question of whether we should also drop all the "verify_path()" calls in update-index.c, and make it fatal there too. I think we probably should.

(At that point we could turn verify_path() back into a static function, this time local entirely to read-cache.c, rather than update-index.c)

			Linus
Previous: Linus TorvaldsNext: Junio C Hamano
Message 10 of 13 in “Do "git add" as a builtin”
  1. Linus TorvaldsMay 17, 2006
  2. Junio C HamanoMay 17, 2006
  3. Linus TorvaldsMay 17, 2006
  4. Junio C HamanoMay 18, 2006
  5. Junio C HamanoMay 18, 2006
  6. [WARNING] Please be careful when using "git add" from "next" branchJunio C Hamano, May 18, 2006
  7. FIXED: [WARNING] Please be careful when using "git add" from "next" branchJunio C Hamano, May 19, 2006
  8. Linus TorvaldsMay 18, 2006
  9. Linus TorvaldsMay 18, 2006
  10. Linus TorvaldsMay 18, 2006
  11. Junio C HamanoMay 18, 2006
  12. Linus TorvaldsMay 18, 2006
  13. Linus TorvaldsMay 18, 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.