From patchwork Tue Mar 8 07:39:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5102BC433EF for ; Tue, 8 Mar 2022 07:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344646AbiCHHky (ORCPT ); Tue, 8 Mar 2022 02:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237088AbiCHHkt (ORCPT ); Tue, 8 Mar 2022 02:40:49 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806A139838 for ; Mon, 7 Mar 2022 23:39:52 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id k24so17540598wrd.7 for ; Mon, 07 Mar 2022 23:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=ddKKUtypkHQnlEezFWPhcKPgt68JnCsvp2du9u1RLkI=; b=WOV7ycInDLrqlvkrv+whzPbS+EMe09YaoYkY035AiB3uz9Yw09k89CUkQT59FA6w8s Bo68Tberm5SoX8rv3luBGBfJA88hGvLrbzV7IXmZamzTWVFaUrCVhlcA9UYJTkADEmPZ RXw6yHMx48cwC+Bvk33zqZtNvKS6wIWDJ+nrPPjSt/1JIWBqkerSLhlrNDQX2Lt4EEe0 Z6wjGGON3HHQhi2lXP5NSLTEMRMriub0u4n/25OMLOBIYzWcn0S7sFn/tn+UCPKIkgVY bJY2GjSPUIM1yNFo+rdtrqpkHO1DmiTBuinDSPLDCRWMZtavaIalWdgzcAtdcx5Vua2Q TbJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=ddKKUtypkHQnlEezFWPhcKPgt68JnCsvp2du9u1RLkI=; b=m5++tUyDMmww+Ca93EV3L7NLSTgxPaOIcsumy9EbekrMtWb24wRLzdhpuIDntoncE4 KJXQH9fxCK3ri7oy7Lm9BRMuG9901Avs5BZiZi86wQMYN8BwYHIBDXSEBJoEvoaaiakQ uS9fszQqp4sKGmSjoXSxDmnxkiQgk4y3ZWV0mhZGDbO7sJRy9ncY+ZGrUVAYUi6PRcxC FeNRCVr9NH92kAKucs40B2WlvJSLc20C9AXHLHazp/1sHQqqXGoBOoTmMN173O1p9ru8 nu7jrWmuK1pYl0krZskozNAExdhZ50AwG3fyt5MnaVFwf1BCxzNns9VHos9x8q5pG/10 UC1A== X-Gm-Message-State: AOAM530Lu2kCjqH9VdHeIWuYPyXhvPMHU8uuQs9DSN58eiqXkNNcmL9R jv+7g7Ept7myv5HQllDCfuwCaR4lVM0= X-Google-Smtp-Source: ABdhPJxsN88jr4qIJVVOhZXTZrZWAP0ztjuGU4VInkRzvtZfPHlFbjNw9K2TExpHGhtSmEsgwT1ybA== X-Received: by 2002:a5d:4a0f:0:b0:1ed:d377:288a with SMTP id m15-20020a5d4a0f000000b001edd377288amr11080406wrq.3.1646725190833; Mon, 07 Mar 2022 23:39:50 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z5-20020a05600c0a0500b0037bb8df81a2sm1575906wmp.13.2022.03.07.23.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:50 -0800 (PST) Message-Id: <8c3e730e86ba3d453d8fad45ebed6be80190bde8.1646725188.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:40 +0000 Subject: [PATCH 1/9] tests: stop assuming --no-cone is the default mode for sparse-checkout Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Add an explicit --no-cone to several sparse-checkout invocations in preparation for changing the default to cone mode. Signed-off-by: Elijah Newren --- t/t1091-sparse-checkout-builtin.sh | 15 ++++++++------- t/t3602-rm-sparse-checkout.sh | 6 +++--- t/t3705-add-sparse-checkout.sh | 4 ++-- t/t6428-merge-conflicts-sparse.sh | 4 ++-- t/t7002-mv-sparse-checkout.sh | 2 +- t/t7012-skip-worktree-writing.sh | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh index 9a900310186..de1ec89007d 100755 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@ -72,7 +72,7 @@ test_expect_success 'git sparse-checkout list (populated)' ' ' test_expect_success 'git sparse-checkout init' ' - git -C repo sparse-checkout init && + git -C repo sparse-checkout init --no-cone && cat >expect <<-\EOF && /* !/*/ @@ -111,6 +111,7 @@ test_expect_success 'init with existing sparse-checkout' ' test_expect_success 'clone --sparse' ' git clone --sparse "file://$(pwd)/repo" clone && + git -C clone sparse-checkout reapply --no-cone && git -C clone sparse-checkout list >actual && cat >expect <<-\EOF && /* @@ -124,7 +125,7 @@ test_expect_success 'switching to cone mode with non-cone mode patterns' ' git init bad-patterns && ( cd bad-patterns && - git sparse-checkout init && + git sparse-checkout init --no-cone && git sparse-checkout add dir && git config --worktree core.sparseCheckoutCone true && test_must_fail git sparse-checkout add dir 2>err && @@ -402,7 +403,7 @@ test_expect_success 'revert to old sparse-checkout on empty update' ' git sparse-checkout set nothing 2>err && test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err && test_i18ngrep ! ".git/index.lock" err && - git sparse-checkout set file + git sparse-checkout set --no-cone file ) ' @@ -424,7 +425,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' git clone repo dirty && echo dirty >dirty/folder1/a && - git -C dirty sparse-checkout init 2>err && + git -C dirty sparse-checkout init --no-cone 2>err && test_i18ngrep "warning.*The following paths are not up to date" err && git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* 2>err && @@ -435,7 +436,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' test_must_be_empty err && git -C dirty reset --hard && - git -C dirty sparse-checkout init && + git -C dirty sparse-checkout init --no-cone && git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* && test_path_is_missing dirty/folder1/a && git -C dirty sparse-checkout disable && @@ -451,7 +452,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat EOF git -C unmerged update-index --index-info err && + git -C unmerged sparse-checkout init --no-cone 2>err && test_i18ngrep "warning.*The following paths are unmerged" err && git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* 2>err && @@ -462,7 +463,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat test_i18ngrep "warning.*The following paths are unmerged" err && git -C unmerged reset --hard && - git -C unmerged sparse-checkout init && + git -C unmerged sparse-checkout init --no-cone && git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* && git -C unmerged sparse-checkout disable ' diff --git a/t/t3602-rm-sparse-checkout.sh b/t/t3602-rm-sparse-checkout.sh index 034ec010910..08580fd3dcc 100755 --- a/t/t3602-rm-sparse-checkout.sh +++ b/t/t3602-rm-sparse-checkout.sh @@ -30,7 +30,7 @@ test_expect_success 'setup' " for opt in "" -f --dry-run do test_expect_success "rm${opt:+ $opt} does not remove sparse entries" ' - git sparse-checkout set a && + git sparse-checkout set --no-cone a && test_must_fail git rm $opt b 2>stderr && test_cmp b_error_and_hint stderr && git ls-files --error-unmatch b @@ -118,7 +118,7 @@ test_expect_success 'can remove files from non-sparse dir' ' test_commit w/f && test_commit x/y/f && - git sparse-checkout set w !/x y/ && + git sparse-checkout set --no-cone w !/x y/ && git rm w/f.t x/y/f.t 2>stderr && test_must_be_empty stderr ' @@ -128,7 +128,7 @@ test_expect_success 'refuse to remove non-skip-worktree file from sparse dir' ' git sparse-checkout disable && mkdir -p x/y/z && test_commit x/y/z/f && - git sparse-checkout set !/x y/ !x/y/z && + git sparse-checkout set --no-cone !/x y/ !x/y/z && git update-index --no-skip-worktree x/y/z/f.t && test_must_fail git rm x/y/z/f.t 2>stderr && diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh index 95609046c61..2bade9e804f 100755 --- a/t/t3705-add-sparse-checkout.sh +++ b/t/t3705-add-sparse-checkout.sh @@ -166,7 +166,7 @@ test_expect_success 'do not warn when pathspec matches dense entries' ' test_expect_success 'git add fails outside of sparse-checkout definition' ' test_when_finished git sparse-checkout disable && test_commit a && - git sparse-checkout init && + git sparse-checkout init --no-cone && git sparse-checkout set a && echo >>sparse_entry && @@ -208,7 +208,7 @@ test_expect_success 'add obeys advice.updateSparsePath' ' ' test_expect_success 'add allows sparse entries with --sparse' ' - git sparse-checkout set a && + git sparse-checkout set --no-cone a && echo modified >sparse_entry && test_must_fail git add sparse_entry && test_sparse_entry_unchanged && diff --git a/t/t6428-merge-conflicts-sparse.sh b/t/t6428-merge-conflicts-sparse.sh index 142c9aaabc5..064be1b629e 100755 --- a/t/t6428-merge-conflicts-sparse.sh +++ b/t/t6428-merge-conflicts-sparse.sh @@ -87,7 +87,7 @@ test_expect_success 'conflicting entries written to worktree even if sparse' ' test_path_is_file numerals && git sparse-checkout init && - git sparse-checkout set README && + git sparse-checkout set --no-cone README && test_path_is_file README && test_path_is_missing numerals && @@ -123,7 +123,7 @@ test_expect_success 'present-despite-SKIP_WORKTREE handled reasonably' ' test_path_is_file numerals && git sparse-checkout init && - git sparse-checkout set README && + git sparse-checkout set --no-cone README && test_path_is_file README && test_path_is_missing numerals && diff --git a/t/t7002-mv-sparse-checkout.sh b/t/t7002-mv-sparse-checkout.sh index 1d3d2aca21c..f0f7cbfcdb7 100755 --- a/t/t7002-mv-sparse-checkout.sh +++ b/t/t7002-mv-sparse-checkout.sh @@ -27,7 +27,7 @@ test_expect_success 'setup' " test_expect_success 'mv refuses to move sparse-to-sparse' ' test_when_finished rm -f e && git reset --hard && - git sparse-checkout set a && + git sparse-checkout set --no-cone a && touch b && test_must_fail git mv b e 2>stderr && cat sparse_error_header >expect && diff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh index cb9f1a6981e..cd5c20fe51b 100755 --- a/t/t7012-skip-worktree-writing.sh +++ b/t/t7012-skip-worktree-writing.sh @@ -151,7 +151,7 @@ test_expect_success 'stash restore in sparse checkout' ' git stash push && - git sparse-checkout set subdir && + git sparse-checkout set --no-cone subdir && # Ensure after sparse-checkout we only have expected files cat >expect <<-EOF && From patchwork Tue Mar 8 07:39:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A87EC433EF for ; Tue, 8 Mar 2022 07:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344649AbiCHHkx (ORCPT ); Tue, 8 Mar 2022 02:40:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344638AbiCHHku (ORCPT ); Tue, 8 Mar 2022 02:40:50 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963C939834 for ; Mon, 7 Mar 2022 23:39:53 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id l1-20020a05600c4f0100b00389645443d2so893620wmq.2 for ; Mon, 07 Mar 2022 23:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=N5BZ6LZpnTeW762/oRUvocKu3FJi2OO94uAAe3IQr7I=; b=eSgzPRwZnOlK4YjVucYzqGZ+2g0fXqxfaN3Sur3LfzTBrnhzkyURVl9Eyv6V6w/vU8 Ioul3j0dH2wT54gVtT7QQNG1sw6eqryblwp1sY9zInJw5Uy4LcwBpbpshmBixXcHE546 tt2Zpyd0WKaAo6X/tx3t98kH1C2iwf8R3ZKi3J+MQDtrr6MyYoeizfPy+NBwnJVP7+US WQfpYla5swxU1GZhiRTpDUTnZsaVTirj6hug5mToBbuMVXl5nd378470iXqjFFJr0y7V ZkJVLkyznwHGjExFay6aLlhHXdtkhThsxLLAZbB9+pnTyOjDYpNjJWLIf+0+L3Cv55pt Aj1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=N5BZ6LZpnTeW762/oRUvocKu3FJi2OO94uAAe3IQr7I=; b=KS6pXvMT0Q4uXS8juHXJpTkKI4ms3X0KHIcP1tjnxkTGlX8otxuPfjmpY2PFCG3H+6 e9VTGnVwy58uHkWV7IpOerMPsNqwq3Iv8g2Pw98RPLHDBzwVRSQiclNCayfyxsvFuGFx kQT16wOW84CPkPYM8gqoL9KjPEH/ovDyE1+UerFVm/jZC18+9Ihlms4HDU+6sY9IxMfu 4uvAUEIVGC9v6FFPbDTUSw5LhXR9akMZqBPzeq1LHHn9bOJfKdSYtuXl1FnMs7DOQ8PL Vb9I/tH28r7phkz4KjcHufBBc0ySvkPoiyqwTHXKdvLy1ar4mMkZwqULtfNFJaUy5hIw +PYg== X-Gm-Message-State: AOAM5307MaE0i7/SPJ0U8/DSDiLUamj3aFXLXaIRucMmfaTBbhTzBa7q njxWUEJtjM2cR7x+gOlScs7MmNdyWTk= X-Google-Smtp-Source: ABdhPJzWqGszyq7CZhVdEsDkHG+oQiN4CbiMe09eBduB/wY0V5dhIL9JkNEPRDdC6MNzq35hObnSHg== X-Received: by 2002:a05:600c:4e93:b0:389:bcc7:5554 with SMTP id f19-20020a05600c4e9300b00389bcc75554mr2265975wmq.77.1646725191943; Mon, 07 Mar 2022 23:39:51 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n15-20020a05600c4f8f00b003842f011bc5sm1446607wmq.2.2022.03.07.23.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:51 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:41 +0000 Subject: [PATCH 2/9] sparse-checkout: make --cone the default Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Make cone mode the default, and update the documentation accordingly. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 20 ++++++++++---------- builtin/sparse-checkout.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 88e55f432f3..4ef03120797 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -22,8 +22,8 @@ present, or undo and go back to having all tracked files present in the working copy. The subset of files is chosen by providing a list of directories in -cone mode (which is recommended), or by providing a list of patterns -in non-cone mode. +cone mode (the default), or by providing a list of patterns in +non-cone mode. When in a sparse-checkout, other Git commands behave a bit differently. For example, switching branches will not update paths outside the @@ -60,7 +60,7 @@ When the `--stdin` option is provided, the directories or patterns are read from standard in as a newline-delimited list instead of from the arguments. + -When `--cone` is passed or `core.sparseCheckoutCone` is enabled, the +When `--cone` is passed or `core.sparseCheckoutCone` is not false, the input list is considered a list of directories. This allows for better performance with a limited set of patterns (see 'CONE PATTERN SET' below). The input format matches the output of `git ls-tree @@ -68,10 +68,9 @@ SET' below). The input format matches the output of `git ls-tree double quote (") as C-style quoted strings. Note that the set command will write patterns to the sparse-checkout file to include all files contained in those directories (recursively) as well as files that are -siblings of ancestor directories. This may become the default in the -future; --no-cone can be passed to request non-cone mode. +siblings of ancestor directories. + -When `--no-cone` is passed or `core.sparseCheckoutCone` is not enabled, +When `--no-cone` is passed or `core.sparseCheckoutCone` is false, the input list is considered a list of patterns. This mode is harder to use and less performant, and is thus not recommended. See the "Sparse Checkout" section of linkgit:git-read-tree[1] and the "Pattern @@ -227,10 +226,11 @@ patterns. The resulting sparse-checkout file is now Here, order matters, so the negative patterns are overridden by the positive patterns that appear lower in the file. -If `core.sparseCheckoutCone=true`, then Git will parse the sparse-checkout file -expecting patterns of these types. Git will warn if the patterns do not match. -If the patterns do match the expected format, then Git will use faster hash- -based algorithms to compute inclusion in the sparse-checkout. +If `core.sparseCheckoutCone=true` (set by default or with an explicit +`--cone`), then Git will parse the sparse-checkout file expecting +patterns of these types. Git will warn if the patterns do not match. If +the patterns do match the expected format, then Git will use faster +hash-based algorithms to compute inclusion in the sparse-checkout. In the cone mode case, the `git sparse-checkout list` subcommand will list the directories that define the recursive patterns. For the example sparse-checkout diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 5518ed47f6c..61b7a7519bb 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -397,7 +397,7 @@ static int update_modes(int *cone_mode, int *sparse_index) /* Set cone/non-cone mode appropriately */ core_apply_sparse_checkout = 1; - if (*cone_mode == 1) { + if (*cone_mode == 1 || *cone_mode == -1) { mode = MODE_CONE_PATTERNS; core_sparse_checkout_cone = 1; } else { From patchwork Tue Mar 8 07:39:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74126C433F5 for ; Tue, 8 Mar 2022 07:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344644AbiCHHkv (ORCPT ); Tue, 8 Mar 2022 02:40:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344639AbiCHHku (ORCPT ); Tue, 8 Mar 2022 02:40:50 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A3C3DDE5 for ; Mon, 7 Mar 2022 23:39:54 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id h15so2642933wrc.6 for ; Mon, 07 Mar 2022 23:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=g26RlMPpyFcmK3jXAO/KptnUTUYMnuE3CrJpnlUgMb8=; b=d9m4dk6qdvhyFVcNm3rVHpjozO8TtH5cS2RloK1mr7kPhyWI1oY2NcKoHqgBJxL2g9 cyf4gxdvOBwPOboQdIcBT87+wI3YjRVvxiXdHqiiNWkJmvgiVg++Lub+ffMjORKsaIfd usVjPcqo5Yq/EKYaETZiyZgLaWP+UdxaBzkMtgqCpDei485NHHssdRLFtSpdx6cjtBnj pDnmjlli8QWAZH/oOe4bxI+L6gSSk8mJGc8/gakMyuLyFleHotv415LUQJvoNS6Iqiyy zw3BIAhEMFvkFYtesFXcdg6TLdXneuAm6+pR9bxKn25ZiRgP+ZMjx/exy8cb8ArhooOc Jl/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=g26RlMPpyFcmK3jXAO/KptnUTUYMnuE3CrJpnlUgMb8=; b=HquhlyP8AzRVmgXf/G5/Pcevb+4PQvV9Xg0QssTfgqhQ8Ug1+nAsN2BoEz6pvlN0rB AnbqbffDQfxr3thL8sPyeAJ31jA1+sfCRuAAWHZKZ3shDLD8KQ8b35JaC7Et2kPWeUim 8pKxpftK59LcDh0ovrZwWKioSjAtDadoTtE6JbOQot3Qsl1SK6fzljbjRpmaJmWAL0zb ne5Vy+TMCMImuq+Zhl+DO8ilTycVaC3o2rq8HuTxLuYmv6ghWJFZkinylVu1lcTuoNKF JGV/Ry0Uak2WQC0riuwdT6DdRJJkjsq5dCuzoRNybsTH0VunhC00Qr2AdlMn1KnbrlJ8 u9/A== X-Gm-Message-State: AOAM5324oq/3gY4veoKG50J932dXESfrdyJ8I5aDxcDjv71Ii24yREcF BF1IOOc9B6c87vwYhZsSTvlvIr/vUmM= X-Google-Smtp-Source: ABdhPJwfg+BUkvAKjduCAb3G9vPupfBapLGFRZQ/dH0X6bFGpf84RjFsefcuuk2ZlrVcgu1crV2w2Q== X-Received: by 2002:a5d:64a9:0:b0:1f1:f6ea:f90 with SMTP id m9-20020a5d64a9000000b001f1f6ea0f90mr7248631wrp.145.1646725192888; Mon, 07 Mar 2022 23:39:52 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y10-20020adfee0a000000b001f0639001ffsm19985644wrn.9.2022.03.07.23.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:52 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:42 +0000 Subject: [PATCH 3/9] git-sparse-checkout.txt: wording updates for the cone mode default Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Now that cone mode is the default, we'd like to focus on the arguments to set/add being directories rather than patterns, and it probably makes sense to provide an earlier heads up that files from leading directories get included as well. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 31 +++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 4ef03120797..42a984306bb 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -44,9 +44,9 @@ COMMANDS Enable the necessary sparse-checkout config settings (`core.sparseCheckout`, `core.sparseCheckoutCone`, and `index.sparse`) if they are not already set to the desired values, - and write a set of patterns to the sparse-checkout file from the - list of arguments following the 'set' subcommand. Update the - working directory to match the new patterns. + populate the sparse-checkout file from the list of arguments + following the 'set' subcommand, and update the working directory to + match. + To ensure that adjusting the sparse-checkout settings within a worktree does not alter the sparse-checkout settings in other worktrees, the 'set' @@ -60,15 +60,15 @@ When the `--stdin` option is provided, the directories or patterns are read from standard in as a newline-delimited list instead of from the arguments. + -When `--cone` is passed or `core.sparseCheckoutCone` is not false, the -input list is considered a list of directories. This allows for -better performance with a limited set of patterns (see 'CONE PATTERN -SET' below). The input format matches the output of `git ls-tree ---name-only`. This includes interpreting pathnames that begin with a -double quote (") as C-style quoted strings. Note that the set command -will write patterns to the sparse-checkout file to include all files -contained in those directories (recursively) as well as files that are -siblings of ancestor directories. +By default, the input list is considered a list of directories, matching +the output of `git ls-tree -d --name-only`. This includes interpreting +pathnames that begin with a double quote (") as C-style quoted strings. +Note that all files under the specified directories (at any depth) will +be included in the sparse checkout, as well as files that are siblings +of either the given directory or any of its ancestors (see 'CONE PATTERN +SET' below for more details). In the past, this was not the default, +and `--cone` needed to be specified or `core.sparseCheckoutCone` needed +to be enabled. + When `--no-cone` is passed or `core.sparseCheckoutCone` is false, the input list is considered a list of patterns. This mode is harder @@ -208,10 +208,9 @@ the following patterns: This says "include everything in root, but nothing two levels below root." When in cone mode, the `git sparse-checkout set` subcommand takes a list of -directories instead of a list of sparse-checkout patterns. In this mode, -the command `git sparse-checkout set A/B/C` sets the directory `A/B/C` as -a recursive pattern, the directories `A` and `A/B` are added as parent -patterns. The resulting sparse-checkout file is now +directories. In this mode, the command `git sparse-checkout set A/B/C` sets +the directory `A/B/C` as a recursive pattern, the directories `A` and `A/B` +are added as parent patterns. The resulting sparse-checkout file is now ---------------- /* From patchwork Tue Mar 8 07:39:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD41AC433EF for ; Tue, 8 Mar 2022 07:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344660AbiCHHk4 (ORCPT ); Tue, 8 Mar 2022 02:40:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344642AbiCHHkv (ORCPT ); Tue, 8 Mar 2022 02:40:51 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5434D3DDEC for ; Mon, 7 Mar 2022 23:39:55 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id v2-20020a7bcb42000000b0037b9d960079so868647wmj.0 for ; Mon, 07 Mar 2022 23:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=iNfUFTserT6zohLzadoxjW83Qh8oDm1GULCxdd09RBA=; b=AePT9AJ0teTj8XyPPTBMmqO/gMFtbNUIX//gEKgc7gzPRjkH0kiMh+alQ9Uaq9fvDl eo6ctsQ5zSq1l4gAYEnnMxhSC4BuFpokeS1v0u8I5Oyh3mupl2S1WJ+JKv/j7GhswWXU QoofJPOwdQ2XWAtaffLCjP1yvvJ4H8i3zsxF0gwWL2GhGqKyeyIMODs/G0IRVSaMT8BQ CDGQOaDq2xb2baJqXz3Nipy7z60ChdSWQHTOfZa2XtEYOrHstvrpQHNJZkp7Ys6wDijL x9dJnfnQauHYdwSWo88/pM06pKB4o1hgr1xtCoGmHHp6RNXZWufPPl6l6Hz0HHjKXtO8 /Q2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=iNfUFTserT6zohLzadoxjW83Qh8oDm1GULCxdd09RBA=; b=JIsNMUnpjrpu5sQpKUwwi/HWVLY1ba3jUG0J9DEklocuHtACXeYU/NjgAJe4ael+5M DljOU24XLvp5JGGXiKT3vhNWcZh5VG6NCOeqbvirAOTXEqOVuD0zsK0zpXMsgTA8dWfq YusMzj7frQErFY5WvcTUoSPACVnRwWB+WNxFUHE46HxXs9P3UGrzqIBrmwRwypLjPzn1 fHkX+7/WQI51ZWGrYEwEWuLYfcQ+Ne57cX5iOcw9GSu72BxXaphSvw/jEKbQBVRDsn4j 5eByhhr4Zwd1ZkiHotr9PKrCm1LXhK2XJ88JfCPOd4hOhfNlfxfXSJT9hkf4PDtEv3PP fCyQ== X-Gm-Message-State: AOAM530MahV+g/iihLVLTXTtF6cV+l7jix+Sir469e/w0qqh5iY5ERjW 27PRHE4DxYgIG6GtqyzbO06/dfsoj9U= X-Google-Smtp-Source: ABdhPJzYHyRJ5HDHFUxzrKT4psWAcS+u4GCDerad7ERs4EJzYZas1hBggSyZM5agWOH5WG0J1ydLew== X-Received: by 2002:a05:600c:3544:b0:389:bcb8:cc6e with SMTP id i4-20020a05600c354400b00389bcb8cc6emr2345796wmq.194.1646725193747; Mon, 07 Mar 2022 23:39:53 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id bg20-20020a05600c3c9400b0037fa5c422c8sm1449729wmb.48.2022.03.07.23.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:53 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:43 +0000 Subject: [PATCH 4/9] git-sparse-checkout.txt: update docs for deprecation of 'init' Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren The 'init' subcommand of sparse-checkout was deprecated in ba2f3f58ac ("git-sparse-checkout.txt: update to document init/set/reapply changes", 2021-12-14), but a couple places in the manual still assumed it was the primary way to use sparse-checkout. Correct them. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 42a984306bb..b9e44e3dd4c 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -70,11 +70,11 @@ SET' below for more details). In the past, this was not the default, and `--cone` needed to be specified or `core.sparseCheckoutCone` needed to be enabled. + -When `--no-cone` is passed or `core.sparseCheckoutCone` is false, -the input list is considered a list of patterns. This mode is harder -to use and less performant, and is thus not recommended. See the -"Sparse Checkout" section of linkgit:git-read-tree[1] and the "Pattern -Set" sections below for more details. +When `--no-cone` is passed, the input list is considered a list of +patterns. This mode is harder to use and less performant, and is thus +not recommended. See the "Sparse Checkout" section of +linkgit:git-read-tree[1] and the "Pattern Set" sections below for more +details. + Use the `--[no-]sparse-index` option to use a sparse index (the default is to not use it). A sparse index reduces the size of the @@ -196,9 +196,9 @@ In addition to the above two patterns, we also expect that all files in the root directory are included. If a recursive pattern is added, then all leading directories are added as parent patterns. -By default, when running `git sparse-checkout init`, the root directory is -added as a parent pattern. At this point, the sparse-checkout file contains -the following patterns: +By default, when running `git sparse-checkout set` with no directories +specified, the root directory is added as a parent pattern. At this +point, the sparse-checkout file contains the following patterns: ---------------- /* From patchwork Tue Mar 8 07:39:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B72B4C433FE for ; Tue, 8 Mar 2022 07:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344663AbiCHHk6 (ORCPT ); Tue, 8 Mar 2022 02:40:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344647AbiCHHkw (ORCPT ); Tue, 8 Mar 2022 02:40:52 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3B239834 for ; Mon, 7 Mar 2022 23:39:56 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id n31-20020a05600c3b9f00b003898fc06f1eso847292wms.1 for ; Mon, 07 Mar 2022 23:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=LBs+toRKrNAeFvILpMVU2ojoAq4HAqoAo1bWvbw2bbg=; b=b7lrPVGbk4U0+qFuy2X0smtsy82TjaHrw9fIp1cIUX+n+DQHFxAU7MOrXlG1cEZ7HJ EHfin/zPDcqa+9H0NMHem7NlGrmZst+sD6YuxKDWiGRnX+adBrx6mMUinPSfmZDb8fFg ui762MBUCwwuoB+QgoVAxcN3cEFgSWw5d8M9iBe/NtoHioLLmjndZSr3Gbt9wZ5QeKiV X7/j/kd2Zmcft8c3aZlT3MXRk/QntvmMqnX+iXeXUcBvA9OfEQV+gdR+xKZcw/hr7KFT 9KIdoB1Hnxud5H+yyTVhdd1KYqHFKDjix+/VcHyNxV8V/9XLT+tZdieckIo8gyyUltMl fCBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=LBs+toRKrNAeFvILpMVU2ojoAq4HAqoAo1bWvbw2bbg=; b=Eq1XYMvM009kAcdWizumo2qo45FPl3Ijq4V7uZWQDCuhGFHJHukShHVZl6himcvKdp CHWLHya51Ozf3ZfVdQSySmx5KvXcN0F/v6kl6kr1rKaJwPYVCpNj5xv3LG9bCnBUHiS1 cSHMJiP3AljiB5zTRDzrDtuupPHM9BLTfkfuASaZyRgM3MUOOi8AJLKnBdaY/icZwdok utujrKFuCFZSJSEJ3NftZupv50Pzd1uNO1h66Tmnip/C/AZDofNahCCjbnmjnvfQErnP axJSTdvaNWcDsXrewTYst+73Af1niT05PPQgJ6a9TYfdENP/6ntsM2ePhn3N34BUQJXd 2p9w== X-Gm-Message-State: AOAM5306BJh+bg9z/L/P/eUDhOBIeaGQJQ+uDgh3F+xsih1NqAntkeV/ MTflrqsXRLE4d27BmtXvOfcpU7coxoc= X-Google-Smtp-Source: ABdhPJwsBUg24Y6wDP2bxOhwNpWQ0+mzTQB5VC2eenZxAG9wFnO/BKk7f1FFOKLc9+lDIDQ4gJKBhA== X-Received: by 2002:a05:600c:2219:b0:389:bc8b:ac48 with SMTP id z25-20020a05600c221900b00389bc8bac48mr2346856wml.14.1646725194726; Mon, 07 Mar 2022 23:39:54 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b10-20020a05600003ca00b001f1f9a83123sm3978348wrg.103.2022.03.07.23.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:54 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:44 +0000 Subject: [PATCH 5/9] git-sparse-checkout.txt: shuffle some sections and mark as internal Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren With cone mode as the default, it makes sense to discuss it before non-cone mode. Also, the new default means we can just use directories in most cases and users do not need to understand patterns or their meanings. Let's take advantage of this to mark several sections as "INTERNALS", notifying the user that they do not need to know all those details in order to make use of the sparse-checkout command. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index b9e44e3dd4c..883b7f4c44f 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -136,8 +136,8 @@ paths to pass to a subsequent 'set' or 'add' command. However, the disable command, so the easy restore of calling a plain `init` decreased in utility. -SPARSE CHECKOUT ---------------- +INTERNALS -- SPARSE CHECKOUT +---------------------------- "Sparse checkout" allows populating the working directory sparsely. It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell Git @@ -161,24 +161,8 @@ To repopulate the working directory with all files, use the `git sparse-checkout disable` command. -FULL PATTERN SET ----------------- - -By default, the sparse-checkout file uses the same syntax as `.gitignore` -files. - -While `$GIT_DIR/info/sparse-checkout` is usually used to specify what -files are included, you can also specify what files are _not_ included, -using negative patterns. For example, to remove the file `unwanted`: - ----------------- -/* -!unwanted ----------------- - - -CONE PATTERN SET ----------------- +INTERNALS -- CONE PATTERN SET +----------------------------- The full pattern set allows for arbitrary pattern matches and complicated inclusion/exclusion rules. These can result in O(N*M) pattern matches when @@ -256,8 +240,24 @@ use `git add` and `git commit` to store them, then remove any remaining files manually to ensure Git can behave optimally. -SUBMODULES ----------- +INTERNALS -- FULL PATTERN SET +----------------------------- + +By default, the sparse-checkout file uses the same syntax as `.gitignore` +files. + +While `$GIT_DIR/info/sparse-checkout` is usually used to specify what +files are included, you can also specify what files are _not_ included, +using negative patterns. For example, to remove the file `unwanted`: + +---------------- +/* +!unwanted +---------------- + + +INTERNALS -- SUBMODULES +----------------------- If your repository contains one or more submodules, then submodules are populated based on interactions with the `git submodule` command. From patchwork Tue Mar 8 07:39:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8B36C433F5 for ; Tue, 8 Mar 2022 07:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344665AbiCHHlB (ORCPT ); Tue, 8 Mar 2022 02:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344650AbiCHHkx (ORCPT ); Tue, 8 Mar 2022 02:40:53 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 441683DDEC for ; Mon, 7 Mar 2022 23:39:57 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id u1so26967630wrg.11 for ; Mon, 07 Mar 2022 23:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=PcEhBMfiRsbLFIkiYM4ha4Qn6/cpSDgGqF0zPHthGdk=; b=WU5OGn1O1VMyF4Jnoy4We2+mbvrdeHY88ClIT6vXP3aS9dVZKwkbUAZ358gN0napDJ RuhjfwA0EMdrmn1Y7I0DaM19oKXDQXyxY+Nvu0rjTvy6qQL4TuiCUX3ZHDi/AowPOmUO eS6tw7NwshiPgiaKuj5X40mkfGqYJTKOMpYIU57vzPFo74BXIQgtw5Ap+AzqthJMbycH /X/5fZiBQyrBD6Jo9QgouPU3EcSTSnLApjsE+eZmGsbrexEBVJvKD/yzsI7hwO9TMKW1 BJnTrK4yn3N5c59mp+nRmybeC40zT9WFr5QRFqOOqgtfIONlo7TTm/DFNHJoqnlnTnMw 7Akg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=PcEhBMfiRsbLFIkiYM4ha4Qn6/cpSDgGqF0zPHthGdk=; b=IQ2kJ3IR11mTJAJq6UHAXcov4LLnMS1+8OYK5sogiVY/Wf9SIhpPGuM2NFmlkSuwow fR67pZcaQG4AovcKRclrh+HVg652ST9rK/B5kASfFgOT749yskn3ZOjTlRFvMth/uomu BcbFys7h+QFbfTpwYmNVay2wDMqHZRqbG85EBUlNNdRJUrD4+iCMcr50uNQfcJAzQEl+ A5J7X7OBzeMBWUWJ9FYQSxdJ9lGVJKFGYtp1zmUDO0r1rJTsuJuyFeWGia20k8SW5mJO a8lQXGTpxB8y/Csxs807BKKwlVX7+Rq0M3cYVBeyigxX1QhQHyRUVTmFX5EkClBYsLll JJkg== X-Gm-Message-State: AOAM5315kCys9lZYf+M7rjQ1XfY+Tg4b0o8AKd1PP+8d1jNI3P2lA94l Uu/cOB4ofpQmFzcbTOQFHgoTqPge0OY= X-Google-Smtp-Source: ABdhPJy1Yr6gBEEM6/eIixPUvRi1/y4Qff1P3D8/Xi2rAVKwvbXXJQp4vxFSe/xQRKmx2QUA4Mo9Rg== X-Received: by 2002:a05:6000:1044:b0:1eb:f72c:7f25 with SMTP id c4-20020a056000104400b001ebf72c7f25mr10858631wrx.155.1646725195663; Mon, 07 Mar 2022 23:39:55 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f8-20020adfb608000000b0020229d72a4esm1733924wre.38.2022.03.07.23.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:55 -0800 (PST) Message-Id: <3265f41bcab7202991da5a7a160a85820fbff0c4.1646725188.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:45 +0000 Subject: [PATCH 6/9] git-sparse-checkout.txt: add a new EXAMPLES section Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Since many users like to learn from examples, provide a section in the manual with example commands that would be used and a brief explanation of what each does. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 42 +++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 883b7f4c44f..2cfb1d8f599 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -136,6 +136,42 @@ paths to pass to a subsequent 'set' or 'add' command. However, the disable command, so the easy restore of calling a plain `init` decreased in utility. +EXAMPLES +-------- +`git sparse-checkout set MY/DIR1 SUB/DIR2`:: + + Change to a sparse checkout with all files (at any depth) under + MY/DIR1/ and SUB/DIR2/ present in the working copy (plus all + files immediately under MY/ and SUB/ and the toplevel + directory). If already in a sparse checkout, change which files + are present in the working copy to this new selection. Note + that this command will also delete all ignored files in any + directory that no longer has either tracked or + non-ignored-untracked files present. + +`git sparse-checkout disable`:: + + Repopulate the working directory with all files, disabling sparse + checkouts. + +`git sparse-checkout add SOME/DIR/ECTORY`:: + + Add all files under SOME/DIR/ECTORY/ (at any depth) to the + sparse checkout, as well as all files immediately under + SOME/DIR/ and immediately under SOME/. Must already be in a + sparse checkout before using this command. + +`git sparse-checkout reapply`:: + + It is possible for commands to update the working tree in a way + that does not respect the selected sparsity directories, either + because of special cases (such as hitting conflicts when + merging/rebasing), or because some commands didn't fully support + sparse checkouts (e.g. the old `recursive` merge backend had + only limited support). This command reapplies the existing + sparse directory specifications to make the working directory + match. + INTERNALS -- SPARSE CHECKOUT ---------------------------- @@ -154,12 +190,6 @@ directory, it updates the skip-worktree bits in the index based on this file. The files matching the patterns in the file will appear in the working directory, and the rest will not. -To enable the sparse-checkout feature, run `git sparse-checkout set` to -set the patterns you want to use. - -To repopulate the working directory with all files, use the -`git sparse-checkout disable` command. - INTERNALS -- CONE PATTERN SET ----------------------------- From patchwork Tue Mar 8 07:39:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB501C433EF for ; Tue, 8 Mar 2022 07:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344667AbiCHHlC (ORCPT ); Tue, 8 Mar 2022 02:41:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344638AbiCHHky (ORCPT ); Tue, 8 Mar 2022 02:40:54 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47C7E3DDFB for ; Mon, 7 Mar 2022 23:39:58 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id v2-20020a7bcb42000000b0037b9d960079so868707wmj.0 for ; Mon, 07 Mar 2022 23:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=gsuKuXVMAafwFyt95VXG+6VfrukFCSpgnCFPbj6/MgI=; b=LBE0oX/ubeJGlnoq0QmRUfRL+rfSC2UrYD+PS8jqJgeyoCRt+DF/ki3ior4q1ILhTx o2A+WZBd9p1bFx4H6zPcb5/Pv7QzdVGQAqf/uAxX+ilSD12tcbgvZrcAohqS1hooO5tv ZpsgX1OhDqhuxaS9CwTnQyyUgXxK139tczFCwTgbzd0FnBJFALqGGwlxrgv7Tjzqsqce /u8CAl0xHs5/kk6Ry/54494iHn1/vCUglfBsNIDWOP7ky5sBdAMNvvDGHy5RFoksIhOh ELSneumx/6IDYxxoCHsZYSgiYfM5InBjUAixXQu5rb8mQOLEMjgQ5grwaCGjXyTDHiP7 jqJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=gsuKuXVMAafwFyt95VXG+6VfrukFCSpgnCFPbj6/MgI=; b=jymGwpJmv0BjrZN8aaA/LiH9RJlT/dpAsGUPj8MshnSYDZSYpRdzgLxzzTpApf7MWQ QoIlaHWIh2LFT2zqOEbaMpJZpeBGMTjB8NMKMfTZbI7dwcqrw5mZgm6IVgK8nINTNsRq WPkp64GMueDSKetCjY7+RA1i+magwfqY3TF1PJmmwKOvEw9HOOq+8Ke2ycnT6XTH+tOB Z6CJGlL3NaElWQRHEajxnqzBpuCfDM6wZXSpdcoeRopZyUSz+T6gVmaSkSMELGLfYaBS MlmKOw6diR3j91/0jAvShg9q2nA3cOPpP/QRPh/vAr6x2veEPszNta0+PheAO8M/u9l6 ugeQ== X-Gm-Message-State: AOAM5320CkTW0KsH6X5sEKP3yf3+4Hm13XOvPzsZkDtL0uzjJzit851c AupK+FYB3F9FV685ReutD08bkyjJ8ko= X-Google-Smtp-Source: ABdhPJw+S4FgoAdR7DZeBulOy1aFN2LgAw3ucmR6tKKxRz4eD4XjCbxy6t00UXwdPHXauRw0b/2RjQ== X-Received: by 2002:a1c:6a01:0:b0:37f:1b18:6b17 with SMTP id f1-20020a1c6a01000000b0037f1b186b17mr2313344wmc.146.1646725196576; Mon, 07 Mar 2022 23:39:56 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b3-20020a5d4d83000000b001f1d72a6f97sm8799207wru.50.2022.03.07.23.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:56 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:46 +0000 Subject: [PATCH 7/9] git-sparse-checkout.txt: flesh out non-cone mode pattern discussion a bit Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 2cfb1d8f599..35e4e2d809e 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -273,12 +273,23 @@ manually to ensure Git can behave optimally. INTERNALS -- FULL PATTERN SET ----------------------------- -By default, the sparse-checkout file uses the same syntax as `.gitignore` -files. - -While `$GIT_DIR/info/sparse-checkout` is usually used to specify what -files are included, you can also specify what files are _not_ included, -using negative patterns. For example, to remove the file `unwanted`: +As noted above, the sparse-checkout file uses the same syntax as +`.gitignore` files; see linkgit:gitignore[5] for details. Here, +though, the patterns are usually being used to select which files to +include rather than which files to exclude. (However, it can get a +bit confusing since gitignore-style patterns have negations defined by +patterns which begin with a '!', so you can also select files to _not_ +include.) + +For example, to select everything, and then to remove the file +`unwanted` (so that every file will appear in your working tree except +the file named `unwanted`): + + git sparse-checkout set --no-cone '/*' '!unwanted' + +These patterns are just placed into the +`$GIT_DIR/info/sparse-checkout` as-is, so the contents of that file +at this point would be ---------------- /* From patchwork Tue Mar 8 07:39:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7462C433EF for ; Tue, 8 Mar 2022 07:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344669AbiCHHlD (ORCPT ); Tue, 8 Mar 2022 02:41:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344652AbiCHHkz (ORCPT ); Tue, 8 Mar 2022 02:40:55 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA8A3DDE5 for ; Mon, 7 Mar 2022 23:39:59 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id h15so2643225wrc.6 for ; Mon, 07 Mar 2022 23:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=DyI06a7wt/jqpClfvebBRaw5+VFsEvpBA/RH2pk/6z8=; b=f6xMLMnaQwk51wsey8mzl398um8oEpd2c5e3WmCI3cQg3hztpqVUvBVVpqhi12Xb1W lUFLwXCuSfCwDnRbZv2Css3cCSKjH8/lFwcvOGyYvVB9NYo8rc+MLuqhhUbaAi3y4K/w JyzM8j6YvCJjYtaJ0gxRrhgwYJJdjRnpPRlmUVno9QhIT4YIKhNXTwkp9NlG3Edvxq5i csXZ4gKwUcJnfee6VmX4z+8p8cbKwAErmtu9mk+tOZkWAXXjHlc2VohbKcN8cxuUaRqy oBeL/DWI4cte7iBXlCDsvq8Y3AMM69USfIRwECd8mSVjZPMCrCKZmsw+fK5P1xBWKySi qDJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=DyI06a7wt/jqpClfvebBRaw5+VFsEvpBA/RH2pk/6z8=; b=u/Hsz5nnLb4j1GR6Y9OSMey4POu1h1CYbDRnO/gSjRoCe+/OKPT2uJf1Faz19O8OtQ vY5IWaOQPBTJVrQTYPaw53WwK9lnlmbT5UO6goZyIBVbWf4ZMyaClqS+5wiW+Ti1oaBz cksPOiLEVg57sBOBOBgFfefP5LDTHfPZGqC1++wHzA2OH+FHt6QjVUrE2jsn8dbzOuiG DzGYs3cJsJTQmmXPAtb1KFljKsSzmRx5/12wh/xv1fopbxqSi5i/oR8/dFFkaArjCi7u tYBNg6l5qTLxgke0eETZeIERjN2yRl+i7SRq6HZZ1DtowOt0Hekobiut2Q6BktG1psAQ ajqA== X-Gm-Message-State: AOAM533y94czrjhYJC8QKsjdw1bS4oaQkof/k4dpTBU1ZXdEm2u8pyJI uQ2WY+QA8WceNg9qCuH+/cWRHjm/+Nw= X-Google-Smtp-Source: ABdhPJwz/2D5LF+fawpvdJbiEOZ4sVr3y+1WhYa9NG1WVQuwfAdrG2uQ1y7gGerTzQNmmaR12Wtdyg== X-Received: by 2002:a05:6000:1d83:b0:1ef:f98a:5406 with SMTP id bk3-20020a0560001d8300b001eff98a5406mr11638413wrb.8.1646725197604; Mon, 07 Mar 2022 23:39:57 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r1-20020a5d4941000000b001ed89dcacbbsm13087343wrs.23.2022.03.07.23.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:57 -0800 (PST) Message-Id: <3e35d62c5eefe5ef272cf0b3cbd10d94e6bbabd2.1646725188.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:47 +0000 Subject: [PATCH 8/9] git-sparse-checkout.txt: mark non-cone mode as deprecated Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren While we have no current plans to actually remove --no-cone mode, we think users would be better off not using it. Update the documentation accordingly, including explaining why we think non-cone mode is problematic for users. Signed-off-by: Elijah Newren --- Documentation/git-sparse-checkout.txt | 86 +++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 4 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 35e4e2d809e..11792187224 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -71,10 +71,13 @@ and `--cone` needed to be specified or `core.sparseCheckoutCone` needed to be enabled. + When `--no-cone` is passed, the input list is considered a list of -patterns. This mode is harder to use and less performant, and is thus -not recommended. See the "Sparse Checkout" section of -linkgit:git-read-tree[1] and the "Pattern Set" sections below for more -details. +patterns. This mode is harder to use, and unless you can keep the +number of patterns small, its design also scales poorly. It used to be +the default mode, but we do not recommend using it. It does not work +with the `--sparse-index` option, and will likely be incompatible with +other new features as they are added. See the "Non-cone Problems" +section below and the "Sparse Checkout" section of +linkgit:git-read-tree[1] for more details. + Use the `--[no-]sparse-index` option to use a sparse index (the default is to not use it). A sparse index reduces the size of the @@ -190,6 +193,81 @@ directory, it updates the skip-worktree bits in the index based on this file. The files matching the patterns in the file will appear in the working directory, and the rest will not. +INTERNALS -- NON-CONE PROBLEMS +------------------------------ + +The `$GIT_DIR/info/sparse-checkout` file populated by the `set` and +`add` subcommands is defined to be a bunch of patterns (one per line) +using the same syntax as `.gitignore` files. In cone mode, these +patterns are restricted to matching directories (and users only ever +need supply or see directory names), while in non-cone mode any +gitignore-style pattern is permitted. Using the full gitignore-style +patterns in non-cone mode has a number of shortcomings: + + * Fundamentally, it makes various worktree-updating processes (pull, + merge, rebase, switch, reset, checkout, etc.) require O(N*M) pattern + matches, where N is the number of patterns and M is the number of + paths in the index. This scales poorly. + + * Avoiding the scaling issue has to be done via limiting the number + of patterns via specifying leading directory name or glob. + + * Passing globs on the command line is error-prone as users may + forget to quote the glob, causing the shell to expand it into all + matching files and pass them all individually along to + sparse-checkout set/add. This both exacerbates the scaling + problem, and hardcodes the list of selected files to those which + were present at the time the initial set/add subcommand was run + (and thus ignoring other files matching the same glob which come + into the working tree after switching branches or pulling down + updates). + + * It uses "ignore"/"exclude" syntax for selecting what to "include", + which periodically causes confusion. + + * It introduces inconsistencies in the Git command line, since other + commands use pathspecs, but sparse-checkout (in non-cone mode) uses + gitignore patterns. + + * It has edge cases where the "right" behavior is unclear. Two examples: + + First, two users are in a subdirectory, and the first runs + git sparse-checkout set '/toplevel-dir/*.c' + while the second runs + git sparse-checkout set relative-dir + Should those arguments be transliterated into + current/subdirectory/toplevel-dir/*.c + and + current/subdirectory/relative-dir + before inserting into the sparse-checkout file? The user who typed + the first command is probably aware that arguments to set/add are + supposed to be patterns in non-cone mode, and probably would not be + happy with such a transliteration. However, many gitignore-style + patterns are just paths, which might be what the user who typed the + second command was thinking, and they'd be upset if their argument + wasn't transliterated. + + Second, what should bash-completion complete on for set/add commands + for non-cone users? If it suggests paths, is it exacerbating the + problem above? Also, if it suggests paths, what if the user has a + file or directory that begins with either a '!' or '#' or has a '*', + '\', '?', '[', or ']' in its name? And if it suggests paths, will + it complete "/pro" to "/proc" (in the root filesytem) rather than to + "/progress.txt" in the current directory? (Note that users are + likely to want to start paths with a leading '/' in non-cone mode, + for the same reason that .gitignore files often have one.) + Completing on files or directories might give nasty surprises in + all these cases. + + * The excessive flexibility made other extensions essentially + impractical. `--sparse-index` may not have been feasible in + non-cone mode, but even if it was, it would have been far more work + to implement and may have been too slow in practice. Some ideas for + adding coupling between partial clones and sparse checkouts are only + practical with a more restricted set of paths. + +For all these reasons, non-cone mode is deprecated. Please switch to +using cone mode. INTERNALS -- CONE PATTERN SET ----------------------------- From patchwork Tue Mar 8 07:39:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12773211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA84FC433EF for ; Tue, 8 Mar 2022 07:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243345AbiCHHlF (ORCPT ); Tue, 8 Mar 2022 02:41:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344657AbiCHHk4 (ORCPT ); Tue, 8 Mar 2022 02:40:56 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 461E939838 for ; Mon, 7 Mar 2022 23:40:00 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id u1so26967820wrg.11 for ; Mon, 07 Mar 2022 23:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=Fxlxj1FThT+VFVxtG0FmA74Pe0Of9J0GFbRj6Lqk2d8=; b=YbgHX7okOT+tiUevTa4142CeWu5vfsjnf7sVOFptV9OBqc4ZhkNykpIt1JZqLzN2M6 lTOml9gvS1CIneiNQt7C/6Ej4VDlW6bMZJyftv8fULBqK4jjlt3BzmCLZdf3I4MqG8NX DZ97HrP9Vo5r2LtlVgCLrGfe7QLeEJ1MAXmFsZpRrFxQN3PwnvGqHE3bRr6rUFd/FQI1 553XvoN/e8Q7pFvriqrZ364XjEtKYCT9vrwoXfeR55gXVEd2fwEhWol/3jSefY1OekJT raskbig/In5IrQuSy/X3G5BhFLL8XL/lnRg3ibVjHRYTIYO3zXXiwslHZYQBuU83qeuc DASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=Fxlxj1FThT+VFVxtG0FmA74Pe0Of9J0GFbRj6Lqk2d8=; b=rMgKQFyXLymysuHiBEjPviJReC9MjuZH72+SfuAwtOH9JwjHV4eIHkin1i1h7Zy2Xn ++NDoh2MhyVVuh9GCsi++0OXQbKECgHUTHyGJSLiHhFnjwFBDIbKjmR2tzXvr8pcvBP8 XpiORoORXfYzvCqKJcAEqxC2rbHSSHW0d++jreHx1X2uJeUhktXamvRDxH20cJC53pzJ KAI/IhFqsYJPqjrrfy4hvN28yqLKxDOeAWTsQBT6y88ToUBNgm1Cs5MS9fesW7Xbae2M f5wAZff/uef35+9EFbpTLEhNWwZW2jaO7FwcBwMnhuLVsUpSDXa9hzzQdb2r9C3O5qpK 6dFQ== X-Gm-Message-State: AOAM531Y7gfLm9y4TOBz7M2VNPH2/DKGdYn8tUkBf0ycYXBdUL/7Dj7U hG9bk71RaYNHRCfwLi6LAjXVLtxqCA0= X-Google-Smtp-Source: ABdhPJzdMpvNxyj/Noxy1N5kQPVxLJ0+hsB3gGvEnuv900BvrLdBAA0dC+k+9aVNJGvXfHJpy2F0IQ== X-Received: by 2002:a05:6000:11cc:b0:1f0:6492:761a with SMTP id i12-20020a05600011cc00b001f06492761amr10941508wrx.412.1646725198708; Mon, 07 Mar 2022 23:39:58 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f186-20020a1c38c3000000b00382a9b91515sm1364485wma.37.2022.03.07.23.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:39:58 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 08 Mar 2022 07:39:48 +0000 Subject: [PATCH 9/9] Documentation: some sparsity wording clarifications MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Victoria Dye , Lessley Dennington , Derrick Stolee , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Improve the wording for a couple paragraphs in two different manuals relating to sparse behavior. Reported-by: Ævar Arnfjörð Bjarmason Signed-off-by: Elijah Newren --- Documentation/git-read-tree.txt | 9 +++++---- Documentation/git-sparse-checkout.txt | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index 99bb387134d..cbafb1aed49 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -375,10 +375,11 @@ have finished your work-in-progress), attempt the merge again. SPARSE CHECKOUT --------------- -Note: The `update-index` and `read-tree` primitives for supporting the -skip-worktree bit predated the introduction of -linkgit:git-sparse-checkout[1]. Users are encouraged to use -`sparse-checkout` in preference to these low-level primitives. +Note: The skip-worktree capabilities in linkgit:git-update-index[1] +and `read-tree` predated the introduction of +linkgit:git-sparse-checkout[1]. Users are encouraged to use the +`sparse-checkout` command in preference to these plumbing commands for +sparse-checkout/skip-worktree related needs. "Sparse checkout" allows populating the working directory sparsely. It uses the skip-worktree bit (see linkgit:git-update-index[1]) to diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 11792187224..06f23660f63 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -15,11 +15,11 @@ SYNOPSIS DESCRIPTION ----------- -This command is used to create sparse checkouts, which means that it -changes the working tree from having all tracked files present, to only -have a subset of them. It can also switch which subset of files are -present, or undo and go back to having all tracked files present in the -working copy. +This command is used to create sparse checkouts, which change the +working tree from having all tracked files present to only having a +subset of those files. It can also switch which subset of files are +present, or undo and go back to having all tracked files present in +the working copy. The subset of files is chosen by providing a list of directories in cone mode (the default), or by providing a list of patterns in