From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 8ADCC1F8C8 for ; Wed, 22 Sep 2021 22:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238337AbhIVWyA (ORCPT ); Wed, 22 Sep 2021 18:54:00 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:59146 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238356AbhIVWxx (ORCPT ); Wed, 22 Sep 2021 18:53:53 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 10AB91594A0; Wed, 22 Sep 2021 18:52:15 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=CcD4nSAInNA1s/tDPPHtM1Saup1QGnwYBJUYGl /5+tg=; b=bmSscxmMvjBGBKbwSVz2UDXdHY0DK0oq28R+4NkNq9Sbm1skYCCzNu zCtqgDjW2L5m2ewgTBVPjWWLNLai3v5AUdgbUN3ZVc7D+gyyatzm7J9sJIM8aGb3 aVg44SV44fa+I7Xuk9ZbO3S2CB1QDCF+jzqQZyz3qnQt/DxoNLfDQ= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 0895D15949F; Wed, 22 Sep 2021 18:52:15 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 6C80615949E; Wed, 22 Sep 2021 18:52:12 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Derrick Stolee via GitGitGadget" Cc: git@vger.kernel.org, newren@gmail.com, matheus.bernardino@usp.br, stolee@gmail.com, vdye@github.com, =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Derrick Stolee , Derrick Stolee Subject: Re: [PATCH v3 01/14] t3705: test that 'sparse_entry' is unstaged References: Date: Wed, 22 Sep 2021 15:52:11 -0700 In-Reply-To: (Derrick Stolee via GitGitGadget's message of "Mon, 20 Sep 2021 17:45:24 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: B97ECF4C-1BF7-11EC-8692-98D80D944F46-77302942!pb-smtp21.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Derrick Stolee via GitGitGadget" writes: > From: Derrick Stolee > > The tests in t3705-add-sparse-checkout.sh check to see how 'git add' > behaves with paths outside the sparse-checkout definition. These > currently check to see if a given warning is present but not that the > index is not updated with the sparse entries. Add a new > 'test_sparse_entry_unstaged' helper to be sure 'git add' is behaving > correctly. > > We need to modify setup_sparse_entry to actually commit the sparse_entry > file so it exists at HEAD and as an entry in the index, but its exact > contents are not staged in the index. > > Signed-off-by: Derrick Stolee > --- > t/t3705-add-sparse-checkout.sh | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh > index 2b1fd0d0eef..e202a2ff74a 100755 > --- a/t/t3705-add-sparse-checkout.sh > +++ b/t/t3705-add-sparse-checkout.sh > @@ -19,6 +19,7 @@ setup_sparse_entry () { > fi && > git add sparse_entry && > git update-index --skip-worktree sparse_entry && > + git commit --allow-empty -m "ensure sparse_entry exists at HEAD" && > SPARSE_ENTRY_BLOB=$(git rev-parse :sparse_entry) > } > > @@ -36,6 +37,11 @@ setup_gitignore () { > EOF > } > > +test_sparse_entry_unstaged () { > + git status --porcelain >actual && > + ! grep "^[MDARCU][M ] sparse_entry\$" actual Does this say "we do not want any difference from the index, be it modification, deletion, addtion, etc."? Just wondering if there were a reason why the pattern is more complex than "^[^ ][M ]" (i.e. anything but "unmodified since the index"), not necessarily suggesting to spell the test differently. Thanks.