Skip to content

Commit 6a7bf0d

Browse files
committed
Merge branch 'jk/p5303-sed-portability-fix' into maint
A perf script was made more portable. * jk/p5303-sed-portability-fix: p5303: avoid sed GNU-ism
2 parents f2d156d + f08b6c5 commit 6a7bf0d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

t/perf/p5303-many-packs.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ repack_into_n () {
2121
mkdir staging &&
2222

2323
git rev-list --first-parent HEAD |
24-
sed -n '1~5p' |
25-
head -n "$1" |
26-
perl -e 'print reverse <>' \
27-
>pushes
24+
perl -e '
25+
my $n = shift;
26+
while (<>) {
27+
last unless @commits < $n;
28+
push @commits, $_ if $. % 5 == 1;
29+
}
30+
print reverse @commits;
31+
' "$1" >pushes
2832

2933
# create base packfile
3034
head -n 1 pushes |

0 commit comments

Comments
 (0)