public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Claus Schneider(Eficode) via GitGitGadget" <gitgitgadget@gmail•com>
To: git@vger•kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail•com>,
	"Junio C Hamano" <gitster@pobox•com>,
	"Brandon Williams" <bmwill@google•com>,
	"Claus Schneider" <claus.schneider@eficode•com>,
	"Claus Schneider(Eficode)" <claus.schneider@eficode•com>
Subject: [PATCH 1/5] read-cache: update add_files_to_cache to take param ignored_too(--force)
Date: Sat, 18 Oct 2025 20:07:15 +0000	[thread overview]
Message-ID: <d98cca698ddb376831c0657eab2c488f9e7585bc.1760818039.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1987.git.1760818039.gitgitgadget@gmail.com>

From: "Claus Schneider(Eficode)" <claus.schneider@eficode•com>

The ignored_too parameter is added to the function add_files_to_cache for
usage of explicit updating the index for the updated submodule using the
explicit patchspec to the submodule.

Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode•com>
---
 builtin/add.c      | 2 +-
 builtin/checkout.c | 2 +-
 builtin/commit.c   | 2 +-
 read-cache-ll.h    | 2 +-
 read-cache.c       | 8 +++++++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 0235854f80..cd1116e70a 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -582,7 +582,7 @@ int cmd_add(int argc,
 	else
 		exit_status |= add_files_to_cache(repo, prefix,
 						  &pathspec, ps_matched,
-						  include_sparse, flags);
+						  include_sparse, flags, ignored_too);
 
 	if (take_worktree_changes && !add_renormalize && !ignore_add_errors &&
 	    report_path_error(ps_matched, &pathspec))
diff --git a/builtin/checkout.c b/builtin/checkout.c
index f9453473fe..b2a404051d 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -899,7 +899,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
 			 */
 
 			add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
-					   0);
+					   0, 0 );
 			init_ui_merge_options(&o, the_repository);
 			o.verbosity = 0;
 			work = write_in_core_index_as_tree(the_repository);
diff --git a/builtin/commit.c b/builtin/commit.c
index b5b9608813..5bf7ae5fc1 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -455,7 +455,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
 		repo_hold_locked_index(the_repository, &index_lock,
 				       LOCK_DIE_ON_ERROR);
 		add_files_to_cache(the_repository, also ? prefix : NULL,
-				   &pathspec, ps_matched, 0, 0);
+				   &pathspec, ps_matched, 0, 0, 0 );
 		if (!all && report_path_error(ps_matched, &pathspec))
 			exit(128);
 
diff --git a/read-cache-ll.h b/read-cache-ll.h
index 71b49d9af4..2c8b4b21b1 100644
--- a/read-cache-ll.h
+++ b/read-cache-ll.h
@@ -481,7 +481,7 @@ int cmp_cache_name_compare(const void *a_, const void *b_);
 
 int add_files_to_cache(struct repository *repo, const char *prefix,
 		       const struct pathspec *pathspec, char *ps_matched,
-		       int include_sparse, int flags);
+		       int include_sparse, int flags, int ignored_too );
 
 void overlay_tree_on_index(struct index_state *istate,
 			   const char *tree_name, const char *prefix);
diff --git a/read-cache.c b/read-cache.c
index 06ad74db22..56a3ef424c 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -3880,9 +3880,12 @@ void overlay_tree_on_index(struct index_state *istate,
 
 struct update_callback_data {
 	struct index_state *index;
+	struct repository *repo;
+	struct pathspec *pathspec;
 	int include_sparse;
 	int flags;
 	int add_errors;
+	int ignored_too;
 };
 
 static int fix_unmerged_status(struct diff_filepair *p,
@@ -3945,7 +3948,7 @@ static void update_callback(struct diff_queue_struct *q,
 
 int add_files_to_cache(struct repository *repo, const char *prefix,
 		       const struct pathspec *pathspec, char *ps_matched,
-		       int include_sparse, int flags)
+		       int include_sparse, int flags, int ignored_too )
 {
 	struct update_callback_data data;
 	struct rev_info rev;
@@ -3954,6 +3957,9 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
 	data.index = repo->index;
 	data.include_sparse = include_sparse;
 	data.flags = flags;
+	data.repo = repo;
+	data.ignored_too = ignored_too;
+	data.pathspec = (struct pathspec *)pathspec;
 
 	repo_init_revisions(repo, &rev, prefix);
 	setup_revisions(0, NULL, &rev, NULL);
-- 
gitgitgadget


  reply	other threads:[~2025-10-18 20:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-18 20:07 [PATCH 0/5] git-add : Respect submodule ignore=all and only add changes with --force Claus Schneider via GitGitGadget
2025-10-18 20:07 ` Claus Schneider(Eficode) via GitGitGadget [this message]
2025-10-18 20:07 ` [PATCH 2/5] read-cache: let read-cache respect submodule ignore=all and --force Claus Schneider(Eficode) via GitGitGadget
2025-10-18 20:07 ` [PATCH 3/5] tests: add new t2206-add-submodule-ignored.sh to test ignore=all scenario Claus Schneider(Eficode) via GitGitGadget
2025-10-18 20:07 ` [PATCH 4/5] tests: fix existing tests when add an ignore=all submodule Claus Schneider(Eficode) via GitGitGadget
2025-10-18 20:07 ` [PATCH 5/5] Documentation: update add --force and submodule ignore=all config Claus Schneider(Eficode) via GitGitGadget
2025-10-19 15:34 ` [PATCH 0/5] git-add : Respect submodule ignore=all and only add changes with --force Phillip Wood
     [not found]   ` <CA+GP4bpu3SUycG35DU5+NSuiqtfYN9-R=7d01EFhexgGh4sRPg@mail.gmail.com>
2025-10-20  7:28     ` Claus Schneider
     [not found]   ` <CA+GP4bqb775U5oBbLZg1dou+THJOjTbFN+2Pq1cBPqq1SgbxHw@mail.gmail.com>
2025-10-24 13:55     ` Phillip Wood
2025-11-13 12:51       ` Claus Schneider
2025-11-13 18:10 ` [PATCH v2 " Claus Schneider via GitGitGadget
2025-11-13 18:10   ` [PATCH v2 1/5] read-cache: update add_files_to_cache take param include_ignored_submodules Claus Schneider(Eficode) via GitGitGadget
2025-11-13 22:07     ` Junio C Hamano
2025-11-13 18:10   ` [PATCH v2 2/5] read-cache: add/read-cache respect submodule ignore=all Claus Schneider(Eficode) via GitGitGadget
2025-11-13 18:10   ` [PATCH v2 3/5] tests: add new t2206-add-submodule-ignored.sh to test ignore=all scenario Claus Schneider(Eficode) via GitGitGadget
2025-11-13 18:10   ` [PATCH v2 4/5] tests: fix existing tests when add an ignore=all submodule Claus Schneider(Eficode) via GitGitGadget
2025-11-13 18:10   ` [PATCH v2 5/5] Documentation: add --include_ignored_submodules + ignore=all config Claus Schneider(Eficode) via GitGitGadget
2025-11-13 19:58   ` [PATCH v2 0/5] git-add : Respect submodule ignore=all and only add changes with --force Junio C Hamano
2025-11-14 13:53     ` Claus Schneider
2026-02-05  8:51       ` Claus Schneider
2026-02-05 22:05         ` Junio C Hamano
2026-01-14  7:47   ` [PATCH v3 0/5] git-add: Skip submodules with ignore=all unless --force and explicit path used Claus Schneider via GitGitGadget
2026-01-14  7:47     ` [PATCH v3 1/5] read-cache: update add_files_to_cache take param ignored_too Claus Schneider(Eficode) via GitGitGadget
2026-01-14  7:47     ` [PATCH v3 2/5] read-cache: submodule add need --force given ignore=all configuration Claus Schneider(Eficode) via GitGitGadget
2026-01-15 15:42       ` Kristoffer Haugsbakk
2026-01-16 16:07         ` Claus Schneider
2026-01-14  7:47     ` [PATCH v3 3/5] tests: t2206-add-submodule-ignored: ignore=all and add --force tests Claus Schneider(Eficode) via GitGitGadget
2026-01-14  7:47     ` [PATCH v3 4/5] tests: fix existing tests when add an ignore=all submodule Claus Schneider(Eficode) via GitGitGadget
2026-01-14  7:47     ` [PATCH v3 5/5] Documentation: update add --force option + ignore=all config Claus Schneider(Eficode) via GitGitGadget
2026-01-14 17:53       ` Ben Knoble
2026-01-16 15:35         ` Claus Schneider
2026-02-06 13:22     ` [PATCH v4 0/5] git-add: Skip submodules with ignore=all unless --force and explicit path used Claus Schneider via GitGitGadget
2026-02-06 13:22       ` [PATCH v4 1/5] read-cache: update add_files_to_cache take param ignored_too Claus Schneider(Eficode) via GitGitGadget
2026-02-09  0:11         ` Junio C Hamano
2026-02-09  0:11         ` Junio C Hamano
2026-02-06 13:22       ` [PATCH v4 2/5] read-cache: submodule add need --force given ignore=all configuration Claus Schneider(Eficode) via GitGitGadget
2026-02-06 13:22       ` [PATCH v4 3/5] tests: t2206-add-submodule-ignored: ignore=all and add --force tests Claus Schneider(Eficode) via GitGitGadget
2026-02-06 13:22       ` [PATCH v4 4/5] tests: fix existing tests when add an ignore=all submodule Claus Schneider(Eficode) via GitGitGadget
2026-02-06 13:23       ` [PATCH v4 5/5] Documentation: update add --force option + ignore=all config Claus Schneider(Eficode) via GitGitGadget
2026-03-04 14:01         ` Kristoffer Haugsbakk
2026-03-10 21:04           ` Claus Schneider
2026-03-10 21:10             ` Claus Schneider
2026-02-20 22:27       ` [PATCH v4 0/5] git-add: Skip submodules with ignore=all unless --force and explicit path used Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d98cca698ddb376831c0657eab2c488f9e7585bc.1760818039.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail$(echo .)com \
    --cc=avarab@gmail$(echo .)com \
    --cc=bmwill@google$(echo .)com \
    --cc=claus.schneider@eficode$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox