gittuf/pkg/gitinterface
Paulo Gomes 9e269f46fb
Introduce gitstore.Storer and make gittuf's core dependency-light
Restructure storage so gittuf verification can run over backends other
than the git binary (e.g. go-git):

- pkg/githash: concrete Git object hash, stdlib-only.
  gitinterface.Hash aliases it.
- pkg/gitstore: the single Storer interface (24 methods) that all
  storage consumers program against, plus the shared
  ErrReferenceNotFound sentinel. *gitinterface.Repository satisfies it
  structurally (compile-time asserted). Also defines ConfigKey, the
  canonical type for the Git config settings gittuf reads.
- pkg/rsl (from internal/rsl): entry model, codec, and readers over
  gitstore.Storer; zero gitinterface/sigstore dependencies. rsl.Hash
  aliases githash.Hash; nil is the unset-Hash sentinel and IsZero
  matches nil and empty as well as both format zeros (no
  object-format-unaware ZeroHash). Entry commits (empty tree on the
  RSL ref) are owned by the package; no storer adapter.
- internal/signerverifier/gitobject: verifies commit/tag signatures
  over (payload, signature) bytes, Rekor URL as an option. The storage
  half is Repository.GetObjectSignature. Removes sigstore, cosign, and
  gitsign from gitinterface's dependency tree.
- internal/propagation: propagation workflow, moved off pkg/rsl's
  public API (its tuf directive types are internal).
- internal/{attestations,cache,policy}: storage via gitstore.Storer;
  tree writing via WriteTree(blobs, subtrees).

Breaking changes to pkg/gitinterface: Repository.VerifySignature and
the verification sentinels are removed (use gitobject.Verify);
ErrReferenceNotFound now aliases gitstore's. Repository.GetGitConfig
(which returned the whole config map) is replaced by
LookupConfig(gitstore.ConfigKey), returning a single setting's value.
Policy resolves the Rekor override from git config once per
verification and extracts signed payloads once per object instead of
per key attempt.

Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Paulo Gomes <paulo@entire.io>
2026-08-03 21:27:49 +01:00
..
blob.go
blob_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30
changes.go
changes_test.go pkg/gitinterface: Add and refactor tests for coverage 2026-04-30 02:47:33 +05:30
commit.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
commit_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
common.go feat(sha256): support SHA-256 object format 2026-07-16 23:03:18 +01:00
common_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
config.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
config_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
hash.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
hash_test.go
log.go
log_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
object.go
object_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30
README.md
references.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
references_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
remote.go
remote_test.go
replace_ref_test.go gitinterface: ignore refs/replace/ in git invocations 2026-07-24 09:51:15 +01:00
repository.go gitinterface: ignore refs/replace/ in git invocations 2026-07-24 09:51:15 +01:00
repository_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
signature.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
signature_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
status.go pkg/gitinterface: remove os.Chdir; set cmd.Dir on the executor instead 2026-06-29 17:13:31 +01:00
status_test.go Merge pull request #1273 from ayuxsh009/fix/status-rename-parser 2026-04-29 20:24:55 +00:00
sync.go Block use of extensions.compatObjectFormat 2026-07-16 23:03:24 +01:00
sync_test.go feat(sha256): support SHA-256 object format 2026-07-16 23:03:18 +01:00
tag.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
tag_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
tree.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
tree_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
utils.go pkg/gitinterface: remove os.Chdir; set cmd.Dir on the executor instead 2026-06-29 17:13:31 +01:00
utils_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30

gittuf's gitinterface Package

gittuf's gitinterface package is a lightweight Go API for interacting with Git repositories. It is similar to go-git in its goal, but differs as, unlike go-git, gitinterface uses the Git binary for its operations.

To operate correctly, gitinterface requires a Git binary version of 2.34 or higher.