Skip to content

Subtree clone?

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2upload-pack: support subtree packingupload-pack.c+30 -17 replies
2/2fetch-pack: support --subtree and --commit-subtree optionsbuiltin/fetch-pack.c+15 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Subtree clone?

This idea sounds quite nice to me. That is, instead of modifying git core to support narrow/partial clone, {upload,fetch}-pack is modified to give clients enough objects of so it can reconstruct a valid tree. Users are free to do whatever they want on that tree. When they want to push changes back, Git client creates proper commit/tree objects and push.

The two patches in this series allow git to send objects of a subtree to client, or just a barebone subtree without blobs. The client can rewrite commits and throw the old commits.

I don't want to add much computation to server side, subtree looks like a good fit (i.e. simply prefixcmp). Sparse checkout can then be used to shape worktree if subtree is not good enough.

All the hard work is at client side, and git-subtree is a good candidate. Well, the idea is inspired by recent discussions of git-subtree vs git-submodule anyway.

Lazy clone does something similar. However lazy clone requires connectivity to upstream. Lazy clone also exposes a security issue, allowing client to get any object it wants.

Comments?

Nguyễn Thái Ngọc Duy (2):
upload-pack: support subtree packing
fetch-pack: support --subtree and --commit-subtree options

 builtin/fetch-pack.c |   15 +++++++++++++++
 upload-pack.c        |   31 ++++++++++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)