Re: [PATCH 03/24] t9300 (fast-import): guard "export large marks" test setup
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Sep 24, 2010, 09:38 UTC
- Message-ID
- <20100924093847.GE22658@kytes>
- In-Reply-To
- <20100924070950.GD4666@burratino>
Hi,
Jonathan Nieder writes:
Show 12 quoted lines
> test_expect_success 'A: export marks with large values' ' > + test_tick && > + mt=$(git hash-object --stdin </dev/null) && > + >input.blob && > + >marks.exp && > + >tree.exp && > + > + cat >input.commit <<-EOF && > + commit refs/heads/verify--dump-marks > + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE > + data <<COMMIT > + test the sparse array dumping routines with exponentially growing marks
Ok, so we want marks to grow exponentially.
Show 8 quoted lines
> + COMMIT > + EOF > + > + ( > + i=0 && > + l=4 && > + m=6 && > + n=7 &&
Maybe use slightly less cryptic variable names?
> + while test "$i" -lt 27
Something like for i in `seq 1 10` will atleast make it clear that i is just a loop variable. That's one arbitrary variable less.
Show 30 quoted lines
> + do
> + cat >>input.blob <<-EOF &&
> + blob
> + mark :$l
> + data 0
> + blob
> + mark :$m
> + data 0
> + blob
> + mark :$n
> + data 0
> + EOF
> + {
> + echo "M 100644 :$l l$i" &&
> + echo "M 100644 :$m m$i" &&
> + echo "M 100644 :$n n$i"
> + } >>input.commit &&
> + {
> + echo ":$l $mt" &&
> + echo ":$m $mt" &&
> + echo ":$n $mt"
> + } >>marks.exp &&
> + {
> + printf "100644 blob $mt\tl$i\n" &&
> + printf "100644 blob $mt\tm$i\n" &&
> + printf "100644 blob $mt\tn$i\n"
> + } >>tree.exp &&
> + l=$(($l + $l)) &&
> + m=$(($m + $m)) &&
> + n=$(($l + $n)) &&Maybe l=$(($l * 2)) and similarly for m to emphasize that they're doubling in every loop iteration?
-- Ram