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

[WARNING] Please be careful when using "git add" from "next" branch

From
Junio C Hamano <junkio@cox.net>
Date
May 18, 2006, 08:52 UTC
Message-ID
<7vsln74sv7.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vwtcj4tp6.fsf@assigned-by-dhcp.cox.net>

There is still a small breakage in the built-in "git add" on the "next" branch that ends up creating nonsense tree objects.

        $ mkdir foo
        $ date >bar
        $ git-add foo/../bar
        $ git ls-files
        foo/../bar
        $ git ls-tree -r -t $(git-write-tree)
        040000 tree ef5562cd3a9bf66d41a8d4f42f159e8c694ce7e3	foo
        040000 tree 6e1612248e8da43fc5f91592e559da1ad5f9a852	foo/..
        100644 blob 53ab446c3f4e42ce9bb728a0ccb283a101be4979	foo/../bar

If you do not do funky things like foo/../bar, I do not think you have to worry, but scripted use might break. It used to warn and ignore such bogus input, but now it happily accepts it and produces bogus index which results in bogus trees.

"git update-index --add" is not affected by this breakage.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 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.