Re: Oddities in gitignore matching

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

 



On 2022 Jun 28, at 09:48, John Thorvald Wodder II <jwodder@xxxxxxxxx> wrote:
> Through further experimentation, I've discovered a fourth oddity with gitignore: If "foo//" (with two or more trailing slashes) is added to .gitignore and `mkdir -p foo/bar` is run, then `git status --ignored=matching --porcelain` won't show "foo/" or "foo/bar/" at all, which is something I'd previously only encountered for completely empty top-level directories.  This holds true no matter how deep or wide you make the directory tree at "foo/", as long as it's all-directories; once a file gets added somewhere under "foo/", the "git status" command shows "foo/" as ignored.

Correction: When a file is added under "foo/", then "git status" shows it as *untracked*, not ignored.  I also see now that a pure-directory tree being absent from "git status" happens even without a .gitignore, so presumably this is intended behavior.  It's just a little odd that, if "foo/" is an empty top-level directory, it only shows up in "git status --ignored=matching" if it's ignored.

-- John Wodder



[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]

  Powered by Linux