Stream: t-compiler

Topic: git-untracked-files


Dale Wijnand (Feb 20 2019 at 10:38, on Zulip):

Hey. Am I doing something wrong? After making a change and running ./x.py check git status shows:

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    src/llvm/
    src/tools/clang/
    src/tools/lld/
    src/tools/lldb/

Additionally there's src/libcompiler_builtins.

The effect is that when I add all changed files and commit, via git add -A, I have to go back and git rm --cached these directories. Is there some part of local setup that I have to do?

pnkfelix (Feb 20 2019 at 10:50, on Zulip):

I don't think you are doing anything wrong

pnkfelix (Feb 20 2019 at 10:50, on Zulip):

well

pnkfelix (Feb 20 2019 at 10:50, on Zulip):

it depends on how one defines "wrong"

pnkfelix (Feb 20 2019 at 10:50, on Zulip):

my suspicion is that you manually tried to grab the submodules

pnkfelix (Feb 20 2019 at 10:51, on Zulip):

either now or at some point in the past

pnkfelix (Feb 20 2019 at 10:51, on Zulip):

at least, I have seen effects like this on my repository

pnkfelix (Feb 20 2019 at 10:51, on Zulip):

and my best guess is that its because our bootstrapping system isn't quite perfect in its handling of submodules.

nagisa (Feb 20 2019 at 11:25, on Zulip):

Alternatively, if your checkout is old, or you ever did anything to the submodules in an older commit, movement of these submodules may leave old "untracked" directories around.

nikomatsakis (Feb 20 2019 at 11:50, on Zulip):

I have that problem all the time -- due to what @nagisa said -- I usually just delete the old directories, @Dale Wijnand

davidtwco (Feb 20 2019 at 11:51, on Zulip):

Yeah, I've found that when a submodule moves or is removed upstream (ie. src/llvm -> src/llvm-project) then the directory shows up as untracked and I can just delete it.

Dale Wijnand (Feb 20 2019 at 12:33, on Zulip):

Ah I see now the changes in .gitmodules for both the LLVM move and the removal of libcompiler_builtins..

Perhaps (in future) such submodule removes should come with gitignore additions. By being tracked in the repo it helps everyone going forward but also for time-travellers they won't have their personal, global gitignore making things opaque.

Thank you.

Jake Goulding (Feb 20 2019 at 16:49, on Zulip):

such submodule removes should come with gitignore additions

I'd be anti this. I don't need hidden, unused gigabytes of LLVM directories lying around.

Dale Wijnand (Feb 20 2019 at 17:32, on Zulip):

Ah, yes. Ironically that's why I didn't touch those directories because I was afraid of throwing away those precious bytes that would've made me 5-minute change another hour-long rebuild of LLVM.

Dale Wijnand (Feb 20 2019 at 17:33, on Zulip):

Having and not having a subdmodule is referenced in https://git-scm.com/book/en/v2/Git-Tools-Submodules#_issues_with_submodules :slight_smile:

Last update: Nov 16 2019 at 01:05UTC