Skip to content

Kill the_index part3

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 Latest24 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24diff.c: move read_index() code back to the callerbuiltin/diff-tree.c diff.c diff.h+5 -140 replies
2/24cache-tree: wrap the_index based wrappers with #ifdefcache-tree.c cache-tree.h sequencer.c+16 -171 reply
3/24attr: remove an implicit dependency on the_indexarchive.c attr.c attr.h +7 more+55 -321 reply
4/24convert.c: remove an implicit dependency on the_indexapply.c archive.c builtin/cat-file.c +7 more+45 -331 reply
5/24dir.c: remove an implicit dependency on the_index in pathspec codearchive.c builtin/add.c builtin/checkout.c +18 more+54 -452 replies
6/24preload-index.c: use the right index instead of the_indexpreload-index.c+1 -10 replies
7/24ls-files: correct index argument to get_convert_attr_ascii()builtin/ls-files.c+9 -81 reply
8/24unpack-trees: remove 'extern' on function declarationunpack-trees.h+2 -23 replies
9/24unpack-trees: add a note about path invalidationunpack-trees.c+11 -00 replies
10/24unpack-trees: don't shadow global var the_indexunpack-trees.c+4 -50 replies
11/24unpack-trees: convert clear_ce_flags* to avoid the_indexunpack-trees.c+18 -130 replies
12/24unpack-trees: avoid the_index in verify_absent()unpack-trees.c+2 -20 replies
13/24pathspec.c: use the right index instead of the_indexpathspec.c+1 -10 replies
14/24submodule.c: use the right index instead of the_indexsubmodule.c+4 -40 replies
15/24entry.c: use the right index instead of the_indexbuiltin/checkout-index.c entry.c+6 -40 replies
16/24attr: remove index from git_attr_set_direction()archive.c attr.c attr.h +2 more+8 -181 reply
17/24grep: use the right index instead of the_indexbuiltin/grep.c+2 -20 replies
18/24archive.c: avoid access to the_indexarchive.c archive.h builtin/archive.c +1 more+45 -210 replies
19/24archive-*.c: use the right repositoryarchive-tar.c archive-zip.c+2 -20 replies
20/24resolve-undo.c: use the right index instead of the_indexresolve-undo.c+1 -10 replies
21/24apply.c: pass struct apply_state to more functionsapply.c+11 -70 replies
22/24apply.c: make init_apply_state() take a struct repositoryapply.c apply.h builtin/am.c +1 more+8 -20 replies
23/24apply.c: remove implicit dependency on the_indexapply.c+25 -210 replies
24/24blame.c: remove implicit dependency on the_indexblame.c blame.h builtin/blame.c+33 -210 replies

Reviews trailers per patch

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

PatchElijah Newren
1/24
2/24
3/24
4/24
5/24
6/24
7/24
8/24
9/24
10/24
11/24
12/24Helped-by
13/24
14/24
15/24
16/24
17/24
18/24
19/24
20/24
21/24
22/24
23/24
24/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/24] Kill the_index part3

This is the third part of killing the_index (at least outside builtin/). Part 1 [1] is dropped. Part 2 is nd/no-extern on 'pu'. This part is built on top of nd/no-extern.

This series would actually break 'pu' because builtin/stash.c uses three functions that are updated here. So we would need something like the following patch to make it build again.

I don't know if that adds too much work on Junio. If it does, I guess I'll hold this off for a while until builtin/stash.c gets merged because reordering these patches, pushing the patches that break stash.c away, really takes a lot of work.

[1] https://public-inbox.org/git/[email protected]/

builtin/stash.c +3 -3
index 74eda822ce..f34edba21f 100644
@@ -294,7 +294,7 @@ static int apply_patch_from_buf(struct strbuf *patch, int cached, int reverse,
 	const char *patch_path = ".git/stash_patch.patch";
 	FILE *patch_file;
 
-	if (init_apply_state(&state, NULL))
+	if (init_apply_state(&state, the_repository, NULL))
 		return -1;
 
 	state.cached = cached;
@@ -873,7 +873,7 @@ static int get_untracked_files(const char **argv, const char *prefix,
 	max_len = fill_directory(&dir, the_repository->index, &pathspec);
 	for (i = 0; i < dir.nr; i++) {
 		struct dir_entry *ent = dir.entries[i];
-		if (!dir_path_match(ent, &pathspec, max_len, seen)) {
+		if (!dir_path_match(the_repository->index, ent, &pathspec, max_len, seen)) {
 			free(ent);
 			continue;
 		}
@@ -1299,7 +1299,7 @@ static int do_push_stash(int argc, const char **argv, const char *prefix,
 
 		for (i = 0; i < active_nr; ++i) {
 			const struct cache_entry *ce = active_cache[i];
-			if (!ce_path_match(ce, &ps, ps_matched))
+			if (!ce_path_match(&the_index, ce, &ps, ps_matched))
 				continue;
 		}
 

Nguyễn Thái Ngọc Duy (24):
diff.c: move read_index() code back to the caller
cache-tree: wrap the_index based wrappers with #ifdef
attr: remove an implicit dependency on the_index convert.c: remove an implicit dependency on the_index dir.c: remove an implicit dependency on the_index in pathspec code preload-index.c: use the right index instead of the_index
ls-files: correct index argument to get_convert_attr_ascii()
unpack-trees: remove 'extern' on function declaration
unpack-trees: add a note about path invalidation
unpack-trees: don't shadow global var the_index
unpack-trees: convert clear_ce_flags* to avoid the_index
unpack-trees: avoid the_index in verify_absent() pathspec.c: use the right index instead of the_index submodule.c: use the right index instead of the_index entry.c: use the right index instead of the_index
attr: remove index from git_attr_set_direction()
grep: use the right index instead of the_index archive.c: avoid access to the_index
archive-*.c: use the right repository
resolve-undo.c: use the right index instead of the_index apply.c: pass struct apply_state to more functions apply.c: make init_apply_state() take a struct repository apply.c: remove implicit dependency on the_index blame.c: remove implicit dependency on the_index

 apply.c                     | 66 +++++++++++++++++++++----------------
 apply.h                     |  4 +++
 archive-tar.c               |  2 +-
 archive-zip.c               |  2 +-
 archive.c                   | 47 ++++++++++++++++----------
 archive.h                   | 16 +++++++--
 attr.c                      | 52 +++++++++++++++++------------
 attr.h                      | 11 ++++---
 blame.c                     | 52 +++++++++++++++++------------
 blame.h                     |  1 +
 builtin/add.c               |  6 ++--
 builtin/am.c                |  2 +-
 builtin/apply.c             |  2 +-
 builtin/archive.c           |  2 +-
 builtin/blame.c             |  1 +
 builtin/cat-file.c          |  2 +-
 builtin/check-attr.c        |  6 ++--
 builtin/checkout-index.c    |  1 +
 builtin/checkout.c          |  2 +-
 builtin/clean.c             |  2 +-
 builtin/commit.c            |  2 +-
 builtin/diff-tree.c         |  8 +++--
 builtin/grep.c              |  6 ++--
 builtin/ls-files.c          | 17 +++++-----
 builtin/pack-objects.c      |  2 +-
 builtin/rm.c                |  2 +-
 builtin/submodule--helper.c |  2 +-
 builtin/update-index.c      |  2 +-
 builtin/upload-archive.c    |  3 +-
 cache-tree.c                | 12 -------
 cache-tree.h                | 17 ++++++++--
 convert.c                   | 41 +++++++++++++----------
 convert.h                   | 15 ++++++---
 diff-lib.c                  |  4 +--
 diff.c                      | 12 +------
 diff.h                      |  1 -
 dir.c                       | 27 ++++++++-------
 dir.h                       | 16 +++++----
 entry.c                     |  9 ++---
 ll-merge.c                  |  4 +--
 merge-recursive.c           |  2 +-
 pathspec.c                  |  2 +-
 preload-index.c             |  2 +-
 read-cache.c                |  2 +-
 rerere.c                    |  2 +-
 resolve-undo.c              |  2 +-
 revision.c                  |  2 +-
 sequencer.c                 |  4 +--
 sha1-file.c                 |  4 +--
 submodule.c                 |  8 ++---
 unpack-trees.c              | 57 ++++++++++++++++++++------------
 unpack-trees.h              |  4 +--
 userdiff.c                  |  2 +-
 ws.c                        |  2 +-
 wt-status.c                 |  6 ++--
 55 files changed, 337 insertions(+), 245 deletions(-)
Signature · 1 line
2.18.0.1004.g6639190530