From: skillzero@gmail.com Date: Mon, 17 Aug 2009 09:41:57 GMT Subject: Re: sparse support in pu Message-ID: <2729632a0908170241m415867e6t4286f8bfb6116c26@mail.gmail.com> In-Reply-To: On Mon, Aug 17, 2009 at 2:15 AM, Johannes Schindelin wrote: > Hi, > > On Mon, 17 Aug 2009, skillzero@gmail.com wrote: > >> On Mon, Aug 17, 2009 at 1:17 AM, Nguyen Thai Ngoc Duy wrote: >> > On Mon, Aug 17, 2009 at 1:09 PM, wrote: >> >> 1. Have people decided whether it should be on by default if you have >> >>    a .git/info/sparse file? I'd definitely like it to be on by >> >>    default.  When I first tried it, I didn't realize I had to use >> >>    --sparse to git checkout to get it to use the sparse rules. The >> >>    same goes for a merge I did that happened to have a file in the >> >>    excluded area (it included it because I didn't use --sparse to git >> >>    merge). >> > >> > I tend to make it enabled by default too. I have made it stricter to >> > trigger reading sparse in unpack_trees() -- only do it when >> > unpack_opts.update is TRUE. This should make it safer to be enabled by >> > default. >> >> Other than it being new and not-widely-tested code, is there any >> additional risk to having it enabled by default if there are no sparse >> patterns defined? > > I think that in and of itself is reason enough to turn off the feature > when .git/info/sparse is not present. > > It also may have a runtime cost, dunno. I was thinking that it would effectively do this: Try to read .git/info/sparse if valid patterns read    Sparse is enabled else (e.g. file missing or nothing but empty lines/comments)    Sparse is disabled I wouldn't think there would be any additional cost or risk (other than the extra code to read the .git/info/sparse file) because the result is the same as if sparse had been disabled by being defaulted to off since even in the default off case, it's still a runtime check. I would think --sparse would really only be useful as a way to negate --no-sparse (i.e. act as if .git/info/sparse didn't exist temporarily).