p5303: avoid sed GNU-ism
Using "1~5" isn't portable. Nobody seems to have noticed, since perhaps people don't tend to run the perf suite on more exotic platforms. Still, it's better to set a good example. We can use: perl -ne 'print if $. % 5 == 1' instead. But we can further observe that perl does a good job of the other parts of this pipeline, and fold the whole thing together. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
71ca53e812
commit
f08b6c553d
@ -21,10 +21,14 @@ repack_into_n () {
|
|||||||
mkdir staging &&
|
mkdir staging &&
|
||||||
|
|
||||||
git rev-list --first-parent HEAD |
|
git rev-list --first-parent HEAD |
|
||||||
sed -n '1~5p' |
|
perl -e '
|
||||||
head -n "$1" |
|
my $n = shift;
|
||||||
perl -e 'print reverse <>' \
|
while (<>) {
|
||||||
>pushes
|
last unless @commits < $n;
|
||||||
|
push @commits, $_ if $. % 5 == 1;
|
||||||
|
}
|
||||||
|
print reverse @commits;
|
||||||
|
' "$1" >pushes
|
||||||
|
|
||||||
# create base packfile
|
# create base packfile
|
||||||
head -n 1 pushes |
|
head -n 1 pushes |
|
||||||
|
Reference in New Issue
Block a user