Subject: Re: Clean up stale .gitignore and .gitattribute patterns

From: Junio C Hamano <[email-masked]>
Date: Fri, 23 Jun 2023 10:26:23 -0700

Sebastian Schuberth <[email-masked]> writes:

> is there a command to easily check patterns in .gitignore and
> .gitattributes to still match something? I'd like to remove / correct
> patterns that don't match anything anymore due to (re)moved files.

I guess "git check-attr --stdin" and "git check-ignore --stdin" will
be part of the solution to your problem, but I do not know what the
other parts would be.

Feeding "ls-files" output to "check-ignore --stdin" feels sort-of
oxymoron because by definition the output from "ls-files" cannot
contain any ignored paths.