My team is using some non-llvm projects along with llvm-project monorepo. The projects are checked out to the top level of llvm-project, and ‘git status’ would complain about them unless we add them to .gitignore. We do not really want to change llorg’s .gitignore on our side, so may we propose changing llorg’s .gitignore to ignore all top-level files/directories that are not explicitly listed? Something along the lines:
/*
!/clang
!/clang-tools-extra
!/compiler-rt
…
This will require updating .gitignore every time a new top-level entry is added into llvm-project monorepo, which should not be a big deal. Please let me know if I can proceed with a review request.
My team is using some non-llvm projects along with llvm-project monorepo. The projects are checked out to the top level of llvm-project, and ‘git status’ would complain about them unless we add them to .gitignore. We do not really want to change llorg’s .gitignore on our side, so may we propose changing llorg’s .gitignore to ignore all top-level files/directories that are not explicitly listed? Something along the lines:
/*
!/clang
!/clang-tools-extra
!/compiler-rt
…
This will require updating .gitignore every time a new top-level entry is added into llvm-project monorepo, which should not be a big deal. Please let me know if I can proceed with a review request.
These seems like a good concept to me, but I'm not a git expert,
so I'm unsure of what potential problems (if any) this might cause.
I proposed this before in https://reviews.llvm.org/D57400. At the time there was some opposition to the proposal so I didn’t pursue it further, but I still think it would be very useful to do something like that so that I don’t have to continue to maintain my own exclude file.
I proposed this before in https://reviews.llvm.org/D57400. At the time there was some opposition to the proposal so I didn’t pursue it further, but I still think it would be very useful to do something like that so that I don’t have to continue to maintain my own exclude file.
Peter
Hello,
My team is using some non-llvm projects along with llvm-project monorepo. The projects are checked out to the top level of llvm-project, and ‘git status’ would complain about them unless we add them to .gitignore. We do not really want to change llorg’s .gitignore on our side, so may we propose changing llorg’s .gitignore to ignore all top-level files/directories that are not explicitly listed? Something along the lines:
/*
!/clang
!/clang-tools-extra
!/compiler-rt
…
This will require updating .gitignore every time a new top-level entry is added into llvm-project monorepo, which should not be a big deal. Please let me know if I can proceed with a review request.
Hi,
This might work reasonably well for the upstream llvm-project. However, do you have any thoughts about how downstream llvm-project monorepos that have other top-level directories in a their fork of llvm-project would handle this situation? Would all of them have to add a downstream .gitignore rule for their new top-level directory? That doesn’t seem ideal to me.
I would not want to see this. We have directories added to the top
level in our local fork of the monorepo and to have them suddenly
ignored by git would be surprising. Yes, we could whitelist what we've
added but we would not recognize the problem until we tried to commit a
change from those directories, which happens infrequently. I can
imagine it would take some time to realize what is going on.
-David
"Zakharin, Vyacheslav P via llvm-dev" <llvm-dev@lists.llvm.org> writes:
My team is using some non-llvm projects along with llvm-project monorepo. The projects are checked out to the top level of llvm-project, and ‘git status’ would complain about them unless we add them to .gitignore. We do not really want to change llorg’s .gitignore on our side,
Why not? If you’re using a modified llvm-project fork, what’s the harm of also modifying .gitignore?
so may we propose changing llorg’s .gitignore to ignore all top-level files/directories that are not explicitly listed? Something along the lines:
/*
!/clang
!/clang-tools-extra
!/compiler-rt
…
This will require updating .gitignore every time a new top-level entry is added into llvm-project monorepo, which should not be a big deal. Please let me know if I can proceed with a review request.
Slava, if you have added files/directories under llvm-project/ then you no longer have an unmodified llvm-project. You have added something to it, and it is appropriate to modify .gitignore to allow for that. If that is the only file you have to modify, then you have the second-cheapest possible downstream situation. (The only way to make it cheaper is if all your downstream additions are siblings of llvm-project/ rather than children.)
Our workspace creator just checks out the other projects into the top-level structure of llvm-project, but llvm-project and the other projects are still from different repos. We could have taught the workspace creator to modify .git/info/exclude for each workspace, but as you said, it is error-prone.
OK, it looks like .gitignore is not going to change, so we will have to figure out some local solution.