Re: [PATCH 3/3] kbuild: Add a build check for missing gitignore entries

From: Geert Uytterhoeven
Date: Wed Feb 24 2021 - 06:27:53 EST


Hi Rob,

On Tue, Feb 23, 2021 at 7:18 PM Rob Herring <robh@xxxxxxxxxx> wrote:
> Any non-phony targets need to be in gitignore. The normal way to check
> this is doing an in-tree build and running git-status which is easy to
> miss. Git provides an easy way to check whether a file is ignored with
> git-check-ignore. Let's add a build time check using it. If the build is
> not in a git tree, the check will silently fail.
>
> This also has the side effect of a sanity check for 'always-y',
> 'extra-y' and 'targets' entries which are not correctly marked as PHONY
> or have the wrong path.
>
> Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> Cc: Michal Marek <michal.lkml@xxxxxxxxxxx>
> Cc: linux-kbuild@xxxxxxxxxxxxxxx
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>

Thanks for your patch!

After removing the .git directory from my repository clone, or
removing the git command from $PATH:

scripts/Makefile.lib:106: scripts/basic/fixdep is missing gitignore entry
scripts/Makefile.lib:106: scripts/sorttable is missing gitignore entry
[...]

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds