Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/perf/p6010-merge-base.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / perf / p6010-merge-base.sh` 105 lines ยท 2569 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test git merge-base' 4 5 . ./perf-lib.sh 6 7 test_perf_fresh_repo 8 9 # 10 # Creates lots of merges to make history traversal costly. In 11 # particular it creates 2^($max_level-1)-1 2-way merges on top of 12 # 2^($max_level-1) root commits. E.g., the commit history looks like 13 # this for a $max_level of 3: 14 # 15 # _1_ 16 # / \ 17 # 2 3 18 # / \ / \ 19 # 4 5 6 7 20 # 21 # The numbers are the fast-import marks, which also are the commit 22 # messages. 1 is the HEAD commit and a merge, 2 and 3 are also merges, 23 # 4-7 are the root commits. 24 # 25 build_history () { 26 local max_level="$1" && 27 local level="${2:-1}" && 28 local mark="${3:-1}" && 29 if test $level -eq $max_level 30 then 31 echo "reset refs/heads/master" && 32 echo "from $ZERO_OID" && 33 echo "commit refs/heads/master" && 34 echo "mark :$mark" && 35 echo "committer C `1234567890` +0000" && 36 echo "data < `1234567890` +0000" && 48 echo "data < `1234567890` +0000" && 75 echo "data <expect 91 ' 92 93 test_perf 'git merge-base' ' 94 git merge-base --all one two >actual 95 ' 96 97 test_expect_success 'verify result' ' 98 test_cmp expect actual 99 ' 100 101 test_perf 'git show-branch' ' 102 git show-branch one two 103 ' 104 105 test_done