Skip to content

RFC convert dir.c to take an index parameter

Brandon Williams git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14dir: stop using the index compatibility macrosdir.c+21 -200 replies
2/14dir: convert read_skip_worktree_file_from_index to take an indexdir.c+7 -60 replies
3/14dir: convert directory_exists_in_index to take indexdir.c+12 -100 replies
4/14dir: convert get_dtype to take indexdir.c+13 -100 replies
5/14dir: convert dir_add* to take an indexbuiltin/add.c dir.c dir.h+16 -90 replies
6/14dir: convert last_exclude_matching_from_list to take an indexdir.c+8 -50 replies
7/14dir: convert is_excluded_from_list to take an indexdir.c dir.h unpack-trees.c+9 -60 replies
8/14dir: convert add_excludes to take an indexdir.c dir.h unpack-trees.c+17 -160 replies
9/14dir: convert prep_exclude to take an indexdir.c+8 -60 replies
10/14dir: convert is_excluded to take an indexbuiltin/add.c builtin/check-ignore.c builtin/clean.c +4 more+19 -130 replies
11/14dir: convert open_cached_dir to take an indexdir.c+7 -50 replies
12/14dir: convert read_directory_recursive to take an indexdir.c+29 -230 replies
13/14dir: convert read_directory to take an indexdir.c dir.h unpack-trees.c+12 -100 replies
14/14dir: convert fill_directory to take an indexbuiltin/add.c builtin/clean.c builtin/grep.c +4 more+12 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/14] convert dir.c to take an index parameter

One of the things brought up on the list in the past few days has been migrating away from using the index compatibility macros. One of the issues brought up in that thread was how simply doing that conversion doesn't eliminate the reliance on global state (specifically the_index). If one day we want to have a 'repository object' passed around then we first need to convert different subsystems to be prepared to handle that. This series provides a first step, converting the code in dir.c to take a 'struct index_state' and using that instead of implicitly using 'the_index'.

Brandon Williams (14):
dir: stop using the index compatibility macros
dir: convert read_skip_worktree_file_from_index to take an index
dir: convert directory_exists_in_index to take index
dir: convert get_dtype to take index
dir: convert dir_add* to take an index
dir: convert last_exclude_matching_from_list to take an index
dir: convert is_excluded_from_list to take an index
dir: convert add_excludes to take an index
dir: convert prep_exclude to take an index
dir: convert is_excluded to take an index
dir: convert open_cached_dir to take an index
dir: convert read_directory_recursive to take an index
dir: convert read_directory to take an index
dir: convert fill_directory to take an index

 builtin/add.c          |   7 +-
 builtin/check-ignore.c |   3 +-
 builtin/clean.c        |   4 +-
 builtin/grep.c         |   2 +-
 builtin/ls-files.c     |   4 +-
 dir.c                  | 200 ++++++++++++++++++++++++++++---------------------
 dir.h                  |  27 +++++--
 unpack-trees.c         |  10 +--
 wt-status.c            |   2 +-
 9 files changed, 151 insertions(+), 108 deletions(-)
Signature · 1 line
2.13.0.rc1.294.g07d810a77f-goog