Skip to main content

git-surface

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.

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.4.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.4.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.4.0
File Size Uploaded Provenance Actions
git_surface-0.4.0.tar.gz 52.1 kB With provenance Details for git_surface-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 78.8 kB

Release files / git_surface-0.4.0.tar.gz

Download URL git_surface-0.4.0.tar.gz
Size 52.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f73c381d9405a1e6c855a052ecbc899306f44573d137244b48fece7e12a63ab2
BLAKE2b-256 checksum
How to use checksums
7d390c7dc7a39dcd318d1faaf3f8edac22e72c498637711a9339be6ddbeffec2
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 26, 2026.

Transparency log

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

Download URL git_surface-0.4.0-py3-none-any.whl
Size 26.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3775c47c0ce8946e86db49e96eafc9a4ca51cf52ea4ddef6d8b44e6cad9d809d
BLAKE2b-256 checksum
How to use checksums
bf5cbe6b75ae34dcbd2aa73406a3edc4a9fc667ada650ed17d9b61a99ba95dff
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 26, 2026.

Transparency log

Security for git-surface 0.4.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.4.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 26, 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