From: Junio C Hamano Date: Fri, 25 Sep 2020 18:00:44 GMT Subject: Re: [PATCH v4 3/8] maintenance: create auto condition for loose-objects Message-ID: In-Reply-To: <931fff4883a3da26a296af69a9c5ccc3a5037d71.1601037218.git.gitgitgadget@gmail.com> "Derrick Stolee via GitGitGadget" writes: > diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh > index b3fc7c8670..27565c55a2 100755 > --- a/t/t7900-maintenance.sh > +++ b/t/t7900-maintenance.sh > @@ -127,4 +127,26 @@ test_expect_success 'loose-objects task' ' > test_cmp packs-between packs-after > ' > > +test_expect_success 'maintenance.loose-objects.auto' ' > + git repack -adk && > + GIT_TRACE2_EVENT="$(pwd)/trace-lo1.txt" \ > + git -c maintenance.loose-objects.auto=1 maintenance \ > + run --auto --task=loose-objects 2>/dev/null && > + test_subcommand ! git prune-packed --quiet + printf data-A | git hash-object -t blob --stdin -w && > + GIT_TRACE2_EVENT="$(pwd)/trace-loA" \ > + git -c maintenance.loose-objects.auto=2 \ > + maintenance run --auto --task=loose-objects 2>/dev/null && > + test_subcommand ! git prune-packed --quiet + printf data-B | git hash-object -t blob --stdin -w && Is it essential for the purpose of the test somehow that the data used for the test are all incomplete files that lack the end-of-line at the end of the file? Use of 'printf' sends such a signal to confuse readers. Use of test_write_lines to write a single line may feel overkill, but it may be less cryptic, as newer parts of testsuite are encouraged to use it over 'echo' and raw 'printf'. > + GIT_TRACE2_EVENT="$(pwd)/trace-loB" \ > + git -c maintenance.loose-objects.auto=2 \ > + maintenance run --auto --task=loose-objects 2>/dev/null && > + test_subcommand git prune-packed --quiet + GIT_TRACE2_EVENT="$(pwd)/trace-loC" \ > + git -c maintenance.loose-objects.auto=2 \ > + maintenance run --auto --task=loose-objects 2>/dev/null && > + test_subcommand git prune-packed --quiet +'