.gitignore: ignore compile_commands.json globally
Andrii Nakryiko
maintainerPATCH 1/1 .gitignore: ignore compile_commands.json globally
compile_commands.json can be used with clangd to enable language server protocol-based assistance. For kernel itself this can be built with scripts/gen_compile_commands.py, but other projects (e.g., libbpf, or BPF selftests) can benefit from their own compilation database file, which can be generated successfully using external tools, like bear [0].
So, instead of adding compile_commands.json to .gitignore in respective individual projects, let's just ignore it globally anywhere in Linux repo.
[0] https://github.com/rizsotto/Bear
--- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
.gitignore +1 -1
@@ -175,7 +175,7 @@ x509.genkey *.kdev4 # Clang's compilation database file -/compile_commands.json +compile_commands.json # Documentation toolchain sphinx_*/
Signature · 1 line
2.47.1
Quoted 6 lines · Andrii Nakryiko
compile_commands.json can be used with clangd to enable language server protocol-based assistance. For kernel itself this can be built with
scripts/gen_compile_commands.py, but other projects (e.g., libbpf, or BPF selftests) can benefit from their own compilation database file, which can be generated successfully using external tools, like bear [0].
Quoted 7 lines
So, instead of adding compile_commands.json to .gitignore in respective individual projects, let's just ignore it globally anywhere in Linux repo.
[0] https://github.com/rizsotto/Bear
Suggested-by Eduard Zingerman <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>
Sure, I cannot imagine anyone actually wanting to check these in, regardless of where they exists.
Quoted 20 lines
--- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).gitignore +1
-1@@ -175,7 +175,7 @@ x509.genkey *.kdev4 # Clang's compilation database file -/compile_commands.json +compile_commands.json # Documentation toolchain sphinx_*/Signature · 1 line
2.47.1
.gitignore x509.genkey · line 178
Quoted 4 lines · Andrii Nakryiko
# Clang's compilation database file
.gitignore +1
-1-/compile_commands.json +compile_commands.json
Should it be removed from tools/power/cpupower/.gitignore then?
Thanks!
Cheers,
Miguel
Quoted 8 lines · Miguel Ojeda
.gitignore x509.genkey · line 178
Quoted 4 lines · Andrii Nakryiko
# Clang's compilation database file
.gitignore +1
-1-/compile_commands.json +compile_commands.jsonShould it be removed from
tools/power/cpupower/.gitignorethen?
yep, can do that in the same patch
Quoted 5 lines
Thanks!
Cheers,
Miguel