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>,
"Phillip Wood" <phillip.wood123@gmail.com>,
"Claus Schneider" <claus.schneider@eficode.com>,
"Claus Schneider" <claus.schneider@eficode.com>,
"Claus Schneider(Eficode)" <claus.schneider@eficode.com>
Subject: [PATCH v2 2/5] read-cache: add/read-cache respect submodule ignore=all
Date: Thu, 13 Nov 2025 18:10:30 +0000 [thread overview]
Message-ID: <9ec79b9a116a1dda9fe7bd10d16c1faf77f778ed.1763057433.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1987.v2.git.1763057433.gitgitgadget@gmail.com>
From: "Claus Schneider(Eficode)" <claus.schneider@eficode.com>
Submodules configured with ignore=all are now skipped during add operations
unless overridden by --include-ignored-submodules and the submodule path is
explicitly specified.
A message is printed (like ignored files) guiding the user to use the
--include-ignored-submodules flag if the user has explicitely want to update
the submodule reference.
The reason for the change is support submodule branch tracking or
similar and git status state nothing and git add should not add either.
The workflow is more logic and similar to regular ignored files even
the submodule is already tracked.
The change opens up a lot of possibilities for submodules to be used
more freely and simular to the repo tool. A submodule can be added for many
more reason and loosely coupled dependencies to the super repo which often
gives the friction of handle the explicit commits and updates without
the need for tracking the submodule sha1 by sha1.
Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode.com>
---
read-cache.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index 32f32bdb4c..7b6d1b2914 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -48,6 +48,8 @@
#include "csum-file.h"
#include "promisor-remote.h"
#include "hook.h"
+#include "submodule.h"
+#include "submodule-config.h"
/* Mask for the name length in ce_flags in the on-disk index */
@@ -3956,7 +3958,7 @@ static void update_callback(struct diff_queue_struct *q,
}
if (pathspec_matches) {
if (data->include_ignored_submodules && data->include_ignored_submodules > 0) {
- trace_printf("Add ignored=all submodule due to --include_ignored_submodules: %s\n", path);
+ trace_printf("Add submodule due to --include_ignored_submodules: %s\n", path);
} else {
printf(_("Skipping submodule due to ignore=all: %s"), path);
printf(_("Use --include_ignored_submodules, if you really want to add them.") );
@@ -3964,7 +3966,7 @@ static void update_callback(struct diff_queue_struct *q,
}
} else {
/* No explicit pathspec match -> skip silently (or with trace). */
- trace_printf("pathspec does not match %s\n", path);
+ trace_printf("Pathspec to submodule does not match explicitly: %s\n", path);
continue;
}
}
@@ -3975,6 +3977,7 @@ static void update_callback(struct diff_queue_struct *q,
data->add_errors++;
}
break;
+ }
case DIFF_STATUS_DELETED:
if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
break;
--
gitgitgadget
next prev parent reply other threads:[~2025-11-13 18:10 UTC|newest]
Thread overview: 19+ 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 ` [PATCH 1/5] read-cache: update add_files_to_cache to take param ignored_too(--force) Claus Schneider(Eficode) via GitGitGadget
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 ` Claus Schneider(Eficode) via GitGitGadget [this message]
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
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=9ec79b9a116a1dda9fe7bd10d16c1faf77f778ed.1763057433.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=avarab@gmail.com \
--cc=bmwill@google.com \
--cc=claus.schneider@eficode.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood123@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).