[PATCH 13/13] advice: update message to suggest '--sparse'
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Aug 24, 2021, 21:54 UTC
- Message-ID
- <7749a69a38faeceadc7a8735fb3d0edd359c954c.1629842085.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1018.git.1629842085.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
The previous changes modified the behavior of 'git add', 'git rm', and 'git mv' to not adjust paths outside the sparse-checkout cone, even if they exist in the working tree and their cache entries lack the SKIP_WORKTREE bit. The intention is to warn users that they are doing something potentially dangerous. The '--sparse' option was added to each command to allow careful users the same ability they had before.
To improve the discoverability of this new functionality, add a message to advice.updateSparsePath that mentions the existence of the option.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- advice.c | 3 ++- t/t3602-rm-sparse-checkout.sh | 2 +- t/t3705-add-sparse-checkout.sh | 2 +- t/t7002-mv-sparse-checkout.sh | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/advice.c b/advice.c index 0b9c89c48ab..695693e5fa8 100644 --- a/advice.c +++ b/advice.c @@ -300,7 +300,8 @@ void advise_on_updating_sparse_paths(struct string_list *pathspec_list) fprintf(stderr, "%s\n", item->string); advise_if_enabled(ADVICE_UPDATE_SPARSE_PATH, - _("Disable or modify the sparsity rules if you intend" + _("Disable or modify the sparsity rules or" + " use the --sparse option if you intend" " to update such entries.")); } diff --git a/t/t3602-rm-sparse-checkout.sh b/t/t3602-rm-sparse-checkout.sh index 44f3e923164..22170feef62 100755 --- a/t/t3602-rm-sparse-checkout.sh +++ b/t/t3602-rm-sparse-checkout.sh @@ -16,7 +16,7 @@ test_expect_success 'setup' " EOF cat >sparse_hint <<-EOF && - hint: Disable or modify the sparsity rules if you intend to update such entries. + hint: Disable or modify the sparsity rules or use the --sparse option if you intend to update such entries. hint: Disable this message with \"git config advice.updateSparsePath false\" EOF diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh index 99c27dd9fb7..0a8071370d3 100755 --- a/t/t3705-add-sparse-checkout.sh +++ b/t/t3705-add-sparse-checkout.sh @@ -43,7 +43,7 @@ test_expect_success 'setup' " EOF cat >sparse_hint <<-EOF && - hint: Disable or modify the sparsity rules if you intend to update such entries. + hint: Disable or modify the sparsity rules or use the --sparse option if you intend to update such entries. hint: Disable this message with \"git config advice.updateSparsePath false\" EOF diff --git a/t/t7002-mv-sparse-checkout.sh b/t/t7002-mv-sparse-checkout.sh index 517fd587fa8..b6e9ea0b2c8 100755 --- a/t/t7002-mv-sparse-checkout.sh +++ b/t/t7002-mv-sparse-checkout.sh @@ -16,7 +16,7 @@ test_expect_success 'setup' " EOF cat >sparse_hint <<-EOF - hint: Disable or modify the sparsity rules if you intend to update such entries. + hint: Disable or modify the sparsity rules or use the --sparse option if you intend to update such entries. hint: Disable this message with \"git config advice.updateSparsePath false\" EOF "
-- gitgitgadget