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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 19, 2011, 16:31 UTC
Message-ID
<7vk4be9qqm.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8AKMQa2u6Y5qQHGujbjqq0qnM5D1+aEvcfk7POxQBqsVg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> touch a b; git commit -am1
> git clone ./. clone2
> GIT_DIR=clone2/.git git add clone2/b
The last one has _always_ meant:
    I am telling with GIT_DIR the directory that contains the repository
    metadata, which is at clone2/.git directory.  I am not saying where
    the working tree is (i.e. no GIT_WORK_TREE and no core.worktree in
    clone2/.git/config) so take my $(pwd) as the root of the working tree,
    and add the contents of clone2/b to the index at the same path,
    i.e. "clone2/b".

It should not add contents of the said file at "b", as there is _nothing_ on the command line that tells us "clone2" is the root of the working tree.

If the test means to do that, it should be more explicit and do something like:

	( cd clone2 && git add b )
instead.
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 2 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.