Skip to main content

git-surface

PyPI Python Licence

git-surface is one git command, git surface. Installing it puts git-surface on your PATH; git runs any git-NAME program on PATH as git NAME, so no configuration is needed.

When many branches arrive at once, many of them written by coding agents, a reviewer needs to know which ones change something that runs or is trusted: a CI workflow, a git hook, an install script, a dependency, a build file, or text that hides content from a human reader. Text in an issue or pull request can steer an agent into exactly such a change, and malicious packages spread through install scripts and new dependencies. git surface lists, for each branch, every change of that kind, so those branches get a closer look.

It only reports. It does not block, score or rewrite anything; what to do with a report is up to whoever runs it.

It is one of six audit tools that print the same result format with --audit-json. suite-gate runs them together and gives one verdict per branch, as a command, a GitHub Action or an MCP server for coding agents.

Example output

A demo repository in which one branch adds an agent instruction file, a CI workflow, a package.json with a postinstall script, and edits app.py; a second branch only edits app.py, so it is not reported:

git surface listing four changes on one branch

The same branch with --audit-json (first lines of the result):

git surface --audit-json output

Requirements

  • Python 3.9 or later, standard library only.
  • git 2.38 or later, as an executable named git on PATH.

Install

From PyPI:

pip install git-surface

From a clone:

git clone https://github.com/jacob-adm/git-surface
cd git-surface
pip install .

Either way pip installs git-surface as a console script. Check the install:

git surface --version
git-surface 0.5.0

Use -h for usage: git surface --help is answered by git itself, which looks for a manual page. Without installing, it also runs from a clone as python3 -m git_surface.

How it works

  1. List the branches. Pipe the branch names in, one per line. Only the first TAB-separated field of each line is read, so the output of git footprint BASE (from git-overlap) pipes straight in too.
  2. Diff each branch against BASE. For each branch, git surface BASE compares the branch with its merge base with BASE: the same changes a pull request's "files changed" shows. Changes BASE made after the branch left it are not the branch's.
  3. Classify each changed path. By its name, a path may be ci, hook, agent, repo, install, deps or exec; a file that becomes executable is exec too. package.json, pyproject.toml and requirements*.txt are read to name added and removed dependencies, version changes and changed install steps.
  4. Check the added lines. Only lines the branch adds are read. An HTML tag such as <img> or <script>, or an HTML comment, on an added line of a Markdown file, or an invisible or bidirectional Unicode character on an added line of any text file, is hidden.
  5. Read the report. One line per finding, ref TAB class TAB detail TAB path. Like grep, the command exits 1 when it reports something, 0 when it reports nothing and 2 on an error.

The full list of classes and rules is in Classes.

Commands

git surface [-z] [--json | --audit-json] BASE < refs   report what each ref changes that runs or is trusted

See Commands for the input, output, options and exit status.

Quick start

Inside the repository to check, list the branches one per line and pipe them in. Replace main with the base branch and refs/heads/agent/ with the refs to check, for example refs/remotes/origin/ for every branch fetched from origin.

git for-each-ref --format='%(refname:short)' refs/heads/agent/ | git surface main
agent/ci	ci	M	.github/workflows/test.yml
agent/ci	exec	A +x	scripts/release.sh
agent/deps	deps	M +left-pad	package.json
agent/deps	install	M scripts.postinstall	package.json
agent/docs	hidden	<!-- line 4	README.md
agent/docs	hidden	<img line 5	README.md

agent/ci changes a workflow and adds an executable script. agent/deps adds the dependency left-pad and a postinstall script. agent/docs adds an HTML comment and an image tag to the README, neither of which shows when the Markdown is rendered. A fourth branch, agent/fix, only changes application code, so it has no line.

Documentation

License

Apache License 2.0; see LICENSE.

Metadata

Release files for git-surface 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-surface 0.5.0
File Size Uploaded Provenance Actions
git_surface-0.5.0.tar.gz 62.2 kB With provenance Details for git_surface-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git-surface 0.5.0
File Interpreter ABI Platform Actions
git_surface-0.5.0-py3-none-any.whl Python 3 none any Details for git_surface-0.5.0-py3-none-any.whl

Total release size: 91.1 kB

Release files / git_surface-0.5.0.tar.gz

Download URL git_surface-0.5.0.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
628811404b3cf54c4845ab87be40cc131753a7a3fd760ab38df0338ba9b7d8d8
BLAKE2b-256 checksum
How to use checksums
86dda32595455085736aaddc97ca97f56738c4536a30c25cbfa5e3f3591d13c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / git_surface-0.5.0-py3-none-any.whl

Download URL git_surface-0.5.0-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30613d81182d10c8f59d2565239823e87d12cd564780e1ca3122a297f6a51bee
BLAKE2b-256 checksum
How to use checksums
c976bddf7dc8cb3e5b5e4bae9d0ceccd848a39d54b7e8b3a29921654f3834c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for git-surface 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for git_surface-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page