diff mbox series

[v2] .gitignore: ignore compile_commands.json globally

Message ID 20250606214840.3165754-1-andrii@kernel.org
State New
Headers show
Series [v2] .gitignore: ignore compile_commands.json globally | expand

Commit Message

Andrii Nakryiko June 6, 2025, 9:48 p.m. UTC
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.

While at it, remove exactly such a local .gitignore rule under
tools/power/cpupower.

  [0] https://github.com/rizsotto/Bear

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
v1->v2:
  - clean up tools/power/cpupower's .gitignore (Miguel Ojeda).

 .gitignore                      | 2 +-
 tools/power/cpupower/.gitignore | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Andrii Nakryiko June 12, 2025, 8:28 p.m. UTC | #1
On Sat, Jun 7, 2025 at 2:27 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Fri, Jun 6, 2025 at 11:48 PM Andrii Nakryiko <andrii@kernel.org> wrote:
> >
> > 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.
> >
> > While at it, remove exactly such a local .gitignore rule under
> > tools/power/cpupower.
> >
> >   [0] https://github.com/rizsotto/Bear
> >
> > Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> > Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
> > Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
>
> Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
>

Masahiro,

Would you be able to pick this up? Or where should we route this
through, in your opinion? Thanks!

> Thanks!
>
> Cheers,
> Miguel
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index bf5ee6e01cd4..451dff66275d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -175,7 +175,7 @@  x509.genkey
 *.kdev4
 
 # Clang's compilation database file
-/compile_commands.json
+compile_commands.json
 
 # Documentation toolchain
 sphinx_*/
diff --git a/tools/power/cpupower/.gitignore b/tools/power/cpupower/.gitignore
index 5113d5a7aee0..7677329c42a6 100644
--- a/tools/power/cpupower/.gitignore
+++ b/tools/power/cpupower/.gitignore
@@ -27,6 +27,3 @@  debug/i386/intel_gsic
 debug/i386/powernow-k8-decode
 debug/x86_64/centrino-decode
 debug/x86_64/powernow-k8-decode
-
-# Clang's compilation database file
-compile_commands.json