git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] "ls-files -i" not honoring directory wide ignore
@ 2012-06-06  5:45 Junio C Hamano
  2012-06-06  5:45 ` [PATCH 1/6] ls-files -i: pay attention to exclusion of leading paths Junio C Hamano
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-06-06  5:45 UTC (permalink / raw)
  To: git

"git ls-files --exclude=t -i" does not list anything, even though it
ought to report all the paths that are tracked in the t/ directory.

This is because the command used excluded() API incorrectly. The API
is designed to be called by callers that walk the tree structure
from the top level, checking each and every level as it descends,
and stop descending into a directory that is known to be ignored,
but the caller just passed a full path of a tracked file without
checking its higher level components and asked "Is this ignored?".

This series introduces a new path_excluded() API to be used for such
callers based on the excluded() API.  Also converted to use this new
API are two other callers of the excluded(), namely "git checkout"
and "git add -n --ignore-missing", that shared the same issue.

The third patch is more or less an "Oops, the earlier one was not
ideal" fix-up patch, but as the earlier parts of the series is
already in "next", I'll leave it as-is for now.  It probably is
necessary to squash it into the earlier patches post 1.7.11 after
the "next" branch is rewound.

Junio C Hamano (6):
  ls-files -i: pay attention to exclusion of leading paths
  ls-files -i: micro-optimize path_excluded()
  path_excluded(): update API to less cache-entry centric
  builtin/add.c: use path_excluded()
  unpack-trees.c: use path_excluded() in check_ok_to_remove()
  dir.c: make excluded() file scope static

 builtin/add.c      |  6 +++++-
 builtin/ls-files.c | 23 +++++++++++++++------
 dir.c              | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 dir.h              | 18 +++++++++++++++-
 unpack-trees.c     | 11 +++++++++-
 unpack-trees.h     |  1 +
 6 files changed, 109 insertions(+), 10 deletions(-)

-- 
1.7.11.rc1.37.g09843ac

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

end of thread, other threads:[~2012-06-06  5:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06  5:45 [PATCH 0/6] "ls-files -i" not honoring directory wide ignore Junio C Hamano
2012-06-06  5:45 ` [PATCH 1/6] ls-files -i: pay attention to exclusion of leading paths Junio C Hamano
2012-06-06  5:45 ` [PATCH 2/6] ls-files -i: micro-optimize path_excluded() Junio C Hamano
2012-06-06  5:45 ` [PATCH 3/6] path_excluded(): update API to less cache-entry centric Junio C Hamano
2012-06-06  5:45 ` [PATCH 4/6] builtin/add.c: use path_excluded() Junio C Hamano
2012-06-06  5:45 ` [PATCH 5/6] unpack-trees.c: use path_excluded() in check_ok_to_remove() Junio C Hamano
2012-06-06  5:45 ` [PATCH 6/6] dir.c: make excluded() file scope static Junio C Hamano

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).