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

git ls-files should not show worktree files as untracked

From
乙酸鋰 <ch3cooli@gmail.com>
Date
Oct 21, 2015, 04:58 UTC
Message-ID
<CAHtLG6SDrk9Kw2edTVhY2M_8-O09_=VbZhsJYeQXY7No660VDw@mail.gmail.com>

Hi, Using git 2.6.2 I think worktree should behave consistently like submodule

Run following commands ``` echo 1 > 1.txt git init git add 1.txt git commit -m "initial commit" echo 2 > 2.txt # untracked file mkdir def cd def git clone --separate-git-dir ../.git/ghi .. . # simulate an untracked submodule cd .. git worktree add abc

git ls-files --exclude-standard --full-name --others ```

Actual: list all the files of abc
2.txt
abc/1.txt
def/
Expected: just the directory of abc
2.txt
abc/
def/
Hint: path.c: git_path_submodule() should read "commondir" ?
Message 1 of 1 in “git ls-files should not show worktree files as untracked”
  1. 乙酸鋰Oct 21, 2015

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.