On 2/26/20 11:14 AM, Linus Torvalds wrote:
On Tue, Feb 25, 2020 at 3:26 PM Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx> wrote:
- Declutter git status fix from Christophe Leroy
I've pulled this, but just for future reference (and hoping for a
future cleanup patch): instead of putting things in the global
.gitignore file, do it in the relevant local one.
So you could just have added
*.sh
!run.sh
in 'tools/testing/selftests/lkdtm/.gitignore' instead of doing
# Generated lkdtm tests
/tools/testing/selftests/lkdtm/*.sh
!/tools/testing/selftests/lkdtm/run.sh
in the top-level one.
That keeps things much better separated. It also incidentally means
that if a directory gets renamed, the gitignore file just "magically"
continues to work (if you rename the actual files themselves that are
named in gitignore, then that's obviously a different thing).
If you put it in the leaf directory, it also means that you don't need
the '/' at the beginning, because the local gitignore entries will
only affect that subdirectory (and any subdirectories under it).
So please put only "global" gitignore patterns in the top-level gitignore file.
Linus
Thanks. I will keep this mind as I review these kinds of patches.
-- Shuah