Foundry.GitVcs

g Foundry.Contextual Foundry.Contextual Foundry.Vcs Foundry.Vcs Foundry.Contextual->Foundry.Vcs Foundry.GitVcs Foundry.GitVcs Foundry.Vcs->Foundry.GitVcs GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

None

Methods

Inherited:

Foundry.Vcs (23), Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

GObject.ObjectClass (5)

commit (message, author_name, author_email)

list_status ()

query_config (key)

sign_bytes (signing_format, signing_key, bytes)

stage_entry (entry, contents)

stash ()

unstage_entry (entry)

Virtual Methods

Inherited:

Foundry.Vcs (21), GObject.Object (7), Json.Serializable (5)

Properties

Inherited:

Foundry.Vcs (6), Foundry.Contextual (1)

Signals

Inherited:

Foundry.Vcs (1), GObject.Object (1)

Fields

Inherited:

Foundry.Vcs (1), GObject.Object (1)

Class Details

class Foundry.GitVcs(**kwargs)
Bases:

Foundry.Vcs

Abstract:

No

Structure:

Foundry.GitVcsClass

Git implementation of the version control system interface.

Foundry.GitVcs provides Git-specific functionality for version control operations including repository management, branch operations, and remote synchronization. It integrates with the Git library to provide a unified interface for Git operations within the Foundry development environment.

commit(message, author_name, author_email)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.GitCommit] or rejects with error.

Return type:

Dex.Future

Simple API to create a new commit from the index.

list_status()
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.GitStatusEntry].

Return type:

Dex.Future

query_config(key)
Parameters:

key (str) – the config key to query

Returns:

a [class`Dex`.Future] that resolves to a string containing the config value, or rejects with an error if the key is not found or an error occurs

Return type:

Dex.Future

Queries a git configuration value by key from the repository.

The method runs asynchronously in a background thread and returns a [class`Dex`.Future] that resolves to the config value as a string.

New in version 1.1.

sign_bytes(signing_format, signing_key, bytes)
Parameters:
  • signing_format (str) – the format such as “gpg” or “ssh” such as from the config value for “gpg.format”.

  • signing_key (str) – the signing key to use such as from the config value for “user.signingKey”

  • bytes (GLib.Bytes) – the bytes to sign

Returns:

a [class`Dex`.Future] that resolves to a armor contained string.

Return type:

Dex.Future

Signs bytes using the format and key specified.

Use [method`Foundry`.GitVcs.query_config] to get the

New in version 1.1.

stage_entry(entry, contents)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

stash()
Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.GitCommit] representing the stash commit or rejects with error.

Return type:

Dex.Future

Stashes the current working directory changes.

This method saves the current changes in the working directory to the stash, similar to running “git stash”. The changes are saved with the default stash options.

New in version 1.1.

unstage_entry(entry)
Parameters:

entry (Foundry.GitStatusEntry) – a [class`Foundry`.GitStatusEntry]

Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future