From patchwork Sat Mar 12 03:11:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778719 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 833A8C433F5 for ; Sat, 12 Mar 2022 03:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbiCLDMe (ORCPT ); Fri, 11 Mar 2022 22:12:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbiCLDMb (ORCPT ); Fri, 11 Mar 2022 22:12:31 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F4F2923FD for ; Fri, 11 Mar 2022 19:11:25 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so6366893wmp.5 for ; Fri, 11 Mar 2022 19:11:25 -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=TKxjHUiKDGHtQJ1EuVczmSnTZmWtmRiY19rVlf6wXwVNJ+JEg7k7HcMTT7wQfzswYC +/6z88pG0hJbMHuU8OjsXgX7gUjv31Iw7FsY2ZyWpVJmoGbryaPX8YadBmHo0Fbp3I/5 jR02cGoQ51UWUxN5gMP1r0sWv9vpcr3vyGNxhbAkA1DqtMBwwpvp2ox/9UoVr6UGwBdZ r2Ax8kUom43HE5qgvoeiqxW32ocmZEhIB1bGic6uFPnMMl21oSEIs0wm1TCDe/mlkj9o XMZD+Y7xePda4Tm7T/ITkNOHzW2oITVwy2nSzmOdXfd5LYKLoq4D+Tzpg8gsRbxhfQ2T B6fQ== 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=D3fH51553VcxYh+aD7h6vonYFZ9RYMkkkTj5hd/Fo3h72owbiNTR+xS54Xaqar0kDS AW/PFmNdj+2GelReNfABodFc7GdDVxYp57yRzLcifyZByrmuUu9e25sRiekjgjabY0yz vZpWSwNemesxFPU2x+5uWVNQRrnl72NImRQQUW4TnpPOuFGWGdHzxYw4CwK9Sl7/8BJV Moj+ypO/NwenHp65yXVgmoeyEwl1jBobozvjXxyCiuwb2aHYFnI2epqyQ+Lq4wOeX2H1 szr6aowsmEYo0K9xTEC0YYTQiQPKGkXT4jgd2SvvolJmeYvy3TzbjoE94Le7feR5tsl4 k7QA== X-Gm-Message-State: AOAM532cXc9GZDqEZ/NLYxuacRriCJ9b3k2iunEbfpRHndPq2g5QUojE 1MJIExRrvSx+mxDW9WwsNLVNeT9/Jg0= X-Google-Smtp-Source: ABdhPJwu3gIy6W7KY4op1gxSMejwpV/lYDrH/23NSyU/pTrVsH4lln7qvWvgKBxuNYv/iDJYGCAuMg== X-Received: by 2002:a1c:f719:0:b0:381:ba:5247 with SMTP id v25-20020a1cf719000000b0038100ba5247mr9700656wmh.183.1647054683727; Fri, 11 Mar 2022 19:11:23 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z2-20020a056000110200b001e7140ddb44sm7857196wrw.49.2022.03.11.19.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:23 -0800 (PST) Message-Id: <05dba7069c5e0c1aec1a7206f9cbea593d8d68cb.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:13 +0000 Subject: [PATCH v2 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 , 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 Sat Mar 12 03:11:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778718 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 91A15C433FE for ; Sat, 12 Mar 2022 03:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbiCLDMg (ORCPT ); Fri, 11 Mar 2022 22:12:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbiCLDMb (ORCPT ); Fri, 11 Mar 2022 22:12:31 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325AD2923FA for ; Fri, 11 Mar 2022 19:11:26 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id r6so15155574wrr.2 for ; Fri, 11 Mar 2022 19:11:26 -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=q3lmpojNTUhIT4ILYP6U+/G5YmRuM4xjjI0UIV8e920=; b=P17B224gvUFAVFq/pImPIQHQc0UllaAm93Ouad+QRwI31SV9GlcMcQL53SZqxD6p/g AlwD06Ly2+RhDHRX0ccNYz05r8l0ql9582iF2HnzTd3CvBk1NPek4QaKGMeyp7cjhmz+ xbxzaz6HXdLPu3iiS97ObJ3Qv/c3j+1b4XN0k6fz3cZ5HizKaWwQZ8OCQtXp+SzwnmUV u2t01egQJf/L0Bk7ON4ep1UbuVMVWRRh2jJ4st75D69P66zyvUflibK75jZa2EcwEs7n OKae/Fqb2UBXFsxa8DzfqzEXp4ALT8rS3XsTOFcWl3gst0ZoXkZZYO1DrL+se0BWP3X3 rkQA== 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=q3lmpojNTUhIT4ILYP6U+/G5YmRuM4xjjI0UIV8e920=; b=IZgqjd/b98pL+SXzS+gln8I8IK92LHwdpdDEczDgdf5LbS5qeSeFGQUt4xLFsLyFga 9T14LcgvuSZP+S960Bf55Ajoo375clcnrY2tldKRCT0HqIEnFhIFf78yAzJ0mpRO1O6P C31+RHn0JVJmXOukxRTRf0QgkwYF3TDKOwXrA5x+6zYvRmMtsIr19AU+rPBsN+YGnMxM dT9en5fm3QWYPNNPznVtzsOnW5eHjXPYvpxKwR4QUmcD7PI/nKsVG3H7GNwzLQiRAcWD LNn4s6XVEmdRiAhykCEDcylyPF8tQbbsFx6NU4K+ECn61cBgrMYFvLZzV1WExAbJaY8D OGiA== X-Gm-Message-State: AOAM531JdOeTIIOWpcaxjZAnRBVUuHdZpRBk8XXfz5hfnM8VmaEx/VCF ixur7GojGhDbTIj++I0ykWIMnYWerko= X-Google-Smtp-Source: ABdhPJwkZPIADdiiC8xml08+mxAOjv/WpaDfvKNNn7H58mrS9Sk969lXfH/EYH3VGx5l1odOAKM8bA== X-Received: by 2002:a5d:584a:0:b0:203:97f6:5975 with SMTP id i10-20020a5d584a000000b0020397f65975mr3679345wrf.612.1647054684652; Fri, 11 Mar 2022 19:11:24 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u18-20020adfdd52000000b001f04e9f215fsm7959389wrm.53.2022.03.11.19.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:24 -0800 (PST) Message-Id: In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:14 +0000 Subject: [PATCH v2 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 , 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..6603a0cc029 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) { /* also handles "not specified" (value of -1) */ mode = MODE_CONE_PATTERNS; core_sparse_checkout_cone = 1; } else { From patchwork Sat Mar 12 03:11:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778720 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 DF994C433EF for ; Sat, 12 Mar 2022 03:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229551AbiCLDMi (ORCPT ); Fri, 11 Mar 2022 22:12:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbiCLDMc (ORCPT ); Fri, 11 Mar 2022 22:12:32 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF6CE2923F7 for ; Fri, 11 Mar 2022 19:11:26 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id u1so15554960wrg.11 for ; Fri, 11 Mar 2022 19:11:26 -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=Q6o3E6fADtKucUXnaKZ+7wJPiX8J/RGHKWdMqaNRsh6v/ymSqdR5SEbsFo5yJ8mV7b cl8xa0WUe3HTE8h7eE9MaBMSTlYzrVw1Cb6NZDm7foYorX0Z2mOkF7k0mNY7usgVfHzi H3tI1jHNwAIqWRWoCJ/PV1GR/lbUfSVOcOmC8jKbMAW1/9KB5byvgJKZjsPN3JaqpeJe dUOooVkm9rrI18BqgH9JvQ1mQG/2rDmtg4BDBUr1ssoJUBXN1VwMU6WEA5YEB0CQuQWF VMy5Jallac+YhmudGrxipEGzjihxB7imyKjLRFFpIzejw03gGAbQalWlzi4caWh+aguC 8TQQ== 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=j4TTOskJGksvzfBKn2KD+ML+MFFX1lYdB8yYwLo55NOBtYnKoV6Qa2e5lujXth15rr FdiEhIotKEfnbhUXXic5dLm/8bKZXGwgQ6VNuAYcDCwj+MznhvVmDpyGIXY+7rEYYocx UPYW7htijkrKqy0jcqUYIXKNvEdruzP7C80H5YHAxiPkG0z0mpJtMjhqlmZrZ8aGKHSr Zc2XC0vqcRJIxAemzDUCt1M9qa8YKGgdum1o1sZBFB8m0b0McPHNYDMNvRNA+g1ipqzW aRRmX7rAphMvKEse3AQb9nYDB7jA7BjvO6gPKkM7eHAE9jNbBTmdzlB51x6gRMeQjp1B 16GA== X-Gm-Message-State: AOAM533a613AJQ56iz2jZNEP8cYQH96UYHVvqCyMQPi7V7rWo4aGaA1t 9CZ3HgRBI6QM8htvP8SwZzx965AyPe8= X-Google-Smtp-Source: ABdhPJzhY5DeM0ZqVGsRvYVV1VpcaEc8w9U06Qhc8ZTwL2t8msVea3o/YMOkMdMzK2gVUmXpfqwUCw== X-Received: by 2002:adf:f68d:0:b0:203:7b96:a7ff with SMTP id v13-20020adff68d000000b002037b96a7ffmr9915675wrp.101.1647054685350; Fri, 11 Mar 2022 19:11:25 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i8-20020a1c5408000000b00389bf11ba0csm11911813wmb.38.2022.03.11.19.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:25 -0800 (PST) Message-Id: <8eab21996c7984a31cb954dd787ee54ce77dfa69.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:15 +0000 Subject: [PATCH v2 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 , 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 Sat Mar 12 03:11:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778721 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 EF75DC433F5 for ; Sat, 12 Mar 2022 03:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbiCLDMs (ORCPT ); Fri, 11 Mar 2022 22:12:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbiCLDMd (ORCPT ); Fri, 11 Mar 2022 22:12:33 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31872923FC for ; Fri, 11 Mar 2022 19:11:27 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 7-20020a05600c228700b00385fd860f49so6413720wmf.0 for ; Fri, 11 Mar 2022 19:11:27 -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=lhlPRho+wNCRvsgZhZj76DLpTBdHqXBi8QweMwFQnkuY6LPeqO+DOZeLgoLrcpj7hg 3etmys8wxD5Xu09d7Ia+3wXMJzC4+67lTlcdoBI+OYl+QkjZRFdW3klUFw3mpcjYhx4M kLTn6XLGDeLG3W5vEvPAJqhWcTaHE3A3AgHfsxZ/L7fJfzzPaDaUCqVnaY34aWyoLklG WHKAO4lnXhW4uXqCOrxyyqxKK5YRQbPoV/hVIb6/ElXPNnxY6Sl83KsY0GS7EYbSiEz1 SbG86DtEJvH4xeeToUguM1w9yt2yLk4TF9VY6JidW9ANAXnvU3aIX5e0wqh1SD2Gp7X9 w2Uw== 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=vLlUUCJJhDLw9Jt54APhqE0Vmxggg1xHDgPLs7kteZQxDF/xlJoyDMVMdMmrcAIoBs /NY81bwinNjGgqAxQcAeGfjr8yhp6eynLWK+G4w6JZyjfnD1qHtauutjDxcz5mZd+uuL YCDaOgPc0OB4ezLRnKoiGuaPM66wOXqNuSciD5PHROr3E5GZkiHlmKRJy5c3goBlQ2fG hRiyWD14K44bqSvJtd19DLWztGMZEWo7Gt4xXBi3ds9TNwfrm5omrMc90DEPFpbWfBJs R6nrGZt5vrOi7v3gC8KQNfxRaJizSQJzuxnd5tZXv/yejnjNQiNhCCjWVRj/qx2Mtify O6hw== X-Gm-Message-State: AOAM533G2XCm1iMKgoJqhg0WeqHSIJIYUCEGxJofpn7MCGolX5RQeLcR L9spVGbEAGxbkh4qADeIBoVvp/e2MAE= X-Google-Smtp-Source: ABdhPJyS4jWgQNS7xfFGNfPs7BwEt+r4Snl/37nBpfBDDgBIzLHaY1uHgaYDY6naNZGqI4SoB6ziFQ== X-Received: by 2002:a7b:c347:0:b0:37e:68e6:d85c with SMTP id l7-20020a7bc347000000b0037e68e6d85cmr18116369wmj.176.1647054686237; Fri, 11 Mar 2022 19:11:26 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n16-20020a5d4010000000b001f07772457csm7699437wrp.101.2022.03.11.19.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:25 -0800 (PST) Message-Id: In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:16 +0000 Subject: [PATCH v2 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 , 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 Sat Mar 12 03:11:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778723 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 8CD46C433EF for ; Sat, 12 Mar 2022 03:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbiCLDMy (ORCPT ); Fri, 11 Mar 2022 22:12:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbiCLDMe (ORCPT ); Fri, 11 Mar 2022 22:12:34 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB762923FA for ; Fri, 11 Mar 2022 19:11:28 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id h15so15566705wrc.6 for ; Fri, 11 Mar 2022 19:11:28 -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=JYTYh/EaygBgAfKLUZMD/931apAKNkcH6lEJBJ+NVoO1gft04rkCZV1sV6NL8Hp9E5 d9IFdnzjKQnpKnSxS3sedVXX4R12VnW/R7s1aZ7F2ejnmbvdhgdzYNSCnsy5QeF+15qO uzt4k6T+W64dGRsw1gMNBu+P6Q29dewPr628WjjYkfVC4f4z/8X5O1zXO42X0h+O//VI eWOm961nvpa6wmkXyGIpDKXEvVPrZaXNgaaKFVQVv4EHFogGftBJVz+VkPsd7Vv8CATT JcKZSr3tHXvnlH3mz8N920NvDMNl2wKN8Yzr/z5qIEqEbxmIHra5zAkgi08QWMN1ZzhU Rmaw== 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=PqPMMYAG7zrB7Zqoh4lNlRx5p787iFz7U5U6gzY1dzmrMkdz8h5HWTO4VbLXWWiNFS gWxvMTbVmbV1D8rDLvxBEclaOJy5fpP3Xm5HAAvlKFkf3G54+XV3LcyD+1V/hUdmOMg6 j8fXyjNVgMuFyj3DS+W2Ae8d7jNrFN2xePXxQu6EzUsEIaOhq1cUEjKQNtGmLurdyj5k UxdXQmJ0MqRP1boyQZT/WXJqefjLYAcl2oNBJz87Gq5HeKQ9+1/FTqzTKR6nfmQZ9/Ea UJMye76DCFjYvH9R8q4scJV9mvnqaHOJFTgfr3M6QXsbPLQrAKY7LO+6cy9sGuPe/Qvu jO0Q== X-Gm-Message-State: AOAM532J783fuDBO40X4jSERHm+u3LFcwgsI5SA7CSSmxc6WUEP3NuvU P2V3S93Aazi6o2wmwxR146A7VSDVyKI= X-Google-Smtp-Source: ABdhPJyDpZMBlzZ8XAhjNLv8RfqDk3a3g3ZqZUyYjL/bFZAxRBZrg7YSflQFe7G6EwCpW3jV4Xu1CQ== X-Received: by 2002:adf:ab09:0:b0:1f0:1208:5123 with SMTP id q9-20020adfab09000000b001f012085123mr9147896wrc.146.1647054687014; Fri, 11 Mar 2022 19:11:27 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k3-20020a1ca103000000b0038993e53be7sm11720166wme.39.2022.03.11.19.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:26 -0800 (PST) Message-Id: <7333198b7785ff4ab6d424b3384c9e4d264e96b2.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:17 +0000 Subject: [PATCH v2 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 , 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 Sat Mar 12 03:11:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778722 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 B2084C433F5 for ; Sat, 12 Mar 2022 03:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbiCLDMw (ORCPT ); Fri, 11 Mar 2022 22:12:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbiCLDMe (ORCPT ); Fri, 11 Mar 2022 22:12:34 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B890293F06 for ; Fri, 11 Mar 2022 19:11:29 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id u10so15565618wra.9 for ; Fri, 11 Mar 2022 19:11:29 -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=aWmqn8MAJLAeThHWU5bSr6RMPD/6iD3YKKgzwJH9dvM=; b=pP/vv49jUujRJGVT0j+ICBynYBLel7Z6QEpJ7ovxIAwlnNltxM7euuymC9d+bw4+E9 Qi7AoDrVsNGIlvfw73bFQJxUpfGltHajSSUjny3wRBIz7PHoZQ4padIAQoP/h9bzRS9M J6SY/iCNm6rk3pg9CwykydNO5ktY5YE9+cL2msBQz2Z7WXqKvjMF7S9lCl0vQZ0SgZYu R0CflPYNZgjtdTsbDOKPXk988tBcLPy535iQ9VdJ3bkCnM91YIw10seFzXVL++CqTg/z BG/29y+8EfZ7vSg1vrOV5ersGglK874B92FeHq1Ycq1WoNUtALzMzDVgF0N8Sy8pa3QE hjng== 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=aWmqn8MAJLAeThHWU5bSr6RMPD/6iD3YKKgzwJH9dvM=; b=fbIB9YLy3DIqDpDcWalpdhh8XsjLfq4SuA6WC81yTyzoZ0fBlV/URVfe8ifNSRIvzn ZhcjZ9qy6QH7Q0W7o723kzpQ4ULTsjVC6MaxqpNqpWyQIg/+Q8A8hi1oc1nKq6IajtwQ SNorsXnxN+DUMDWPEOxl/I4lXW9B+O6xKlyu7rv3/hZW6XAZcX5oyE1eRo4KT5QBjm9w Ok/+4cBdAmj9xOq+yiN8zcovHQFiYYomBE28lxjqIklbnNS9+M9cxYEmAHZEW48a9lNs QjsyplBZlKKS7Q3MhPMN8hw9eTgWE+y8gcn41vxnIvRaHWu7y6MKbIqnFRljo14GzcME uT0Q== X-Gm-Message-State: AOAM533amGps+Ux0C//pg5N2ezO1Z21BEdA7HnnSdUkvHj5JcVXILKgD Sl0Y3/oiGdB/diPtTPRXwCuHYqd7UxE= X-Google-Smtp-Source: ABdhPJySt5JhmIX9g2Q/IATgc2ZpO7peXGYwlHyQKepqSwcR5Vm8vsXhEeCiG7RkoBiYzVx8UUeZkg== X-Received: by 2002:a05:6000:128f:b0:1f1:e586:87af with SMTP id f15-20020a056000128f00b001f1e58687afmr9311731wrx.222.1647054687805; Fri, 11 Mar 2022 19:11:27 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l8-20020a5d6688000000b001f04ae0bb6csm7649623wru.58.2022.03.11.19.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:27 -0800 (PST) Message-Id: In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:18 +0000 Subject: [PATCH v2 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 , 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 | 43 +++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 883b7f4c44f..dddf5ac6942 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -136,6 +136,43 @@ 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. + This can come from tools external to Git writing files, or + even affect Git commands because of either 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 +191,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 Sat Mar 12 03:11:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778724 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 14793C433F5 for ; Sat, 12 Mar 2022 03:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbiCLDMz (ORCPT ); Fri, 11 Mar 2022 22:12:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbiCLDMn (ORCPT ); Fri, 11 Mar 2022 22:12:43 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21104293F12 for ; Fri, 11 Mar 2022 19:11:30 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id bg31-20020a05600c3c9f00b00381590dbb33so6376829wmb.3 for ; Fri, 11 Mar 2022 19:11:29 -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=OIWHVaXUU1GgLk38QHAKqM6YI1ciLeNWXBz6gu03WNs=; b=gFLPAAa9fhZuri0i4xjxERQA4imtwlI3NZlLulNQWbVsY7/U+x7o/nqqD6hUfhOatO QfUybTvvrzKfk193xlFw9XYRR//djUAtN1pEr9ffH7jwi62ZHkPGAn1+esDxf3iEGpuw CxlUnr+GCy4Atcq3OoZHdfiZT+gTO/SMnzVgzM8sXCnVBx5j0a6/KZc1PWF5Az0PhhHP U+cIzRX7klxsw6siWwEy+YZ2h7IOARXmiGEnyH6dbEcYEJ6vJGesGyKU/hQeXWBDID9Q FjtUoJXyDIIwxYXK53+U73beoaFmAskacN+k+rtWzyIfBwaq0yUR0kPj3Wfxdclz8fX7 Y+4A== 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=OIWHVaXUU1GgLk38QHAKqM6YI1ciLeNWXBz6gu03WNs=; b=blpGXd9uWwG3hXAQpYXRPfMTqEKhOmzj7KyQZK4NG0byu6ij4CyE6y4hBlqwWzeRhT njzLPmuwWZdaAQKFcwvHl9aqf0NsSa0bQOU8KZanKh8YQNNGDNML//r6xajH5xNGzttk WnEczpxhGCqW3gqSYtOQzzJuRYynmFi9QOex3FPlB4ixfahRkLP+z4UB5FsKejVcrXtD dz5Anw6yI2shVZoKxsXRNcy3nPDSq43+ZUoeWN5M+GWJz69vjN1WACJnV7e5VvCPEYc9 kBBluA23bnm8P4m/chNVKwW06mym9vdhd8LbtTmcq74u607eKBhUIOhmLjwokZPmWRoI osxw== X-Gm-Message-State: AOAM532jkFaZc8gfN4C2n7iARnjG7mRz1JV2NAol6J7btkPAXgn6kU2B NagaYTPI4G2wlbR+/asgAHoVsegdHt8= X-Google-Smtp-Source: ABdhPJzN+7urtNuJGdoBB1/sqdw/fiL+Xt8w/Kyj4XH4OizM5C4U7lgvChFYftgDzAUPu7m7uZzGRg== X-Received: by 2002:a05:600c:3541:b0:389:95b2:5f63 with SMTP id i1-20020a05600c354100b0038995b25f63mr18101554wmq.126.1647054688501; Fri, 11 Mar 2022 19:11:28 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k17-20020a05600c1c9100b00386bb6e9c50sm18267652wms.45.2022.03.11.19.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:28 -0800 (PST) Message-Id: <78028ecaa58f2c0b395b417cfa2543e73ab51fae.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:19 +0000 Subject: [PATCH v2 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 , 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 dddf5ac6942..ae6ea8b48b0 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -274,12 +274,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 Sat Mar 12 03:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778725 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 3D560C433F5 for ; Sat, 12 Mar 2022 03:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbiCLDM5 (ORCPT ); Fri, 11 Mar 2022 22:12:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiCLDMq (ORCPT ); Fri, 11 Mar 2022 22:12:46 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD19293F19 for ; Fri, 11 Mar 2022 19:11:30 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id i8so15580663wrr.8 for ; Fri, 11 Mar 2022 19:11:30 -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=Trm2SuLOmb5hUWC9StR/SY122ZTTAUWBv+lMEf0TWFk=; b=G5LpyKmQcLZ3szMbhv0iSuhOLrRiVVq9/wUvE5VGc/GW4DVvbJ4KmiIsfO/VR4pDVN 1O4DEsaMZsPOaRV8VyNlVAsqr9ssjDVE8fLITcKZgqx7HxzNJvuj4l94bNJPJfByLxfO lg8By4/J6rt2uaHiU0a0JlOxig3tTCYyTAs02DACCcKkhe384EpeylTgR3/ef7rTfg3j yprRg2ZvElblUdIb6tEjPEVHjOtZlTzYTWME99XiqiBaw1qWBrC+OjFeBWk4jNlYrDku fzndBFBEzLSIwOPSrI/x62/Avc/ZmgsQBK3j0tO8VrqQM6a6re/yAMhb/qthyhsaVpeG yhnA== 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=Trm2SuLOmb5hUWC9StR/SY122ZTTAUWBv+lMEf0TWFk=; b=dV5ofwst7aCuR1NYMUh40StQ1RyPiiGODeACKr23nVx568jTjMWuBEn51n0PxTfeev ndYiQS4M0ULowLThW9mCu2Kwez5WEOqOEYIR+4nX49xutC3xHXdu2EjmtYEGT8M5VihL pNYV/7lt7DBcBUaeVImMkha5a7z3kzgURnmezE7LFI2Hl9LBppwCoAGymxOb9zNbpMQ9 +eC3KK+KTTq/qOzSEVry/hK1aP9Q5Ep/OJPcw4Q2d4ym9n29nFhEG8HG0NXROc6GJr+W hJbbtrirEfRSZ/xm4uSe2QCr078jZlH/IfEUHHQ3UozAWVjyFFVna9Jo8lMNcHf+vvoX ExBw== X-Gm-Message-State: AOAM532NBbgWFlVDkP8KIgpK+BvJ0rZJS8Bz18/DnSuGNC0cLO4QQWzP BEoAbH9B1YMylf77VEwTDyQKGYFSrsA= X-Google-Smtp-Source: ABdhPJyofkcIu8uZmxfwG7glMlKQYbU+bT6CNAast7o5/Dys8UJnOzBsN6lBzCzAHETbpf0OfD0u3Q== X-Received: by 2002:a05:6000:15cc:b0:1f1:f814:27c4 with SMTP id y12-20020a05600015cc00b001f1f81427c4mr9453822wry.630.1647054689267; Fri, 11 Mar 2022 19:11:29 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g2-20020a5d46c2000000b001f079ba0158sm7725220wrs.60.2022.03.11.19.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:28 -0800 (PST) Message-Id: <2d2b81986a55f0692d5536dec88079c58853f205.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:20 +0000 Subject: [PATCH v2 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 , 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 ae6ea8b48b0..aaf3ae63853 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 @@ -191,6 +194,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 Sat Mar 12 03:11:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12778726 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 99E84C433EF for ; Sat, 12 Mar 2022 03:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbiCLDM7 (ORCPT ); Fri, 11 Mar 2022 22:12:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbiCLDMq (ORCPT ); Fri, 11 Mar 2022 22:12:46 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B8E293F1A for ; Fri, 11 Mar 2022 19:11:31 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id e24so15539456wrc.10 for ; Fri, 11 Mar 2022 19:11:31 -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=WvOGUgp3KlNUpexDxJbvxFaTaBKndFtN2ht1BZqMMqs=; b=k8OPLRFYWroyrwTmsshLowUxLAKfhSY0y029AtjhSVFKB+PCwOhBqcuzLhv6GhdPgs NVtk5fAPpl4ZqVCiXVicMFBCv6yiN57nJtjhQyX4k/+JRkoNPP+9UrNm0O89WGiH3/LM TIurEFxcdkjq6kMl3RCNC0h6v4IOmUS6sX57RtiQk2W4dFuBAkJba9FQauq08oUndoF+ Qrw3FXTe5c1OJmDzvwPl6bhyl8Gum3Zcu19bYxVmedD/sPbnYDUmvgZsVcjM6ebXZWqy yUrBydUYQPkEoMHmNbI4tCvBVOIoTgSiAfluWPfdwKL8Tsb8+VK2w03FhDQkyrhNas2N JkNw== 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=WvOGUgp3KlNUpexDxJbvxFaTaBKndFtN2ht1BZqMMqs=; b=kWlhcurUuax02l3+jtiV4DykSJ8X+5W12/oYkXLAQHQ4B1FeRdTaweXakJsL1EbGZE I//tlVuWuMhFCoIrjEk/Yqw2Pa4uE7jexOGemmCjGZBik7xbMn4akPNFYb50oOYEw3Iu iT75HhDrxt73CLyxfw3WXGTq7LFNYAtIbgGFo9rFxcDKPGrH/VOTbR1wshtpWtmbrAsz KoF4aJG+ryVuwbg8pKJbaUC7CWr9KxYIrHEjxuR6/f+DgboBF90MbRHPKaJxG7mzHrcN 9wGQUJyTZZbZYnjkJVZfmcdT9Z7A05Wagm8am9YqOeGxJb6j1ZekanHxY1Q3vVlVQikS GemQ== X-Gm-Message-State: AOAM533T2WMOumlKo1OhmLJFKJJBBLD/xc3+9nbQbDAiK26XNtmswQbT yPki12bgfENxWvqsRIqb2yllxruq5e8= X-Google-Smtp-Source: ABdhPJyLuo5VFrtpd6kPzfRPyFAr2gOaWV3lcsvKtJouRUVSybMPqfR8t2Ot1MgDttB8tYheBlx8Sg== X-Received: by 2002:a05:6000:137a:b0:1f1:d6ec:7b69 with SMTP id q26-20020a056000137a00b001f1d6ec7b69mr8989838wrz.78.1647054690055; Fri, 11 Mar 2022 19:11:30 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n16-20020a5d4850000000b0020373b34961sm7733326wrs.66.2022.03.11.19.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 19:11:29 -0800 (PST) Message-Id: <4b89a3392b04acccf28f09f90e26715140461373.1647054681.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Sat, 12 Mar 2022 03:11:21 +0000 Subject: [PATCH v2 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 , 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 aaf3ae63853..e4a29a2baa9 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