git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 00/24] Kill the_index part3
@ 2018-08-13 16:14 Nguyễn Thái Ngọc Duy
  2018-08-13 16:14 ` [PATCH 01/24] diff.c: move read_index() code back to the caller Nguyễn Thái Ngọc Duy
                   ` (24 more replies)
  0 siblings, 25 replies; 38+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-08-13 16:14 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

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/20180616054157.32433-1-pclouds@gmail.com/

diff --git a/builtin/stash.c b/builtin/stash.c
index 74eda822ce..f34edba21f 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -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(-)

-- 
2.18.0.1004.g6639190530


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

end of thread, other threads:[~2018-08-15 19:48 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 16:14 [PATCH 00/24] Kill the_index part3 Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 01/24] diff.c: move read_index() code back to the caller Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 02/24] cache-tree: wrap the_index based wrappers with #ifdef Nguyễn Thái Ngọc Duy
2018-08-13 21:18   ` Junio C Hamano
2018-08-13 16:14 ` [PATCH 03/24] attr: remove an implicit dependency on the_index Nguyễn Thái Ngọc Duy
2018-08-13 17:12   ` Brandon Williams
2018-08-13 16:14 ` [PATCH 04/24] convert.c: " Nguyễn Thái Ngọc Duy
2018-08-13 21:21   ` Junio C Hamano
2018-08-13 16:14 ` [PATCH 05/24] dir.c: remove an implicit dependency on the_index in pathspec code Nguyễn Thái Ngọc Duy
2018-08-13 17:17   ` Brandon Williams
2018-08-13 18:40     ` Duy Nguyen
2018-08-13 16:14 ` [PATCH 06/24] preload-index.c: use the right index instead of the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 07/24] ls-files: correct index argument to get_convert_attr_ascii() Nguyễn Thái Ngọc Duy
2018-08-15 18:56   ` Stefan Beller
2018-08-13 16:14 ` [PATCH 08/24] unpack-trees: remove 'extern' on function declaration Nguyễn Thái Ngọc Duy
2018-08-15 19:10   ` Stefan Beller
2018-08-15 19:21     ` Duy Nguyen
2018-08-15 19:25       ` Stefan Beller
2018-08-13 16:14 ` [PATCH 09/24] unpack-trees: add a note about path invalidation Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 10/24] unpack-trees: don't shadow global var the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 11/24] unpack-trees: convert clear_ce_flags* to avoid the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 12/24] unpack-trees: avoid the_index in verify_absent() Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 13/24] pathspec.c: use the right index instead of the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 14/24] submodule.c: " Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 15/24] entry.c: " Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 16/24] attr: remove index from git_attr_set_direction() Nguyễn Thái Ngọc Duy
2018-08-13 17:22   ` Brandon Williams
2018-08-13 16:14 ` [PATCH 17/24] grep: use the right index instead of the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 18/24] archive.c: avoid access to the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 19/24] archive-*.c: use the right repository Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 20/24] resolve-undo.c: use the right index instead of the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 21/24] apply.c: pass struct apply_state to more functions Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 22/24] apply.c: make init_apply_state() take a struct repository Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 23/24] apply.c: remove implicit dependency on the_index Nguyễn Thái Ngọc Duy
2018-08-13 16:14 ` [PATCH 24/24] blame.c: " Nguyễn Thái Ngọc Duy
2018-08-13 17:28 ` [PATCH 00/24] Kill the_index part3 Brandon Williams
2018-08-13 21:24   ` Junio C Hamano
2018-08-15 19:48     ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).