Skip to content

Commit

Permalink
x86 boot build: make git ignore stale 'tools' directory
Browse files Browse the repository at this point in the history
We've had this before: when we remove infrastructure to generate files,
the old stale build artifacts still remain in-tree.  And when the
infrastructure to generate them is gone, so is the gitignore file for
those build artifacts.

End result: git will see the old generated files, and people will
mistakenly commit them.  That's what happened with the 'genheaders' file
not that long ago (see commit 04a3389 "Remove stale generated
'genheaders' file").

This time it's commit 9c54baa ("x86/boot: Drop CRC-32 checksum and
the build tool that generates it") that removed the 'build' file from
the arch/x86/boot/tools/ subdirectory, and removed the .gitignore file
too (because the whole subdirectory is gone).

And as a result, if you don't do a 'git clean -dqfx' or similar to clean
up your tree, 'git status' will say

  Untracked files:
    (use "git add <file>..." to include in what will be committed)
	arch/x86/boot/tools/

and some hapless sleep-deprived developer will inevitably decide that
that means that they need to 'git add' that directory.  Which would
bring back some stale generated file that we most definitely do not want
in the tree.

So when removing directories that had special .gitignore patterns, make
sure to add a new gitignore entry in the parent directory for the no
longer existing subdirectory.

It will avoid mistakes.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Fixes: 9c54baa ("x86/boot: Drop CRC-32 checksum and the build tool that generates it")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Mar 25, 2025
1 parent 001a3a0 commit 2df0c02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/boot/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ fdimage
mtools.conf
image.iso
hdimage
tools/

0 comments on commit 2df0c02

Please sign in to comment.