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

t5403.1 and adding a file that belongs to a submodule

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jul 19, 2011, 13:57 UTC
Message-ID
<CACsJy8AKMQa2u6Y5qQHGujbjqq0qnM5D1+aEvcfk7POxQBqsVg@mail.gmail.com>
A part of t5403.1 is like this

touch a b; git commit -am1 git clone ./. clone2 GIT_DIR=clone2/.git git add clone2/b

The last command troubles me because clone2/.git is valid, I don't think it should add "clone2/b" to clone2/.git/index. This is likely due to common prefix optimization in read_directory, where it skips checking .git at the first level (clone2). If we turn that command to "git add a clone2/b" (common prefix would be ""), the second argument is silently dropped (seems like a bug to me). Should t5403.1 be rewritten to avoid that construct?

-- 
Duy
Next: Junio C Hamano
Message 1 of 4 in “t5403.1 and adding a file that belongs to a submodule”
  1. Nguyen Thai Ngoc DuyJul 19, 2011
  2. Junio C HamanoJul 19, 2011
  3. Nguyen Thai Ngoc DuyJul 20, 2011
  4. Junio C HamanoJul 20, 2011

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.