git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Gitignore file exceptions are not applied to untarcked files
@ 2016-01-29 15:25 Assen Totin
  2016-01-29 18:31 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Assen Totin @ 2016-01-29 15:25 UTC (permalink / raw)
  To: git

Hi,

I'm not sure if the described issue is a bug or a feature; if it is the
latter, please, excuse the report.

I'm dealing with git 1.7.12.4. If this has been addressed in the later
issue, please, point me so.

The problem: I have a directory tree with lots of files and dirs, of which
I only track certain files in subdirs of a specific subdir. It goes like
this:

/untracted_file1
/untracked_file2
/untracked_dir1/...
/untracked_dir2/...
/tracked_dir/subdir1/config
/tracked_dir/subdir1/another_untracked_file
/tracked_dir/subdir2/config
/tracked_dir/subdir2/another_untracked_file

I'm only interested in /tracked_dir/.../config files. My .gitignore is as
follows:

# Ignore everything first
*
# Do not ignore tracked files
!/tracked_dir/*/config
# Don't ignore .gitignore
!.gitignore

This works fine until a new directory with a config file is created inside
/tracked_dir:

/tracked_dir/new_subdir/config

This config file is not seen by git at all (git status returns no changes
to add), although it matches the exclusion pattern.

While I can use various workarounds, I'm interested whether this actual
phenomenon occurs - why does the exclusion pattern not match an untracked
file in untracked directory? Is it because the exclusion pattern is never
applied to untracked files? Or is it because the directory new_subdir is
itself untracked?

WWell,

Assen Totin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-29 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 15:25 Gitignore file exceptions are not applied to untarcked files Assen Totin
2016-01-29 18:31 ` Junio C Hamano
2016-01-29 20:54   ` Anatoly Borodin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).