Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

clone_options: CloneOptions
g_type_instance: TypeInstance
head: Ggit.Ref
is_bare: boolean
location: Gio.File
name: string
native: object
parent_instance: any
stage: Gitg.Stage
url: string
workdir: Gio.File
name: string

Methods

  • add_remote_fetch(remote: Ggit.Remote, refspec: string): void
  • Adds a fetch refspec to the remote's configuration. Adds refspec to the fetch list in the configuration. No loaded remote instances will be affected.

    Parameters

    • remote: Ggit.Remote

      a #GgitRemote.

    • refspec: string

      the fetch refspec.

    Returns void

  • add_remote_push(remote: Ggit.Remote, refspec: string): void
  • Adds a push refspec to remote's configuration. Adds the given refspec to the push list in the configuration. No loaded remote instances will be affected.

    Parameters

    • remote: Ggit.Remote

      a #GgitRemote.

    • refspec: string

      the push refspec.

    Returns void

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transform_to: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transform_from: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • Update files in the working tree to reflect the contents of current HEAD. If options is %NULL, then the default checkout options will be used.

    If the checkout was not successfull, then error will be set.

    Parameters

    Returns boolean

  • Update files in the working tree to reflect the contents of the index. If index is %NULL, then the current index of the repository will be used. If options is %NULL, then the default checkout options will be used.

    If the checkout was not successfull, then error will be set.

    Parameters

    Returns boolean

  • Update files in the working tree to reflect the contents of the specified commit, tag or tree object. If tree is %NULL, then the current HEAD of the repository will be used. If options is %NULL, then the default checkout options will be used.

    If the checkout was not successfull, then error will be set.

    Parameters

    Returns boolean

  • clear_refs_cache(): void
  • connect_after(sigName: "notify::name", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::stage", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::clone-options", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::head", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::init", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::is-bare", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::location", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::url", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::workdir", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: "notify::native", callback: (($obj: Gitg.Repository, pspec: ParamSpec) => void)): number
  • connect_after(sigName: string, callback: ((...args: any[]) => void)): number
  • Create a new blob and return a #GOutputStream to write contents to the blob. This is an efficient way to create new blobs without copying data. The blob id can be obtained from the blob output stream using #ggit_blob_output_stream_get_id, after you close the stream.

    Returns BlobOutputStream

  • create_blob_from_buffer(buffer: Uint8Array): OId
  • create_blob_from_path(path: string): OId
  • Create a new commit. If update_ref is not %NULL, the given reference will be updated to point to the newly created commit. Use "HEAD" to update the HEAD of the current branch and make it point to this commit.

    If message_encoding is set to %NULL, "UTF-8" encoding is assumed for the provided message. Note that message will not be cleaned up automatically. You can use #ggit_message_prettify to do this yourself if needed.

    Parameters

    • update_ref: string

      name of the reference to update.

    • author: Ggit.Signature

      author signature.

    • committer: Ggit.Signature

      committer signature (and time of commit).

    • message_encoding: string

      message encoding.

    • message: string

      commit message.

    • tree: Ggit.Tree

      the tree of objects to commit.

    • parents: Ggit.Commit[]

      parent commits.

    Returns OId

  • Create a new commit. If update_ref is not %NULL, the given reference will be updated to point to the newly created commit. Use "HEAD" to update the HEAD of the current branch and make it point to this commit.

    If message_encoding is set to %NULL, "UTF-8" encoding is assumed for the provided message. Note that message will not be cleaned up automatically. You can use #ggit_message_prettify to do this yourself if needed.

    Parameters

    • update_ref: string

      name of the reference to update.

    • author: Ggit.Signature

      author signature.

    • committer: Ggit.Signature

      committer signature (and time of commit).

    • message_encoding: string

      message encoding.

    • message: string

      commit message.

    • tree: OId

      the tree of objects to commit.

    • parents: OId[]

      parent commits.

    Returns OId

  • Create a new index entry. When file is not %NULL, the path of the returned entry (#ggit_index_entry_get_path) is set to the path of file relative to the working directory of repository. The file must reside in the working directory of repository. The file related fields of the returned entry are also queried from this file (if the file exists).

    If id is not %NULL, then the id of the returned entry is set to id (see #ggit_index_entry_get_id) which could point to a blob (for a file) or a tree (for a directory).

    Parameters

    Returns Ggit.IndexEntry

  • Create a new index entry. When path is not %NULL, the path of the returned entry (#ggit_index_entry_get_path) is set to path. The specified path can be either absolute or relative. In the case of an absolute path, the path must reside within the working directory of repository. The file related fields of the returned entry are also queried from this path (if the file exists).

    If id is not %NULL, then the id of the returned entry is set to id (see #ggit_index_entry_get_id) which could point to a blob (for a file) or a tree (for a directory).

    Parameters

    • path: string

      a path.

    • id: OId

      a #GgitOId.

    Returns Ggit.IndexEntry

  • Adds a note for an object.

    Parameters

    • notes_ref: string

      canonical name of the reference to use, or %NULL to use the default ref.

    • author: Ggit.Signature

      author signature.

    • committer: Ggit.Signature

      committer signature.

    • id: OId

      OID of the git object to decorate.

    • note: string

      content of the note to add for object oid.

    • force: boolean

      whether to overwrite existing note.

    Returns OId

  • create_reference(name: string, oid?: OId, message?: string): Gitg.Ref
  • create_reference(name: string, oid?: OId, log_message?: string): Ggit.Ref
  • create_reference(...args: any[]): any
  • create_reference(args_or_name: string | any[], oid?: OId, log_message?: string): any
  • Creates a new object id reference.

    The reference will be created in the repository and written to the disk. The returned value must be freed with g_object_unref().

    Parameters

    • name: string
    • Optional oid: OId
    • Optional message: string

    Returns Gitg.Ref

  • Creates a new object id reference.

    The reference will be created in the repository and written to the disk. The returned value must be freed with g_object_unref().

    Parameters

    • name: string

      the name for the new #GgitRef.

    • Optional oid: OId

      the #GgitOId pointed to by the reference.

    • Optional log_message: string

      The one line long message to be appended to the reflog.

    Returns Ggit.Ref

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • args_or_name: string | any[]
    • Optional oid: OId
    • Optional log_message: string

    Returns any

  • create_remote(name: string, url: string): Ggit.Remote
  • create_symbolic_reference(name: string, target?: string, message?: string): Gitg.Ref
  • create_symbolic_reference(name: string, target?: string, log_message?: string): Ggit.Ref
  • create_symbolic_reference(...args: any[]): any
  • create_symbolic_reference(args_or_name: string | any[], target?: string, log_message?: string): any
  • Creates a new symbolic reference.

    The reference will be created in the repository and written to the disk. The returned value must be freed with g_object_unref().

    Parameters

    • name: string
    • Optional target: string
    • Optional message: string

    Returns Gitg.Ref

  • Creates a new symbolic reference.

    The reference will be created in the repository and written to the disk. The returned value must be freed with g_object_unref().

    Parameters

    • name: string

      the name for the new #GgitRef.

    • Optional target: string

      the full name to the reference.

    • Optional log_message: string

      The one line long message to be appended to the reflog.

    Returns Ggit.Ref

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • args_or_name: string | any[]
    • Optional target: string
    • Optional log_message: string

    Returns any

  • delete_tag(name: string): boolean
  • disconnect(id: number): void
  • drop_stash(index: number): void
  • Removes a single stashed state from the stash list.

    Parameters

    • index: number

      the position within the stash list. 0 points to the. most recent stashed state.

    Returns void

  • emit(sigName: "notify::name", ...args: any[]): void
  • emit(sigName: "notify::stage", ...args: any[]): void
  • emit(sigName: "notify::clone-options", ...args: any[]): void
  • emit(sigName: "notify::head", ...args: any[]): void
  • emit(sigName: "notify::init", ...args: any[]): void
  • emit(sigName: "notify::is-bare", ...args: any[]): void
  • emit(sigName: "notify::location", ...args: any[]): void
  • emit(sigName: "notify::url", ...args: any[]): void
  • emit(sigName: "notify::workdir", ...args: any[]): void
  • emit(sigName: "notify::native", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • Gathers file statuses and run a callback for each one.

    To the callback is passed the path of the file, the status and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

    Set options to %NULL to get the default status options.

    Parameters

    Returns boolean

  • force_floating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • freeze_notify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • get_ahead_behind(local: OId, upstream: OId): [number, number]
  • Count the number of unique commits between two commit objects.

    There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

    Parameters

    • local: OId

      the commit for local.

    • upstream: OId

      the commit for upstream.

    Returns [number, number]

  • get_data(key?: string): object
  • get_default_notes_ref(): string
  • get_descendant_of(commit: OId, ancestor: OId): boolean
  • Check whether com mit is a descendant of ancestor. Note that if this function returns %FALSE, an error might have occurred. If so, error will be set appropriately.

    Parameters

    • commit: OId

      the commit.

    • ancestor: OId

      the ancestor.

    Returns boolean

  • get_head(): Gitg.Ref
  • get_head(): Ggit.Ref
  • get_head(...args: any[]): any
  • get_head(...args: any[]): any
  • Get and resolves the current HEAD reference of the repository. Note that the returned ref is already resolved (if HEAD is symbolic). If you want to retrieve the symbolic ref called HEAD, then use #ggit_repository_lookup_reference instead.

    Returns Gitg.Ref

  • Get and resolves the current HEAD reference of the repository. Note that the returned ref is already resolved (if HEAD is symbolic). If you want to retrieve the symbolic ref called HEAD, then use #ggit_repository_lookup_reference instead.

    Returns Ggit.Ref

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • Rest ...args: any[]

    Returns any

  • get_name(): string
  • get_property(property_name?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional property_name: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • get_qdata(quark: number): object
  • Gets the status for a submodule. This looks at a submodule and tries to determine the status. It will return a combination of the %GGIT_SUBMODULE_STATUS values. How deeply it examines the working directory to do this will depend on ignore.

    Parameters

    • name: string

      the name of the submodule.

    • ignore: SubmoduleIgnore

      the ignore rules to follow.

    Returns SubmoduleStatus

  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • Initializes the object implementing the interface.

    This method is intended for language bindings. If writing in C, g_initable_new() should typically be used instead.

    The object must be initialized before any real use after initial construction, either with this function or g_async_initable_init_async().

    Implementations may also support cancellation. If cancellable is not %NULL, then initialization can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If cancellable is not %NULL and the object doesn't support cancellable initialization the error %G_IO_ERROR_NOT_SUPPORTED will be returned.

    If the object is not initialized, or initialization returns with an error, then all operations on the object except g_object_ref() and g_object_unref() are considered to be invalid, and have undefined behaviour. See the [introduction][ginitable] for more details.

    Callers should not assume that a class which implements #GInitable can be initialized multiple times, unless the class explicitly documents itself as supporting this. Generally, a class’ implementation of init() can assume (and assert) that it will only be called once. Previously, this documentation recommended all #GInitable implementations should be idempotent; that recommendation was relaxed in GLib 2.54.

    If a class explicitly supports being initialized multiple times, it is recommended that the method is idempotent: multiple calls with the same arguments should return the same results. Only the first call initializes the object; further calls return the result of the first call.

    One reason why a class might need to support idempotent initialization is if it is designed to be used via the singleton pattern, with a #GObjectClass.constructor that sometimes returns an existing instance. In this pattern, a caller would expect to be able to call g_initable_init() on the result of g_object_new(), regardless of whether it is in fact a new instance.

    Parameters

    • Optional cancellable: Gio.Cancellable

      optional #GCancellable object, %NULL to ignore.

    Returns boolean

  • is_empty(): boolean
  • is_floating(): boolean
  • is_head_detached(): boolean
  • is_head_unborn(): boolean
  • Checks if repository's HEAD is an orphan.

    An orphan branch is one named from HEAD but doesn't exist in the refs namespace, because it doesn't have any commit to point to.

    Returns boolean

  • list_remotes(): string[]
  • list_tags(): string[]
  • list_tags_match(pattern: string): string[]
  • Lookups a reference to one of the objects in the repository.

    The generated reference must be freed with g_object_unref().

    The gtype must match the type of the object in the odb; the method will fail otherwise. The special value %G_TYPE_NONE may be passed to let the method guess the object's type.

    Parameters

    Returns object

  • Lookups a reference to one of the objects in the repository.

    The generated reference must be freed with g_object_unref().

    The gtype must match the type of the object in the odb; the method will fail otherwise. The special value %G_TYPE_NONE may be passed to let the method guess the object's type.

    Parameters

    • oid: OId

      a #GgitOId.

    • Optional gtype: GType<unknown>

      a #GType.

    Returns Ggit.Object

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • args_or_oid: any[] | OId
    • Optional gtype: GType<unknown>

    Returns any

  • lookup_reference(name: string): Gitg.Ref
  • lookup_reference(name: string): Ggit.Ref
  • lookup_reference(...args: any[]): any
  • lookup_reference(args_or_name: string | any[]): any
  • lookup_reference_dwim(short_name: string): Gitg.Ref
  • lookup_reference_dwim(short_name: string): Ggit.Ref
  • lookup_reference_dwim(...args: any[]): any
  • lookup_reference_dwim(args_or_short_name: string | any[]): any
  • Lookups a reference by its short name in repository applying the git precendence rules to the given shorthand to determine which reference the user is referring to. The returned #GgitRef must be freed with g_object_unref().

    Parameters

    • short_name: string

    Returns Gitg.Ref

  • Lookups a reference by its short name in repository applying the git precendence rules to the given shorthand to determine which reference the user is referring to. The returned #GgitRef must be freed with g_object_unref().

    Parameters

    • short_name: string

      the short name for the reference (e.g. master, v0.1.0, ...).

    Returns Ggit.Ref

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • args_or_short_name: string | any[]

    Returns any

  • Merges the given commit(s) into HEAD, writing the results into the working directory. Any changes are staged for commit and any conflicts are written to the index.

    Callers should inspect the repository's index after this completes, resolve any conflicts and prepare a commit.

    Parameters

    Returns void

  • note_foreach(notes_ref: string, callback: NoteCallback): boolean
  • Loop over all the notes within a specified namespace and issue a callback for each one. If callback returns a non-zero value, this will stop looping.

    Parameters

    • notes_ref: string

      canonical name of the reference to use, or %NULL to use the default ref.

    • callback: NoteCallback

      a #GgitNoteCallback.

    Returns boolean

  • notify(property_name: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • property_name: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • path_is_ignored(path: string): boolean
  • Tests if the ignore rules apply to the path provided.

    This acts similar to filtering performed when calling "git add ." on the command line.

    Parameters

    • path: string

      A path within the repository.

    Returns boolean

  • read_note(notes_ref: string, id: OId): Note
  • Initializes a rebase operation to rebase the changes in branch relative to upstream onto another branch. To begin the rebase process, call git_rebase_next(). When you have finished with this object, call g_object_unref().

    Parameters

    • branch: AnnotatedCommit

      the terminal commit to rebase, or %NULL to rebase the current branch.

    • upstream: AnnotatedCommit

      the commit to begin rebasing from, or %NULL to rebase all reachable commits.

    • onto: AnnotatedCommit

      the branch to rebase onto, or %NULL to rebase onto the given upstream.

    • options: RebaseOptions

      a #GgitRebaseOptions to specify how rebase is performed, or %NULL.

    Returns Rebase

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • Gathers references and run a callback for each one.

    To the callback is passed the reference and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

    Parameters

    Returns boolean

  • Gathers reference names and run a callback for each one.

    To the callback is passed the name of the reference and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

    Parameters

    Returns boolean

  • remove_remote(name: string): boolean
  • rename_remote(name: string, new_name: string): string[]
  • reset_default(target: Ggit.Object, pathspecs: string[]): void
  • Update some entries in the index from the target commit tree. The scope of the updated entries is determined by the paths specified in pathspecs. Passing %NULL in target will result in removing entries in the index matching the provided pathspecs.

    Parameters

    • target: Ggit.Object

      the target #GgitObject which is a commit or a tag.

    • pathspecs: string[]

      a list of file paths to reset.

    Returns void

  • Find an object, as specified by a revision string. See man gitrevisions, or the documentation for git rev-parse for information on the syntax accepted.

    Parameters

    • spec: string

      the revision specification.

    Returns Ggit.Object

  • run_dispose(): void
  • Saves the local modifications to a new stash. It returns the commit containing the stashed state. This commit is also the target of the direct reference refs/stash.

    Parameters

    • stasher: Ggit.Signature

      a #GgitSignature.

    • message: string

      description along with the stashed state or %NULL to be autogenerated.

    • flags: StashFlags

      a #GgitStashFlags to control the stashing process.

    Returns OId

  • set_data(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • set_head(ref_name: string): boolean
  • set_head_detached(oid: OId): boolean
  • set_property(property_name: string, value?: any): void
  • set_remote_url(remote: string, url: string): boolean
  • set_submodule_fetch_recurse(name: string, fetch_recurse_submodules: SubmoduleRecurse): void
  • set_submodule_url(name: string, url: string): void
  • Sets the URL for the submodule in the configuration.

    After calling this, you may wish to call ggit_submodule_sync() to write the changes to the checked out submodule repository.

    Parameters

    • name: string

      the name of the submodule to configure.

    • url: string

      URL that should be used for the submodule.

    Returns void

  • set_workdir(workdir: Gio.File, update_gitlink: boolean): void
  • Sets the working directory of the repository. If update_gitlink is set to %TRUE "core.worktree" will be set in the config if workdir is not the parent of the .git directory).

    Parameters

    • workdir: Gio.File

      the working directory.

    • update_gitlink: boolean

      create/update gitlink in workdir.

    Returns void

  • steal_data(key?: string): object
  • steal_qdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • Gathers submodules and run a callback for each one.

    To the callback is passed the submodule instance and name. If the callback returns something other than 0, the iteration will stop and error will be set.

    NOTE: the submodule instance passed to the callback is only valid during the call to ggit_repository_submodule_foreach and may not be used after the call has finished.

    Parameters

    Returns boolean

  • Get all the tags in the repository and run the provided callback on each. If the callback returns something other than 0, the iteration will stop and error will be set.

    Parameters

    Returns boolean

  • thaw_notify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • vfunc_constructed(): void
  • vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: ParamSpec): void
  • vfunc_dispose(): void
  • vfunc_finalize(): void
  • vfunc_get_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • Initializes the object implementing the interface.

    This method is intended for language bindings. If writing in C, g_initable_new() should typically be used instead.

    The object must be initialized before any real use after initial construction, either with this function or g_async_initable_init_async().

    Implementations may also support cancellation. If cancellable is not %NULL, then initialization can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If cancellable is not %NULL and the object doesn't support cancellable initialization the error %G_IO_ERROR_NOT_SUPPORTED will be returned.

    If the object is not initialized, or initialization returns with an error, then all operations on the object except g_object_ref() and g_object_unref() are considered to be invalid, and have undefined behaviour. See the [introduction][ginitable] for more details.

    Callers should not assume that a class which implements #GInitable can be initialized multiple times, unless the class explicitly documents itself as supporting this. Generally, a class’ implementation of init() can assume (and assert) that it will only be called once. Previously, this documentation recommended all #GInitable implementations should be idempotent; that recommendation was relaxed in GLib 2.54.

    If a class explicitly supports being initialized multiple times, it is recommended that the method is idempotent: multiple calls with the same arguments should return the same results. Only the first call initializes the object; further calls return the result of the first call.

    One reason why a class might need to support idempotent initialization is if it is designed to be used via the singleton pattern, with a #GObjectClass.constructor that sometimes returns an existing instance. In this pattern, a caller would expect to be able to call g_initable_init() on the result of g_object_new(), regardless of whether it is in fact a new instance.

    virtual

    Parameters

    • Optional cancellable: Gio.Cancellable

      optional #GCancellable object, %NULL to ignore.

    Returns boolean

  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    virtual

    Parameters

    Returns void

  • vfunc_set_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • watch_closure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compat_control(what: number, data: object): number
  • discover_full(location: Gio.File, across_fs: boolean, ceiling_dirs: string[]): Gio.File
  • Looks for a git repository.

    The lookup starts from path and walks up the parent directories and stops when a repository is found.

    Parameters

    • location: Gio.File

      the base location where the lookup starts.

    • across_fs: boolean

      indictaes whether lookup will work across filesystem devices.

    • ceiling_dirs: string[]

      a list of absolute paths at which lookup will stop when reached, or %NULL.

    Returns Gio.File

  • init_repository(location: Gio.File, is_bare?: boolean): Gitg.Repository
  • init_repository(location: Gio.File, is_bare?: boolean): Ggit.Repository
  • init_repository(...args: any[]): any
  • init_repository(args_or_location: any[] | Gio.File, is_bare?: boolean): any
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • property_name: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • object_type: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

  • Open a git repository.

    The path must point to an existing git repository folder, e.g.

    /path/to/my_repo/.git/	(normal repository)
    objects/
    index
    HEAD

    /path/to/bare_repo/ (bare repository)
    objects/
    index
    HEAD

    The method will automatically detect if path is a normal or bare repository or fail if it is neither.

    Parameters

    • location: Gio.File

      the location of the repository.

    Returns Ggit.Repository

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method