All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: szeder.dev@gmail.com, newren@gmail.com, jon@jonsimons.org,
	Derrick Stolee <dstolee@microsoft.com>,
	Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee <dstolee@microsoft.com>
Subject: [PATCH v3 2/2] sparse-checkout: document interactions with submodules
Date: Mon, 30 Dec 2019 15:33:13 +0000	[thread overview]
Message-ID: <74bbd0f84d5f0c9eb7cdbd6983cf5c82ac3c7d18.1577719993.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.500.v3.git.1577719993.gitgitgadget@gmail.com>

From: Derrick Stolee <dstolee@microsoft.com>

Using 'git submodule (init|deinit)' a user can select a subset of
submodules to populate. This behaves very similar to the sparse-checkout
feature, but those directories contain their own .git directory
including an object database and ref space. To have the sparse-checkout
file also determine if those files should exist would easily cause
problems. Therefore, keeping these features independent in this way
is the best way forward.

Also create a test that demonstrates this behavior to make sure
it doesn't change as the sparse-checkout feature evolves.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 Documentation/git-sparse-checkout.txt | 10 ++++++++++
 t/t1091-sparse-checkout-builtin.sh    | 28 +++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index 67be5247b9..3b341cf0fc 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -164,6 +164,16 @@ case-insensitive check. This corrects for case mismatched filenames in the
 'git sparse-checkout set' command to reflect the expected cone in the working
 directory.
 
+
+SUBMODULES
+----------
+
+If your repository contains one or more submodules, then those submodules will
+appear based on which you initialized with the `git submodule` command. If
+your sparse-checkout patterns exclude an initialized submodule, then that
+submodule will still appear in your working directory.
+
+
 SEE ALSO
 --------
 
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 37f6d8fa90..ff7f8f7a1f 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -340,4 +340,32 @@ test_expect_success 'cone mode: set with core.ignoreCase=true' '
 	test_cmp expect dir
 '
 
+test_expect_success 'interaction with submodules' '
+	git clone repo super &&
+	(
+		cd super &&
+		mkdir modules &&
+		git submodule add ../repo modules/child &&
+		git add . &&
+		git commit -m "add submodule" &&
+		git sparse-checkout init --cone &&
+		git sparse-checkout set folder1
+	) &&
+	list_files super >dir &&
+	cat >expect <<-\EOF &&
+		a
+		folder1
+		modules
+	EOF
+	test_cmp expect dir &&
+	list_files super/modules/child >dir &&
+	cat >expect <<-\EOF &&
+		a
+		deep
+		folder1
+		folder2
+	EOF
+	test_cmp expect dir
+'
+
 test_done
-- 
gitgitgadget

  parent reply	other threads:[~2019-12-30 15:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 20:49 [PATCH 0/1] sparse-checkout: list directories in cone mode Derrick Stolee via GitGitGadget
2019-12-26 20:49 ` [PATCH 1/1] sparse-checkout: list folders " Derrick Stolee via GitGitGadget
2019-12-26 21:17   ` Junio C Hamano
2019-12-27 14:05     ` Derrick Stolee
2019-12-27 15:52   ` Elijah Newren
2019-12-27 18:47 ` [PATCH v2 0/2] sparse-checkout: list directories " Derrick Stolee via GitGitGadget
2019-12-27 18:47   ` [PATCH v2 1/2] sparse-checkout: list folders " Derrick Stolee via GitGitGadget
2019-12-27 21:37     ` Elijah Newren
2019-12-27 18:47   ` [PATCH v2 2/2] sparse-checkout: document interactions with submodules Derrick Stolee via GitGitGadget
2019-12-27 20:20     ` Eric Sunshine
2019-12-30 13:11       ` Derrick Stolee
2019-12-27 21:46     ` Elijah Newren
2019-12-27 22:33       ` Junio C Hamano
2019-12-30 15:33   ` [PATCH v3 0/2] sparse-checkout: list directories in cone mode Derrick Stolee via GitGitGadget
2019-12-30 15:33     ` [PATCH v3 1/2] " Derrick Stolee via GitGitGadget
2019-12-30 15:33     ` Derrick Stolee via GitGitGadget [this message]
2019-12-30 17:18     ` [PATCH v3 0/2] " Elijah Newren
2019-12-27 21:47 ` [PATCH 0/1] " Elijah Newren

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=74bbd0f84d5f0c9eb7cdbd6983cf5c82ac3c7d18.1577719993.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jon@jonsimons.org \
    --cc=newren@gmail.com \
    --cc=szeder.dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.