On 9/23/08, Santi Béjar [off-list ref] wrote:
While I agree that the checkout attr looks like an attribute (so
reusing attr.c is a good idea) and $GIT_DIR/info/gitattributes seems a
good place to specify them, I think it will be better in the config
$GIT_DIR/config. There it is clear that it is a local thing and you
have "git config" to read and write them. Additionally you could have
different patterns in the config (sparse.default, sparse.doc,
sparse.src,...), although maybe it is not very useful.
I think the main UI to sparse checkout should be a default sparse
pattern that is used for "all" commands, like merge, reset, and
checkout. Now it is too easy to escape from the sparse checkout, when
you merge or checkout a branch with new files, when doing a "git reset
--hard" (when you abort a failed merge), or when doing a diff
(specially when you pull).
I have made a patch to save default sparse patterns, something to play
with so we can have better idea how to do it properly.
There is another option --default-sparse in "git clone" and "git
checkout". The option can be used to save default sparse patterns
(specified by --sparse-checkout in "git clone" or --reset-sparse in
"git checkout"). Something like this:
git clone --default-sparse --sparse-checkout=Documentation/ git.git
git checkout --default-sparse --reset-sparse=t/
Default sparse patterns will be used for other unpack_trees()-related
commands like reset, read-tree, merge, pull... For "git checkout" it
will only be used when neither --full, --reset-sparse,
--include-sparse nor --exclude-sparse is present. And it only applies
to newly-added files.
Patch series is in http://repo.or.cz/w/git/pclouds.git (branch
sparse-checkout). Note that it also incorporates fixes and some option
renames.
--
Duy