-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Michał Górny: > > Single branch clone ------------------- > > - git-2 eclass behavior, > > - only requested branch (or tag) is fetched, and tags on the > commits fetched as part of the branch/tag history, > > - git notes are fetched, > > - EGIT_COMMIT can only name a commit in the fetched EGIT_BRANCH, > > - pruning unused branches/tags is hard (and possibly won't be > implemented at first), > > - more efficient than the mirror mode, most likely future default. >
I agree this should probably be the default. > > Shallow clone ------------- > > - similar to old git-r3 behavior, > > - minimal number of objects from the requested branch (or tag) is > fetched, > > - branch/tag history is not preserved, > > - git notes are not fetched, > > - EGIT_COMMIT can only name tags (using a hash auto-forces higher > mode), > > - changing branches may be very inefficient (since it implies > re-fetching all objects implied by --depth 1), > > - since the history is truncated, 'git describe' won't give pretty > names, > > - most space-saving, intended for embedded and other special use > cases, > > - does not guarantee repository consistency -- unsafe. > > > Control variables ----------------- > > I'm thinking of two control variables (better names appreciated): > > - EGIT_CLONE_MODE - set in make.conf by user to requested clone > mode, > > - EGIT_MIN_CLONE_MODE - optionally set by ebuilds that require > more. > Not a native english speaker, but EGIT_CLONE_TYPE and EGIT_MIN_CLONE_TYPE sounds more natural to me. > > > Mode upgrades and downgrades ---------------------------- > > Mode is not associated persistently with a repository. Therefore, > using a repository in a different mode than it was used before > (e.g. due to different ebuild or user preference change) results in > mixed-mode repository. > > When mirror or single-branch mode is used on a shallow repository, > the repository is still marked 'shallow' even if the full history > is available. I don't know if this wouldn't break some of 'git foo' > uses in the checkout but that probably can't be predicted. > Moreover, I don't know if it is safe to remove 'shallow' after > doing full-fetch in mirror mode. > > When single-branch or shallow mode is used on a mirror-mode > repository, only the requested branch/tag is updated. The > repository may no longer be correctly synced to the remote. > > When shallow mode is used on *existing* branch or tag in a > mirror-mode or single-branch repository, new commits are fetched > as in single-branch mode. When shallow mode is used on *new* > branch or tag, the commits are fetched with '--depth 1' and the > clone is marked 'shallow'. > > I am not sure if I understand this correctly, but it sounds like it would be safer to rm -rf the old checkout completely when switching modes? I wouldn't expect people to randomly switch around, so why bother. Anyway, sounds like a plan. -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJTC8piAAoJEFpvPKfnPDWzW8QIAKzLjBoX2n57U7/U/elvehCB VokcOUHIY/29Bl016POLOXo4Uuy7nuwzDVl9FwJ1AkLp5ILWMJsUYpo/h0Od9J+8 qN5XZ75R6FkiQB30xlyM4Lxer3jFyd2d+tna3vITBEJX//iZ4SagtufnjUNiLnZo qcss6kKCmg5/MzD133qkpkpBV8lP7HAHi4hDu5Q6GtHjRcXGykfhBlvte+27NR73 O2cATlAqIZHW1Kbzw7WdkRiPhAXmOKYXlQ2oEs9kG+QULrCzBxQ3hs+fJLZMzAYf e2TKVidvYKFjUqc7LN4/dgfY+38WadTPlqTBeCEiLluoWrEJ0POQjCA+2smoTfs= =kRD8 -----END PGP SIGNATURE-----
