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 a clone:

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

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

git surface --version
git-surface 0.2.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] 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.2.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.2.0
File Size Uploaded Provenance Actions
git_surface-0.2.0.tar.gz 43.4 kB With provenance Details for git_surface-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 67.4 kB

Release files / git_surface-0.2.0.tar.gz

Download URL git_surface-0.2.0.tar.gz
Size 43.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4771c3015e0bebf6e8bce985231c087146b7688a06a07f944730d5034d8e5716
BLAKE2b-256 checksum
How to use checksums
847f8dd0ea03d5bcc738a7f21be197fcd212aa7ba90417bf2b1635171beaf985
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 21, 2026.

Transparency log

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

Download URL git_surface-0.2.0-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28352c1ba9414a7396293d21344589121025b77f228a6c5f177c82f7fbc55029
BLAKE2b-256 checksum
How to use checksums
d549c0aff312fe9566f1cb039e30f322d9c1d83d3ceb848e4af8fb01be197182
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 21, 2026.

Transparency log

Security for git-surface 0.2.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.2.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 21, 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