Re: Gitignore file exceptions are not applied to untarcked files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,


I've tested it with many older versions of git, as well as with the recent
v2.7.0 - it seems like this feature has been never working properly.

The script https://gist.github.com/anatolyborodin/9c581b50c584534fff28

#!/bin/sh

set -e

# a
# b
# c
# D/a
# D/b
# D/c
# E/F/a
# E/F/b
# E/F/c

mkdir -p D E/F
touch a b c D/a D/b D/c E/F/a E/F/b E/F/c

echo && echo '.gitignore' && echo '----------'
echo '*\n!b\n!D/b\n!/D/b\n!/E/*/b' > .gitignore
cat .gitignore

echo && echo 'With `--ignored`' && echo '----------'
git status --ignored

echo && echo 'Without `--ignored`' && echo '----------'
git status


The output:


.gitignore
----------
*
!b
/D/b
!/D/b
!/E/*/b

With `--ignored`
----------
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        b

Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

        .gitignore
        D/
        E/
        a
        c

nothing added to commit but untracked files present (use "git add" to track)

Without `--ignored`
----------
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        b

nothing added to commit but untracked files present (use "git add" to track)



All files in the subdirectories are ignored, no matter what.


-- 
Mit freundlichen Grüßen,
Anatoly Borodin

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]