Hey. Am I doing something wrong? After making a change and running
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/
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?
I don't think you are doing anything wrong
it depends on how one defines "wrong"
my suspicion is that you manually tried to grab the submodules
either now or at some point in the past
at least, I have seen effects like this on my repository
and my best guess is that its because our bootstrapping system isn't quite perfect in its handling of submodules.
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.
I have that problem all the time -- due to what @nagisa said -- I usually just delete the old directories, @Dale Wijnand
Yeah, I've found that when a submodule moves or is removed upstream (ie.
src/llvm-project) then the directory shows up as untracked and I can just delete it.
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.
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.
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.
Having and not having a subdmodule is referenced in https://git-scm.com/book/en/v2/Git-Tools-Submodules#_issues_with_submodules :slight_smile: