Add .cache and compile_commands.json to .gitignote

Hi All, I use clangd. Clangd creates a .cache directory, and there are also tools for generating a compile_commands.json file which tells clangd how to behave. I did a quick check, and there are no naming collisions with other files in the cpython project. What does everyone think? Can we add these two items to the .gitignore: - `.cache` - `compile_commands.json` -- Thanks! Jack DeVries

Jack DeVries writes:
I don't see any cost to this -- .cache is uncomfortably generic, but given the semantics of "cache" gitignoring it seems a good idea. ISTM rather than have every project add these to the project-specific gitignore this is really something every clang user should have in their personal gitignore for best effect. As long as they don't though, having the project do it will avoid inadvertantly git-adding these objects. Steve

I already do have it in my personal gitignore (.git/info/exclude) which works fine. I just thought there might be a lot of people using clangd, and I thought it might be handy to put it in for everyone. I'm just interested in hearing what others think; thank you for your response Steven On Fri, Aug 20, 2021, 1:48 AM Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:

On Fri, 20 Aug 2021 at 15:50, Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
The important thing there is "inadvertantly". .gitignore is only for untracked files - if something in an ignored directory needs to be in the repo then it can be added. Whilst I'd say it's a really good idea to have your build system artifacts in your personal gitignore, IMO any files and directories generated by any supported build systems should be in the repo's .gitignore so those less experienced with git don't mess up. Tim Delaney

Jack DeVries writes:
I don't see any cost to this -- .cache is uncomfortably generic, but given the semantics of "cache" gitignoring it seems a good idea. ISTM rather than have every project add these to the project-specific gitignore this is really something every clang user should have in their personal gitignore for best effect. As long as they don't though, having the project do it will avoid inadvertantly git-adding these objects. Steve

I already do have it in my personal gitignore (.git/info/exclude) which works fine. I just thought there might be a lot of people using clangd, and I thought it might be handy to put it in for everyone. I'm just interested in hearing what others think; thank you for your response Steven On Fri, Aug 20, 2021, 1:48 AM Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:

On Fri, 20 Aug 2021 at 15:50, Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
The important thing there is "inadvertantly". .gitignore is only for untracked files - if something in an ignored directory needs to be in the repo then it can be added. Whilst I'd say it's a really good idea to have your build system artifacts in your personal gitignore, IMO any files and directories generated by any supported build systems should be in the repo's .gitignore so those less experienced with git don't mess up. Tim Delaney
participants (3)
-
Jack DeVries
-
Stephen J. Turnbull
-
Tim Delaney