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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 12:53:16 PDT 2022

sammccall added a comment.

My 2c, though I'm away with kids right now so will leave to @kadircet to make a call

Given that this is fully contained (logically and physically) within clangd's index directory, this seems elegant and harmless to me.

(At first i thought it was modifying project-level .gitignores, which would be scary).

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?

The wrong-tool/slippery-slope argument is legitimate. I'd be pretty comfortable personally drawing the line at "git and nothing else" though.

> 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).

It would be great if there were some general "transient" name patterns that were implicitly ignored. Sadly not the case AFAIK

Comment at: clang-tools-extra/clangd/test/background-index.test:23
+# RUN: ls %/t/.cache/clangd/index/.gitignore
+# RUN: ls %/t/sub_dir/.cache/clangd/index/.gitignore
Bleh, ideally this would go in clangd/.gitignore but we'd have to break a bunch of abstractions to do that. I think this is fine.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list