[core]
	hooksPath = /usr/pkg/share/tnfrepo/githooks

[fetch]
	# When fetching from the hg primary, we are acting as a cache,
	# so we should respect whatever has been pruned.
	prune = true
	pruneTags = true

[receive]
	# Atomic pushes can't currently be implemented in the bridge
	# back to hg.
	advertiseAtomic = false
	advertisePushOptions = true

	# Non-fast-forwards (forced updates) are allowed for drafts,
	# and while they're forbidden for public commits, they will be
	# rejected by the hg primary anyway so we need not reject them
	# here.
	denyNonFastforwards = false

[maintenance]
	# We will run maintenance ourselves via cron job, so don't do
	# it automatically after various git operations.
	auto = false

        # Use the built-in `incremental' strategy to tune what
	# maintenance tasks are run when rather than customize it
	# ourselves.  At time of writing (git 2.50.1) the tasks are:
	#
	#	- gc: disabled
	#	- commit-graph: hourly
	#	- prefetch: hourly
	#	- loose-objects: daily
	#	- incremental-repack: hourly
	#
	strategy = incremental

# Upload filter configuration.  See
# https://git-scm.com/docs/partial-clone/2.49.0 and
# https://web.archive.org/web/20260207065253/https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
# for details and background information.
[uploadpack]
	# Allow clients to do partial clone/fetch with blobless or
	# treeless filters at all.  This may incur some overhead on the
	# server side, however, so we restrict the allowed filters.
	#
	# Note that because using a partial clone (e.g., to check out a
	# working tree) may fetch objects that are not directly pointed
	# to by refs, we have to enable that on the server side.
	#
	# We could restrict clients to objects that are _indirectly_
	# reachable by refs with uploadpack.allowReachableSHA1InWant,
	# but reachability is expensive to compute, so we will use
	# uploadpack.allowAnySHA1InWant.  This means that we can't keep
	# some objects secret in an otherwise public repository, but
	# that's not really a big deal.
	allowFilter = true
	allowAnySHA1InWant = true
[uploadpackfilter "blob:none"]
	# Allow `git clone --filter=blob:none', blobless clones: these
	# start with the full history, and the list of file hashes for
	# each commit, but no file content.
	allow = true
[uploadpackfilter "tree"]
	# Allow `git clone --filter=tree:0', treeless clones: these
	# start with the full history, but no lists of file hashes for
	# each commit, and no file content.
	maxDepth = 0
[uploadpackfilter]
	# Forbid arbitrary upload filters.  Only those that are
	# explicitly allowed above will be allowed, in case other ones
	# impose costs we haven't thought of in advance.
	allow = false
