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

Re: [PATCH 3/3] t5403: do not use access repos with GIT_DIR when worktree is involved

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 13, 2011, 04:54 UTC
Message-ID
<CACsJy8BS=z+5bALvMEAr567O2jT3ytSz9rWmvDSiRHL0Ub69wg@mail.gmail.com>
In-Reply-To
<7vwrc95xe5.fsf@alter.siamese.dyndns.org>
2011/10/13 Junio C Hamano <gitster@pobox.com>:
Show 14 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> Setting GIT_DIR alone means worktree is current directory for legacy
>> reasons. Avoid using that, instead go to the worktree and execute
>> commands there.
>>
>> The troublesome command is "GIT_DIR=clone2/.git git add clone2/b". The
>> real worktree is clone2, but that command tells git worktree is $(pwd).
>> What does user expect to add then? Should the new entry in index be "b"
>> or "clone2/b"?
>
> There is no troublesomeness here, as the semantics has been clearly
> defined and (hopefully) stayed constant before the days when GIT_WORK_TREE
> was invented.

It's not wrong per se. The trouble comes from the people who reads the test. It's not clear the author wants to add "b" or "clone2/b".

Another thing, because "clone2" has .git inside, should "clone2" in this case be considered a submodule and "git add" refuse to add anything "clone2/*" but "clone2" itself?

> Unless we are trying to break them without knowing, and declare that we
> deprecated it after the fact, which is not exactly the way we want to
> remove existing (mis)feature.

I had problems with my read_directory() rewrite but it's been some time since I touched the code. I don't remember what went wrong. Need to have another look.

-- 
Duy
Previous: Junio C HamanoNext: Johannes Sixt
Message 5 of 7 in “t5403.1: simplify commit creation”
  1. 1/3 t5403.1: simplify commit creationNguyễn Thái Ngọc Duy, Oct 12, 2011
  2. 2/3 t5403: convert leading spaces to tabsNguyễn Thái Ngọc Duy, Oct 12, 2011
  3. 3/3 t5403: do not use access repos with GIT_DIR when worktree is involvedNguyễn Thái Ngọc Duy, Oct 12, 2011
  4. Junio C HamanoOct 13, 2011
  5. Nguyen Thai Ngoc DuyOct 13, 2011
  6. Johannes SixtOct 12, 2011
  7. Nguyen Thai Ngoc DuyOct 13, 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.