[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLNQFmgS2IcDbPmd@levanger>
Date: Sat, 30 Aug 2025 21:25:10 +0200
From: Nicolas Schier <nsc@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Brendan Jackman <jackmanb@...gle.com>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>, linux-kernel@...r.kernel.org,
Justin Stitt <justinstitt@...gle.com>, llvm@...ts.linux.dev,
linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] .gitignore: ignore temporary files from 'bear'
On Fri, Aug 29, 2025 at 04:38:24PM -0700, Nathan Chancellor wrote:
> Hi Brendan,
>
> On Wed, Aug 27, 2025 at 08:59:43AM +0000, Brendan Jackman wrote:
> > Bear [0] is a tool for generating compile_commands.json. For Kbuild,
> > Bear is not useful, since Kbuild already generates the necessary info
> > and that can be converted to compile_commands.json by
> > gen_compile_commads.py.
> >
> > However, for code in tools/, it's handy. For example, this command
> > updates compile_commands.json so that clangd code navigation will also
> > work for the VMA unit tests:
> >
> > bear --append -- make -C tools/testing/vma -j
> >
> > Bear generates some temporary files. These are usually deleted again
> > but having them show up ephemerally confuses tools that trigger
> > recompilation on source code changes. Ignore them in Git so that these
> > tools can tell they aren't source code.
> >
> > [0]: https://github.com/rizsotto/Bear
> >
> > Signed-off-by: Brendan Jackman <jackmanb@...gle.com>
>
> We can likely take this via the Kbuild tree. I do wonder if this would
> be better in a tools/.gitignore file since bear is really only of use
> there but I am not sure it matters much.
yeah, please consider using tools/.gitignore. Please have a look at
this thread about ignoring files from "external" tools:
https://lore.kernel.org/lkml/CAHk-=wiJHMje8cpiTajqrLrM23wZK0SWetuK1Bd67c0OGM_BzQ@mail.gmail.com/
If using tools/.gitignore is not possible, I think the best way for
ignoring files that are not natively related to kernel build tools is to
update the local ~/.config/git/ignore, as suggested in
https://lore.kernel.org/lkml/CAK7LNAQas0cK7pgi72tYC3yU=ZkQxnr41YYW1mXd-sWiHtG+UA@mail.gmail.com/
compare to:
https://docs.github.com/en/get-started/git-basics/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer
Kind regards,
Nicolas
Powered by blists - more mailing lists