Clarify materialized limit flag semantics · Entire
Clarify materialized limit flag semantics
ecd3908→main·
Soph·3mo ago·2 files·+3 added/-3 removed
Sessions
e32d96585b91View transcript
Changes
2
MREADME.md+2/-2
cmd/git-sync
Mmain.go+1/-1
74 unmodified lines
75
76
77
78
78
79
80
81
116 unmodified lines
198
199
200
201
201
202
203
204
74 unmodified lines
- Ref mapping is explicit, not wildcard-based.
- Only smart HTTP remotes are supported.
- Objects are kept in memory for the duration of the run.
- Non-relay materialized syncs are bounded by `--materialized-max-objects` and fail clearly when they exceed that limit.
- Non-relay materialized syncs are bounded by `--materialized-max-objects`, an object-count guardrail for the in-memory fallback path.
## Quick Start
116 unmodified lines
`sync` also uses a narrow incremental relay path for fast-forward branch updates and tag creation when there is no prune/delete, no force, and the target does not advertise `no-thin`. This now includes multi-branch batches, branch-to-branch mappings, and create-only tags. Tag retargeting and other more complex updates still fall back to the normal local decode-and-repack path.
If `sync` falls back to the materialized path, `--materialized-max-objects` sets an explicit safety bound for the in-memory object set. The default is conservative; raise it only when you intend to trade memory headroom for broader non-relay coverage.
If `sync` falls back to the materialized path, `--materialized-max-objects` sets an explicit object-count safety bound for the in-memory object set. It is a conservative guardrail, not a precise heap-size limit.
Sync specific branches:
MREADME.md+2/-2
351 unmodified lines
352
353
354
355
355
356
357
358
351 unmodified lines
}
func usageError(message string) error {
usage := "usage:\n git-sync sync [flags] <source-url> <target-url>\n git-sync plan [flags] <source-url> <target-url>\n git-sync bootstrap [flags] <source-url> <target-url>\n git-sync probe [flags] <source-url> [target-url]\n git-sync fetch [flags] <source-url>\n\nsync/plan flags:\n --branch main,dev\n --map main:stable\n --tags\n --force\n --prune\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --source-token ...\n --target-token ...\n --source-username git\n --target-username git\n --source-bearer-token ...\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n -v\n\nbootstrap flags:\n --branch main,dev\n --map main:stable\n --tags\n --max-pack-bytes 104857600\n --batch-max-pack-bytes 1073741824\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --source-token ...\n --target-token ...\n --source-username git\n --target-username git\n --source-bearer-token ...\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n -v\n\nprobe flags:\n --tags\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --source-token ...\n --source-username git\n --source-bearer-token ...\n --target-token ...\n --target-username git\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n\nfetch flags:\n --branch main,dev\n --tags\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --have-ref main\n --have <hash>\n --source-token ...\n --source-username git\n --source-bearer-token ...\n --source-insecure-skip-tls-verify\n"
usage := "usage:\n git-sync sync [flags] <source-url> <target-url>\n git-sync plan [flags] <source-url> <target-url>\n git-sync bootstrap [flags] <source-url> <target-url>\n git-sync probe [flags] <source-url> [target-url]\n git-sync fetch [flags] <source-url>\n\nsync/plan flags:\n --branch main,dev\n --map main:stable\n --tags\n --force\n --prune\n --stats\n --measure-memory\n --json\n --materialized-max-objects 500000\n --protocol auto|v1|v2\n --source-token ...\n --target-token ...\n --source-username git\n --target-username git\n --source-bearer-token ...\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n -v\n\nbootstrap flags:\n --branch main,dev\n --map main:stable\n --tags\n --max-pack-bytes 104857600\n --batch-max-pack-bytes 1073741824\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --source-token ...\n --target-token ...\n --source-username git\n --target-username git\n --source-bearer-token ...\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n -v\n\nprobe flags:\n --tags\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --source-token ...\n --source-username git\n --source-bearer-token ...\n --target-token ...\n --target-username git\n --target-bearer-token ...\n --source-insecure-skip-tls-verify\n --target-insecure-skip-tls-verify\n\nfetch flags:\n --branch main,dev\n --tags\n --stats\n --measure-memory\n --json\n --protocol auto|v1|v2\n --have-ref main\n --have <hash>\n --source-token ...\n --source-username git\n --source-bearer-token ...\n --source-insecure-skip-tls-verify\n"
if message == "" {
return errors.New(strings.TrimSpace(usage))
}
}