Re: [PATCH v2 00/14] Sparse checkout
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 20, 2008, 19:48 UTC
- Message-ID
- <fcaeb9bf0809201248w2850a243n50596dda3121f2c@mail.gmail.com>
- In-Reply-To
- <200809202001.28383.jnareb@gmail.com>
On 9/21/08, Jakub Narebski <jnareb@gmail.com> wrote:
Show 19 quoted lines
> > "--reset-path", I think, is a better name though. It would express the
> > relation compared to --add-path and --remove-path.
>
>
> I don't like very much '--reset-path' option name, because it is not
> about 'reset' or 'resetting', but about limiting checkout to specified
> paths. Unfortunately --include / --exclude looks like are for ignoring
> files, not marking files with "no-checkout" bit etc.
>
> But I am not native English speaker.
>
> Further proposals: --only ("git checkout --only <pattern>") with
> --checkout-only as counterpart in git-clone; --limit-to, --sparse.
>
>
> GNU tar uses --exclude and --exclude-file (with --no-recurse,
> --no-wildcards, --no-wildcards-match-slash). wget uses --accept
> and --reject for filename patterns, and --include / --exclude for
> directories. Neither looks right for sparse checkout in Git.I think --exclude and --include are quite good. With Junio's suggestion "foo-X", how about this?
git clone --sparse-checkout=<patterns> [1] git checkout --set-sparse=<patterns> git checkout --include-sparse=<patterns> git checkout --exclude-sparse=<patterns> [2]
[1] "checkout" is there to avoid being interpreted as "sparse clone" [2] --narrow-sparse IMO does not tell how the following patterns are used (is it the set that will be excluded or the target set?), "exclude" does better.
Show 7 quoted lines
> >> BTW I think that the same rules are used in gitattributes, aren't > >> they? > > > > They have different implementations. Though the rules may be the same. > > > Were you able to reuse either one?
No. .gitignore is tied to read_directory() while .gitattributes has attributes attached. So I rolled out another one for index.
-- Duy