(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: { (SQ <'performance of tag-following with many tags\n'> <'\n'> <'This tests a fairly pathological case, so rather than rely on a real-world\n'> <'case, we will construct our own repository. The situation is roughly as\n'> <'follows.\n'> <'\n'> <'The parent repository has a large number of tags which are disconnected from\n'> <'the rest of history. That makes them candidates for tag-following, but we never\n'> <'actually grab them (and thus they will impact each subsequent fetch).\n'> <'\n'> <'The child repository is a clone of parent, without the tags, and is at least\n'> <'one commit behind the parent (meaning that we will fetch one object and then\n'> <'examine the tags to see if they need followed). Furthermore, it has a large\n'> <'number of packs.\n'> <'\n'> <'The exact values of "large" here are somewhat arbitrary; I picked values that\n'> <'start to show a noticeable performance problem on my machine, but without\n'> <'taking too long to set up and run the tests.\n'> ) } spids: [4] ) ] ) (C {<.>} {<'./perf-lib.sh'>}) (command.ShFunction name: create_history body: (BraceGroup children: [ (command.Pipeline children: [ (C {<perl>} {<-le>} { (SQ <'\n'> <'\t\tmy ($branch, $n, $blob) = @ARGV;\n'> <'\t\tfor (1..$n) {\n'> <'\t\t\tprint "commit refs/heads/$branch";\n'> <'\t\t\tprint "committer nobody <nobody@example.com> now";\n'> <'\t\t\tprint "data 4";\n'> <'\t\t\tprint "foo";\n'> <'\t\t\tprint "M 100644 $blob $_";\n'> <'\t\t}\n'> <'\t'> ) } {(DQ ($ Id.VSub_At '$@'))} ) (C {<git>} {<fast-import>} {<--date-format> <Id.Lit_Equals '='> <now>}) ] negated: F ) ] ) ) (command.ShFunction name: create_tags body: (BraceGroup children: [ (command.Pipeline children: [ (C {<git>} {<rev-list>} {(DQ ($ Id.VSub_At '$@'))}) (C {<perl>} {<-lne>} {(SQ <'print "create refs/tags/$. $_"'>)}) (C {<git>} {<update-ref>} {<--stdin>}) ] negated: F ) ] ) ) (command.ShFunction name: create_packs body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Pipeline children: [ (C {<perl>} {<-le>} { (SQ <'\n'> <'\t\tmy ($n) = @ARGV;\n'> <'\t\tfor (1..$n) {\n'> <'\t\t\tprint "blob";\n'> <'\t\t\tprint "data <<EOF";\n'> <'\t\t\tprint "$_";\n'> <'\t\t\tprint "EOF";\n'> <'\t\t}\n'> <'\t'> ) } {(DQ ($ Id.VSub_At '$@'))} ) (C {<git>} {<fast-import>}) ] negated: F ) (command.Pipeline children: [ (C {<git>} {<cat-file>} {<--batch-all-objects>} {<--batch-check> <Id.Lit_Equals '='> (SQ <'%(objectname)'>)} ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands:[(C {<read>} {<sha1>})]) body: (command.DoGroup children: [ (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$sha1')}) (C {<git>} {<pack-objects>} {<'.git/objects/pack/pack'>}) ] negated: F ) ] ) ) ] negated: F ) ] ) ] ) ) (C {<test_expect_success>} {(SQ <'create parent and child'>)} { (SQ <'\n'> <'\tgit init parent &&\n'> <'\tgit -C parent commit --allow-empty -m base &&\n'> <'\tgit clone parent child &&\n'> <'\tgit -C parent commit --allow-empty -m trigger-fetch\n'> ) } ) (C {<test_expect_success>} {(SQ <'populate parent tags'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd parent &&\n'> <'\t\tblob=$(echo content | git hash-object -w --stdin) &&\n'> <'\t\tcreate_history cruft 3000 $blob &&\n'> <'\t\tcreate_tags cruft &&\n'> <'\t\tgit branch -D cruft\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'create child packs'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tcd child &&\n'> <'\t\tgit config gc.auto 0 &&\n'> <'\t\tgit config gc.autopacklimit 0 &&\n'> <'\t\tcreate_packs 500\n'> <'\t)\n'> ) } ) (C {<test_perf>} {(SQ <fetch>)} { (SQ <'\n'> <'\t# make sure there is something to fetch on each iteration\n'> <'\tgit -C child update-ref -d refs/remotes/origin/master &&\n'> <'\tgit -C child fetch\n'> ) } ) (C {<test_done>}) ] )