Skip to content

git: add native version control and HTTP transport#19

Open
brandonpayton wants to merge 9 commits into
mainfrom
migrate/git-cli
Open

git: add native version control and HTTP transport#19
brandonpayton wants to merge 9 commits into
mainfrom
migrate/git-cli

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Make Git 2.47.1 a first-class Kandelo Homebrew package, with its normal command, template, pager, editor, shell, local-clone, documentation, and HTTP/HTTPS workflows. This replaces the old registry package without reducing Git to a two-binary demo or hiding platform failures in wrappers.

Formula contract

  • Builds the exact kernel.org Git 2.47.1 source with the Kandelo SDK.
  • Installs git, upload/receive aliases, HTTP/HTTPS/FTP remote-helper aliases, git-sh-i18n--envsubst, the supported upstream shell commands and libraries, mergetool resources, templates, and the exact upstream 2.47.1 manpage set.
  • Declares the complete runtime closure used by those paths: Coreutils, Dash, Diffutils, grep, Less, libcurl, OpenSSL, sed, Vim, and zlib.
  • Compiles gitexecdir and template_dir to the stable guest opt/git paths. The test does not override GIT_EXEC_PATH or GIT_TEMPLATE_DIR, so git init and nested command dispatch exercise the installed contract.
  • Separates the host build shell from Git's recorded guest Dash path through a narrow upstream Makefile portability patch.
  • Fork-instruments all three linked Wasm programs and validates each through the shared fork: :required artifact contract.
  • Truthfully disables optional Perl, Python, Tcl/Tk, gettext, Expat, and WebDAV executables not included in this Formula. The complete upstream manual is retained as version-matched reference documentation, following Homebrew's Git resource model.
  • Exercises init/add/commit/log, file:// clone, submodule dispatch, nested shell aliases, Less pagination, mergetool discovery, the complete Vim editor runtime, envsubst, remote-helper capabilities, and HTTPS transport.

Source validation

Exact audited head: 700c1f6b9543c77516b9e9dab5c9f0de1c33c5bc (tree 9097ce358777c141e5cdced2db96bda672bad9aa; Formula SHA-256 7981bfff16c550477eb21f2434a290740d86db1de337617f375f3528b523e50f).

  • Verified the exact Git source archive SHA-256 (f3d8f9bb23ae392374e91cd9d395970dabc5b9c5ee72f39884613cd84a6ed310) and inspected the extracted 4,527-file source tree.
  • Verified the exact manpage archive SHA-256 (ffc2005a89b056c0727b667f6beda0068371619762ea4844ad0229091befee13), its Git 2.47.1 identity, 198 regular 0644 files, safe member paths, and absence of symlinks or host paths.
  • The license expression matches the delivered source tree's GPL-2.0-only, GPL-2.0-or-later, LGPL-2.1-or-later, BSD-3-Clause, and MIT inputs.
  • A dev-shell Make dry run emitted the exact compiled definition DEFAULT_GIT_TEMPLATE_DIR=/home/linuxbrew/.linuxbrew/opt/git/share/git-core/templates.
  • Formula Ruby syntax, git diff --check, the 120-column check, and the package rootfs-size test (5/5) passed for this audit.
  • Independent static devil's-advocate review: ACCEPT.

The previous branch head passed the shared support suite (37 runs, 279 assertions) and brew style, but those results are not claimed for this changed head. No fresh Git source build, bottle, brew readall/style run, stock-Homebrew pour, Node runtime, or Chromium runtime is claimed yet.

Platform gate

The full upstream mergetool surface exposed a real continuation-capacity failure. Four nested Dash children require 17,260-17,444 continuation bytes, exceeding the current 16,384-byte fork-save reserve by 876-1,060 bytes. PR #907 makes that overrun fail truthfully but intentionally does not increase capacity. Git therefore must not publish from ABI 39.

After #907 merges, a reviewed successor to #862 must land in the next ABI epoch, and Dash must be rebuilt with elastic continuation-frame accounting enabled. This Formula's exact git mergetool --tool-help regression then has to pass against that rebuilt Dash bottle. The Formula contains no source workaround for the kernel/instrumentation limit.

The final build also requires the platform changes carried by #842, #873, #874/#883, #882, #888/#889, and #903 (or reviewed equivalents rebased into the final ABI line). In particular, #842 owns the SDK's 8 MiB linked-program shadow stack; the Formula intentionally does not hide that platform requirement with a Git-only linker flag.

Dependency and publication gates

Do not merge or publish this Formula until all ten declared dependency Formulae have landed and their exact final-ABI bottles have been built and poured first: Coreutils, Dash, Diffutils, grep, Less, libcurl, OpenSSL, sed, Vim, and zlib. Coreutils (#16), Diffutils (#21), and Vim (#36) remain open; the other direct Formulae are on tap main. Git must be source-built against those poured bottles through the dependency-first publisher contract.

Trusted publication remains gated on the main-repository publisher stack (#881 -> #887 -> #890 -> #885 -> #900 -> #910), tap branch-build gate #22, anonymous digest readback from the public GHCR package, and matching bottle/sidecar provenance. The resulting Git bottle must be force-poured through stock Homebrew inside Kandelo and the exact installed package exercised on both Node and Chromium.

Registry archives, historical ABI 18 artifacts, ABI 39 artifacts, review-keg hashes, and bottles built before the final dependency chain are not publication inputs. The Formula intentionally has no bottle block yet.

@brandonpayton

Copy link
Copy Markdown
Member Author

Independent devil's-advocate review completed against original head 0c97e68; corrections are pushed in f83dd30.

Review findings fixed in the tap:

  • restored the normal Git command/resource surface instead of shipping only git and git-remote-http;
  • added the missing git-upload-pack/receive aliases, with an exact file:// clone test;
  • added and tested git-sh-i18n--envsubst, shell command dispatch, and nested Git/Dash re-exec;
  • declared Coreutils, grep, and sed as direct script-runtime dependencies;
  • separated target CLI opt/bin paths from host build-tool PATH;
  • moved internal executable and non-executable resources to libexec/git-core, satisfying strict audit;
  • removed embedded-patch whitespace.

Exact final source build and literal Homebrew test pass. Ruby syntax, style, strict online audit, diff --check, and fork-artifact guards pass.

Do not merge yet. The full upstream git mergetool --tool-help path revealed a main-platform ABI/layout blocker. Four nested Dash unwinds require 17,420, 17,444, 17,260, and 17,284 bytes against the 16,384-byte fork buffer, then trap during child replay. The preceding cursor is 15,472 bytes. This is the fixed continuation-buffer limit tracked by Automattic/kandelo#845, not a formula defect; #845 detects it but does not grow the buffer. Growing it requires a deliberate ABI/layout change and rebuilt artifacts after ABI 18. The PR body now records the evidence and gate.

@brandonpayton brandonpayton force-pushed the migrate/git-cli branch 2 times, most recently from cbdfc94 to 892ed65 Compare July 12, 2026 08:57
@brandonpayton brandonpayton changed the base branch from main to migrate/coreutils-cli July 12, 2026 08:57
@brandonpayton brandonpayton force-pushed the migrate/coreutils-cli branch 4 times, most recently from b7f4ed8 to e8c3f61 Compare July 12, 2026 20:50
@brandonpayton brandonpayton changed the base branch from migrate/coreutils-cli to main July 13, 2026 03:29
Exercise Git's compiled exec and template paths instead of overriding them in the formula test, and make the known mergetool continuation path a required regression check. Install the exact upstream manpages and describe the source tree's complete license set.
@brandonpayton

Copy link
Copy Markdown
Member Author

Devil's-advocate audit found and fixed a masked compiled-path bug in 700c1f6b9543c77516b9e9dab5c9f0de1c33c5bc.

uname_S=Wasm32 does not enable upstream Git's RUNTIME_PREFIX. With the default relative template_dir=share/git-core/templates, Git therefore resolved templates through its compiled fallback prefix as /home/linuxbrew/.linuxbrew/share/git-core/templates, while the Formula's installed/staged contract is /home/linuxbrew/.linuxbrew/opt/git/share/git-core/templates. The old test supplied GIT_TEMPLATE_DIR, so it could not detect the mismatch.

The Formula now passes the stable guest opt/git template path to Make, removes both path environment overrides, and gives Git its real guest argv[0]. A dev-shell Make dry run confirms the resulting exact DEFAULT_GIT_TEMPLATE_DIR definition, and git init remains the runtime regression once the final ABI/dependency bottles are available.

This review does not claim a fresh source build, bottle, stock-Homebrew pour, Node run, or Chromium run for the changed head; those remain explicit platform and publisher gates in the PR body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant