Re: [PATCH] Introduce the config variable pack.packSizeLimit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 8 Feb 2008, Junio C Hamano wrote:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> > Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> >
> >> +test_expect_success \
> >> +    'honor pack.packSizeLimit' \
> >> +    'git config pack.packSizeLimit 200 &&
> >> +     packname_4=$(git pack-objects test-4 <obj-list) &&
> >> +     test 3 = $(ls test-4-*.pack | wc -l)'
> >> +
> >
> > Where does "3" come from, and what could break it?

It was in my test, and as I do not expect the obj-list (as well as the 
contents it references to change), I just fixed it to 3.

> How about doing it like this, instead?
> 
> diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
> index 4f350dd..3eea478 100755
> --- a/t/t5300-pack-object.sh
> +++ b/t/t5300-pack-object.sh
> @@ -268,4 +268,12 @@ test_expect_success \
>      'make sure index-pack detects the SHA1 collision' \
>      '! git-index-pack -o bad.idx test-3.pack'
>  
> +test_expect_success 'honor pack.packSizeLimit' '
> +     limit=200 &&
> +     git config pack.packSizeLimit $limit &&
> +     packname_4=$(git pack-objects test-4 <obj-list) &&
> +     bigger=$(find test-4-*.pack -size +${limit}c) &&
> +     test -z "$bigger"
> +'

Sure (with minor modifications).  I was not certain if I could rely on 
find being available everywhere, and understanding -size.

Minor modification that is necessary: MacOSX' find does not accept a find 
call like that.  It must be

	bigger=$(find . -name test-4-*.pack -size +${limit}c) &&

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux