• Dave Williams's avatar
    check-ignore: Add option to ignore index contents · 8231fa6a
    Dave Williams authored
    check-ignore currently shows how .gitignore rules would treat untracked
    paths. Tracked paths do not generate useful output.  This prevents
    debugging of why a path became tracked unexpectedly unless that path is
    first removed from the index with `git rm --cached <path>`.
    
    The option --no-index tells the command to bypass the check for the
    path being in the index and hence allows tracked paths to be checked
    too.
    
    Whilst this behaviour deviates from the characteristics of `git add` and
    `git status` its use case is unlikely to cause any user confusion.
    
    Test scripts are augmented to check this option against the standard
    ignores to ensure correct behaviour.
    Signed-off-by: default avatarDave Williams <dave@opensourcesolutions.co.uk>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    8231fa6a
git-check-ignore.txt 3.66 KB