From: Nguyen Thai Ngoc Duy Date: Wed, 12 Aug 2009 10:01:33 GMT Subject: Re: [RFC PATCH v3 8/8] --sparse for porcelains Message-ID: In-Reply-To: <7v3a7xa6e5.fsf@alter.siamese.dyndns.org> 2009/8/12 Junio C Hamano : > Nguyễn Thái Ngọc Duy   writes: > >> @@ -594,6 +596,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) >>               OPT_BOOLEAN('m', "merge", &opts.merge, "merge"), >>               OPT_STRING(0, "conflict", &conflict_style, "style", >>                          "conflict style (merge or diff3)"), >> +             OPT_SET_INT(0, "sparse", &opts.apply_sparse, >> +                         "apply sparse checkout filter", 1), > > Shouldn't this be BOOLEAN not INT, i.e. "--[no-]sparse"?  That way, you > could enable it by simply the presense of $GIT_DIR/info/sparse. This patch was written carelessly. I wanted to have something to test. If you agree on option name "--sparse" then yes BOOLEAN is better. > It could also require core.sparseworktree configuration set to true if we > are really paranoid, but without the actual sparse specification file > flipping that configuration to true would not be useful anyway, so in > practice, giving --sparse-work-tree option to these Porcelain commands > would be no-op, but --no-sparse-work-tree option would be useful to > ignore $GIT_DIR/info/sparse and populate the work tree fully. > > Or am I missing something? Sounds good (and --sparse-work-tree is apparently better than --sparse). So let's enable it by default, add --no-sparse-work-tree to disable it and wait until some one complains, then we'll add core.sparseworktree. I think core.sparseworktree can also be used to specify what spec file to be used instead of the default .git/info/sparse, if users like to switch among some well-defined spec files. -- Duy