Skip to contentSkip to conversation

Add cglangd specific files to gitignore

PATCH Superseded Andrea Cervesato 3 participants 3 messages Mar 25

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add cglangd specific files to gitignore

From: Andrea Cervesato <[email protected]>

Add rule to ignore clangd LSP configuration from local repository.

---
Clangd is extensively used by IDEs and generic LSP wrappers to setup
clangd configuration. This patch removes it from gitignore so we can
safely avoid it gets into the patch-set when it's sent.
---
Changes in v2:
- add compile_commands.json
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)
.gitignore +2 -0
index 24f4a4ea834e0b919e640e879fe5e5b5d7aec466..139ecded5fa0a47a12b97eac6ebf432cbe5e5c11 100644
@@ -60,3 +60,5 @@ patches/
 logfile.*
 
 /utils/benchmark/ebizzy-0.3/ebizzy
+/compile_flags.txt
+/compile_commands.json

---
base-commit: b874b6a264cf4f343c17d543ebe4ff91fbb89042
change-id: 20260325-compile_flags_gitignore-c12d8f65ef2d

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw
Quoted 22 lines · Andrea Cervesato

From: Andrea Cervesato <[email protected]>

Add rule to ignore clangd LSP configuration from local repository.

---
Clangd is extensively used by IDEs and generic LSP wrappers to setup
clangd configuration. This patch removes it from gitignore so we can
safely avoid it gets into the patch-set when it's sent.
---
Changes in v2:
- add compile_commands.json
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)
.gitignore +0 -0
index 24f4a4ea834e0b919e640e879fe5e5b5d7aec466..139ecded5fa0a47a12b97eac6ebf432cbe5e5c11 100644

.gitignore patches/ · line 64

Quoted 5 lines
.gitignore +2 -0
@@ -60,3 +60,5 @@ patches/
 logfile.*
 
 /utils/benchmark/ebizzy-0.3/ebizzy
+/compile_flags.txt
+/compile_commands.json

Hi Andrea,

thanks for spinning v2 so quickly!

Small nit: with the leading '/', /compile_commands.json only matches in the repository root. However compile_commands.json is often generated in build/subdirectories (depending on where the build is run). If the goal is to prevent accidental inclusion anywhere, the pattern should be unanchored, e.g.:

compile_commands.json

(or equivalently **/compile_commands.json).

I can reproduce this by generating it from a subdir (e.g. via bear), which produces ./compile_commands.json there.

bear -- make

Thanks,
Jan

Quoted 12 lines

---
base-commit: b874b6a264cf4f343c17d543ebe4ff91fbb89042
change-id: 20260325-compile_flags_gitignore-c12d8f65ef2d

Best regards,
--
Andrea Cervesato <[email protected]>

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 9 lines

Small nit: with the leading '/', /compile_commands.json only matches in the repository root. However compile_commands.json is often generated in build/subdirectories (depending on where the build is run). If the goal is to prevent accidental inclusion anywhere, the pattern should be unanchored, e.g.:

compile_commands.json

(or equivalently **/compile_commands.json).

Quoted 7 lines

I can reproduce this by generating it from a subdir (e.g. via bear), which produces ./compile_commands.json there.

bear -- make

Thanks,
Jan

I see, I never used bear honestly, so this might be a bit tricky for me. But I see the value and the correlation with clangd, so we can safely add

**/compile_commands.json

Will send an another patch.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp