Re: [RFC PATCH v3 8/8] --sparse for porcelains
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Aug 12, 2009, 10:01 UTC
- Message-ID
- <fcaeb9bf0908120301q17812b5cw5e19def7887d31db@mail.gmail.com>
- In-Reply-To
- <7v3a7xa6e5.fsf@alter.siamese.dyndns.org>
2009/8/12 Junio C Hamano <gitster@pobox.com>:
Show 11 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> 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.
Show 8 quoted lines
> 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