Implement embedded HTTPS Git and synchronization #10

Closed
opened 2026-08-09 18:57:04 +00:00 by hugo · 1 comment
Owner

Objective

Implement all pass-relevant Git behavior as an embedded Rust engine with HTTPS-only transport.

Scope

  • Initialize or open repositories, including the innermost repository selection used by pass.
  • Stage and commit every successful storage mutation with compatible intent and no commit on no-op or failure.
  • Support the pass git workflow surface needed for init, status, log, diff, add, commit, remote/config inspection and mutation, fetch, pull/merge, push, and synchronization.
  • Clone/open a configured remote into the vault path and expose typed merge conflicts for callers.
  • Reject SSH, git, file, local-path, helper, and unknown remote schemes before entering transport.
  • Retrieve HTTPS credentials by server ID and application ID; support optional GPG-compatible commit signing without external programs.

Acceptance criteria

  • Tests use local HTTPS fixtures or an injected transport and cover clone, init, automatic commits, pull/push, auth failure, non-fast-forward updates, conflicts, nested repositories, and forbidden schemes.
  • No Git executable, credential helper, SSH agent, or shell is launched.
  • Generic arbitrary Git executable passthrough is not attempted; unsupported pass git arguments fail explicitly.

Prerequisites

Safe password-store core; embedded GPG-compatible cryptography; secure secret storage.

## Objective Implement all pass-relevant Git behavior as an embedded Rust engine with HTTPS-only transport. ## Scope - Initialize or open repositories, including the innermost repository selection used by pass. - Stage and commit every successful storage mutation with compatible intent and no commit on no-op or failure. - Support the `pass git` workflow surface needed for init, status, log, diff, add, commit, remote/config inspection and mutation, fetch, pull/merge, push, and synchronization. - Clone/open a configured remote into the vault path and expose typed merge conflicts for callers. - Reject SSH, git, file, local-path, helper, and unknown remote schemes before entering transport. - Retrieve HTTPS credentials by server ID and application ID; support optional GPG-compatible commit signing without external programs. ## Acceptance criteria - Tests use local HTTPS fixtures or an injected transport and cover clone, init, automatic commits, pull/push, auth failure, non-fast-forward updates, conflicts, nested repositories, and forbidden schemes. - No Git executable, credential helper, SSH agent, or shell is launched. - Generic arbitrary Git executable passthrough is not attempted; unsupported `pass git` arguments fail explicitly. ## Prerequisites Safe password-store core; embedded GPG-compatible cryptography; secure secret storage.
hugo added this to the 01 - Full Rust pass CLI parity milestone 2026-08-09 18:57:04 +00:00
hugo added the enhancement label 2026-08-09 18:57:04 +00:00
Author
Owner

Implemented and pushed in commit 75ce19d.

Implementation:

  • Added storage-owned embedded Git repository operations for init/open/status/log/diff/stage/commit/remotes/local config.
  • Added HTTPS-only fetch, pull, merge, push, sync, and atomic clone with server/application-scoped credentials and no executable helpers.
  • Added fast-forward and three-way merge handling with typed conflicts, non-fast-forward rejection, receive-pack status validation, complete pack generation, and optional GPG-compatible signed commits.
  • Wired successful entry, policy, remove, move, and copy mutations to exact-path automatic commits while preserving unrelated staged changes.
  • Reproduced upstream pass init commits and .gitattributes behavior without external git, gpg, pass, or shell processes.

Verification:

  • cargo test -p ironstorage --test git_embedded --test compatibility_fixtures --test repository_core --test tree_mutations
  • cargo fmt --all -- --check
  • RUSTFLAGS=-D warnings cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

All issue-specific tests, related pre-created compatibility fixtures, and required workspace gates pass.

Implemented and pushed in commit 75ce19d. Implementation: - Added storage-owned embedded Git repository operations for init/open/status/log/diff/stage/commit/remotes/local config. - Added HTTPS-only fetch, pull, merge, push, sync, and atomic clone with server/application-scoped credentials and no executable helpers. - Added fast-forward and three-way merge handling with typed conflicts, non-fast-forward rejection, receive-pack status validation, complete pack generation, and optional GPG-compatible signed commits. - Wired successful entry, policy, remove, move, and copy mutations to exact-path automatic commits while preserving unrelated staged changes. - Reproduced upstream pass init commits and .gitattributes behavior without external git, gpg, pass, or shell processes. Verification: - cargo test -p ironstorage --test git_embedded --test compatibility_fixtures --test repository_core --test tree_mutations - cargo fmt --all -- --check - RUSTFLAGS=-D warnings cargo check --workspace --all-targets - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace All issue-specific tests, related pre-created compatibility fixtures, and required workspace gates pass.
hugo closed this issue 2026-08-09 23:54:43 +00:00
Sign in to join this conversation.