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=-3.9 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 B430D1F5AE for ; Mon, 10 May 2021 05:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhEJF3m (ORCPT ); Mon, 10 May 2021 01:29:42 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:51384 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbhEJF3l (ORCPT ); Mon, 10 May 2021 01:29:41 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 75B49C67AB; Mon, 10 May 2021 01:28:36 -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=2oQiCMJb1aN1/Rf+syUMdPvOcPHPl5lRCfoKJM K6yOI=; b=dNUdB8arpFrTvJvtCrfNbL4yCDU5EdV1SNcgH7gGaISBoIJdqu55LX kIOm1+pDghvO1JkRhyC1fHqJPrehx0UEv8RzExqu84NwawhWYeC6GLCCSIpQK9JE e3ooSrdTh59SCZj2HpENuoLMUt6WUdYDYyMxG8qs7AEzCx/UBzoM0= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 595ACC67AA; Mon, 10 May 2021 01:28:36 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id BC922C67A8; Mon, 10 May 2021 01:28:35 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Elijah Newren via GitGitGadget" Cc: git@vger.kernel.org, Eric Sunshine , Elijah Newren , Derrick Stolee , Jeff King , Philip Oakley , Jeff Hostetler , Josh Steadmon Subject: Re: [PATCH v3 4/8] t7300: add testcase showing unnecessary traversal into ignored directory References: Date: Mon, 10 May 2021 14:28:35 +0900 In-Reply-To: (Elijah Newren via GitGitGadget's message of "Sat, 08 May 2021 19:59:00 +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: 9148FE38-B150-11EB-BE07-74DE23BA3BAF-77302942!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Elijah Newren via GitGitGadget" writes: > +test_expect_failure 'avoid traversing into ignored directories' ' > + test_when_finished rm -f output error trace.* && > + test_create_repo avoid-traversing-deep-hierarchy && > + ( > + cd avoid-traversing-deep-hierarchy && > + > + mkdir -p untracked/subdir/with/a && > + >untracked/subdir/with/a/random-file.txt && > + > + GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \ > + git clean -ffdxn -e untracked > + ) && > + > + grep data.*read_directo.*visited trace.output \ > + | cut -d "|" -f 9 >trace.relevant && > + cat >trace.expect <<-EOF && > + directories-visited:1 > + paths-visited:4 Are the origins of '1' and '4' trivially obvious to those who are reading the test, or do these deserve comments? We create an empty test repository, go there and create a untracked/ hierarchy with a junk file, and tell "clean" that 'untracked' is "also" in the exclude pattern (but since there is no other exclude pattern, that is the only one), so everything underneath untracked/ we have no reason to inspect. So, we do not visit 'untracked' directory. Which ones do we visit? Is '1' coming from the top-level of the working tree '.'? What about the number of visited paths '4' (the trace is stored outside this new test repository, so that's not it). Thanks. > + EOF > + test_cmp trace.expect trace.relevant > +' > + > test_done