Skip to content

read_directory() rewrite to support struct pathspec

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11Introduce "check-attr --excluded" as a replacement for "add --ignore-missing"Documentation/git-check-attr.txt builtin/add.c builtin/check-attr.c +2 more+34 -312 replies
2/11notes-merge: use opendir/readdir instead of using read_directory()notes-merge.c+27 -1822 replies
3/11t5403: avoid doing "git add foo/bar" where foo/.git existst/t5403-post-checkout-hook.sh+10 -79 replies
4/11tree-walk.c: do not leak internal structure in tree_entry_len()builtin/grep.c builtin/pack-objects.c tree-diff.c +4 more+20 -201 reply
5/11symbolize return values of tree_entry_interesting()builtin/grep.c list-objects.c tree-diff.c +3 more+54 -433 replies
6/11read_directory_recursive: reduce one indentation leveldir.c+25 -250 replies
7/11tree_entry_interesting: make use of local pointer "item"tree-walk.c+2 -20 replies
8/11tree-walk: mark useful pathspecscache.h tree-walk.c+11 -30 replies
9/11tree_entry_interesting: differentiate partial vs full matchtree-walk.c tree-walk.h+11 -70 replies
10/11read-dir: stop using path_simplify code in favor of tree_entry_interesting()builtin/add.c dir.c dir.h +1 more+236 -1100 replies
11/11dir.c: remove dead code after read_directory() rewritedir.c dir.h+0 -1240 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchDavid BremnerNguyễn Thái Ngọc DuyJohan HerlandJunio C Hamano
1/11
2/11Found-by Originally-by Updated-by Inspired-by
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH/WIP 00/11] read_directory() rewrite to support struct pathspec

This is the first time "make test" fully passes (*) for me, so it's probably good enough for human eyes. Just heads up where this might go.

A few points:

- "git add --ignore-missing" is killed because I could not find an easy way to incorporate it to the new read_directory(). It looks like a hack to me, to expose .gitignore matching. Luckily no one except submodule seems to use it.

- I chose to use tree_entry_interesting() instead of match_pathspec(). The former has more optimizations but requires a tree-based structure. So I have to read the whole directory in, re-construct a temporary tree object to make t_e_i() happy. I _think_ it does not impact performance with reasonable dir size.

- there'll be more work to get rid of match_pathspec() calls after read_directory()/fill_directory(). I haven't got finished this part yet.

- I really like to kill match_pathspec() so we only have one pathspec implementation instead of two now, but that may be real hard because of staged entries in index.

(*) t7012.7 fails but I think that's the test's fault.

Nguyễn Thái Ngọc Duy (11):
Introduce "check-attr --excluded" as a replacement for "add --ignore-missing"
notes-merge: use opendir/readdir instead of using read_directory()
t5403: avoid doing "git add foo/bar" where foo/.git exists tree-walk.c: do not leak internal structure in tree_entry_len() symbolize return values of tree_entry_interesting()
read_directory_recursive: reduce one indentation level
tree_entry_interesting: make use of local pointer "item"
tree-walk: mark useful pathspecs
tree_entry_interesting: differentiate partial vs full match
read-dir: stop using path_simplify code in favor of tree_entry_interesting() dir.c: remove dead code after read_directory() rewrite

 Documentation/git-check-attr.txt |    4 +
 builtin/add.c                    |   36 ++--
 builtin/check-attr.c             |   26 +++
 builtin/grep.c                   |   11 +-
 builtin/pack-objects.c           |    2 +-
 cache.h                          |    1 +
 dir.c                            |  428 +++++++++++++++++++-------------------
 dir.h                            |    8 +-
 git-submodule.sh                 |    2 +-
 list-objects.c                   |    9 +-
 notes-merge.c                    |   45 +++--
 t/t3700-add.sh                   |   19 --
 t/t5403-post-checkout-hook.sh    |   17 +-
 tree-diff.c                      |   19 +-
 tree-walk.c                      |   85 ++++----
 tree-walk.h                      |   19 ++-
 tree.c                           |   11 +-
 unpack-trees.c                   |    6 +-
 18 files changed, 394 insertions(+), 354 deletions(-)
Signature · 1 line
1.7.3.1.256.g2539c.dirty