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/repos/inflate-repo.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 / repos / inflate-repo.sh` 85 lines ยท 2152 bytes Raw Blame History 1 #!/bin/sh 2 # Inflate the size of an EXISTING repo. 3 # 4 # This script should be run inside the worktree of a TEST repo. 5 # It will use the contents of the current HEAD to generate a 6 # commit containing copies of the current worktree such that the 7 # total size of the commit has at least files. 8 # 9 # Usage: [-t target_size] [-b branch_name] 10 11 set -e 12 13 target_size=10000 14 branch_name=p0006-ballast 15 ballast=ballast 16 17 while test "$#" -ne 0 18 do 19 case "$1" in 20 -b) 21 shift; 22 test "$#" -ne 0 || { echo 'error: -b requires an argument' >&2; exit 1; } 23 branch_name=$1; 24 shift ;; 25 -t) 26 shift; 27 test "$#" -ne 0 || { echo 'error: -t requires an argument' >&2; exit 1; } 28 target_size=$1; 29 shift ;; 30 *) 31 echo "error: unknown option '$1'" >&2; exit 1 ;; 32 esac 33 done 34 35 git ls-tree -r HEAD >GEN_src_list 36 nr_src_files=$(wc -l inflate-repo.params 53 git add inflate-repo.params 54 git commit -q -m params 55 56 # Create ballast for in our branch. 57 copy=1 58 nr_files=$nr_src_files 59 while test $nr_files -lt $target_size 60 do 61 sed -e "s| | $ballast/$copy/|" > inflate-repo.params 72 git add inflate-repo.params 73 git commit -q -m "ballast plus 1" 74 75 nr_files=$(git ls-files | wc -l) 76 77 # Checkout master to put repo in canonical state (because 78 # the perf test may need to clone and enable sparse-checkout 79 # before attempting to checkout a commit with the ballast 80 # (because it may contain 100K directories and 1M files)). 81 git checkout $src_branch 82 83 echo "Repository inflated. Branch $branch_name has $nr_files files." 84 85 exit 0