[PATCH] D130863: [clangd] Make git ignore index directories

sums via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 06:25:28 PDT 2022

sums added a comment.

In D130863#3690275 <https://reviews.llvm.org/D130863#3690275>, @kadircet wrote:

> I am not sure if clangd is the right tool the create those `.gitignore` files, e.g. what if the project's VCS isn't git? I believe the right thing to do is for projects that want to make use of such tools to ignore the relevant directory explicitly (e.g. `.cache).

I believe clangd is the right tool, as the choice to use clangd or not is made by individual developers rather than project maintainers. Every git controlled C++ project would potentially have to include this directory to their gitignore.

I only thought of this after seeing how the meson build system behaves. A user can give any name to their build directory, so they add a gitignore to ignore it automatically. Users that don't want this behavior can simply remove the gitignore file, and it won't get recreated. The same behavior is present (and tested) with this change as well.

Lastly, this also has the benefit of only ignoring `.cache/clangd/index/*`, and it'll also stay up to date if the directory path/structure changes.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list