Callbacks

ConfigCallback (entry, *user_data)

ConfigMatchCallback (match_info, value, *user_data)

CredAcquireCallback (url, username_from_url, allowed_types, cred, *user_data)

DiffBinaryCallback (delta, binary, *user_data)

DiffFileCallback (delta, progress, *user_data)

DiffHunkCallback (delta, hunk, *user_data)

DiffLineCallback (delta, hunk, line, *user_data)

DiffSimilarityMetricBufferSignatureCallback (file, buf, buflen, out, *user_data)

DiffSimilarityMetricFileSignatureCallback (file, fullpath, out, *user_data)

DiffSimilarityMetricFreeSignatureCallback (signature, *user_data)

DiffSimilarityMetricSimilarityCallback (score, signature_a, signature_b, *user_data)

NoteCallback (blob_id, annotated_object_id, *user_data)

ReferencesCallback (reference, *user_data)

ReferencesNameCallback (name, *user_data)

RemoteListCallback (name, oid, loid, local, *user_data)

StashCallback (index, message, stash_oid, *user_data)

StatusCallback (path, status_flags, *user_data)

SubmoduleCallback (submodule, name, *user_data)

TagCallback (name, tag_oid, *user_data)

TransferProgressCallback (stats, *user_data)

TreeWalkCallback (root, entry, *user_data)

Details

Ggit.ConfigCallback(entry, *user_data)
Parameters:
Returns:

0 to go for the next config value or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving values from a Ggit.Config. See Ggit.Config.foreach().

Ggit.ConfigMatchCallback(match_info, value, *user_data)
Parameters:
Returns:

0 to go for the next config value or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving values from a Ggit.Config using a regular expression. See Ggit.Config.match_foreach().

Ggit.CredAcquireCallback(url, username_from_url, allowed_types, cred, *user_data)
Parameters:
  • url (str) – the resource for which we are demanding a credential.

  • username_from_url (str or None) – The username that was embedded in a “user`host`" remote url, or None if not included.

  • allowed_types (int) – a bitmask stating which cred types are OK to return.

  • cred (Ggit.Cred) – newly created credential object.

  • user_data (object or None) – user-supplied data.

Return type:

int

Signature of a function which acquires a credential object.

Ggit.DiffBinaryCallback(delta, binary, *user_data)
Parameters:
Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

Called for each file.

Ggit.DiffFileCallback(delta, progress, *user_data)
Parameters:
Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

Called for each file.

Ggit.DiffHunkCallback(delta, hunk, *user_data)
Parameters:
Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

Called for each hunk.

Ggit.DiffLineCallback(delta, hunk, line, *user_data)
Parameters:
Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

Called for each line.

Ggit.DiffSimilarityMetricBufferSignatureCallback(file, buf, buflen, out, *user_data)
Parameters:
Return type:

int

Ggit.DiffSimilarityMetricFileSignatureCallback(file, fullpath, out, *user_data)
Parameters:
Return type:

int

Ggit.DiffSimilarityMetricFreeSignatureCallback(signature, *user_data)
Parameters:
Ggit.DiffSimilarityMetricSimilarityCallback(score, signature_a, signature_b, *user_data)
Parameters:
Return type:

int

Ggit.NoteCallback(blob_id, annotated_object_id, *user_data)
Parameters:
  • blob_id (Ggit.OId) – id of the blob containing the message.

  • annotated_object_id (Ggit.OId) – id of the git object being annotated.

  • user_data (object or None) – user-suplied data.

Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

When iterating over all the notes, callback that will be issued per note. See Ggit.Repository.note_foreach().

Ggit.ReferencesCallback(reference, *user_data)
Parameters:
  • reference (Ggit.Ref) – the reference.

  • user_data (object or None) – user-supplied data.

Returns:

0 to go for the next references or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving the references in a Ggit.Repository. See Ggit.Repository.references_foreach().

Ggit.ReferencesNameCallback(name, *user_data)
Parameters:
  • name (str) – the name of the reference

  • user_data (object or None) – user-supplied data.

Returns:

0 to go for the next references or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving the references in a Ggit.Repository. See Ggit.Repository.references_foreach_name().

Ggit.RemoteListCallback(name, oid, loid, local, *user_data)
Parameters:
  • name (str) – the name of the reference.

  • oid (Ggit.OId) – the reference’s oid.

  • loid (Ggit.OId) – the reference’s loid.

  • local (bool) – if available locally.

  • user_data (object or None) – user-supplied data.

Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for listing the references of a Ggit.Remote. See Ggit.Remote.list().

Ggit.StashCallback(index, message, stash_oid, *user_data)
Parameters:
  • index (int) – the position within the stash list. 0 points to the most recent stashed state.

  • message (str) – the stash message.

  • stash_oid (Ggit.OId) – the commit oid of the stashed state.

  • user_data (object or None) – user-suplied data.

Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

When iterating over all the stashed states, callback that will be issued per entry. See Ggit.Repository.stash_foreach().

Ggit.StatusCallback(path, status_flags, *user_data)
Parameters:
  • path (str) – the file to retrieve status for, rooted at the repository working dir.

  • status_flags (Ggit.StatusFlags) – the status value.

  • user_data (object or None) – user-supplied data.

Returns:

0 to go for the next file or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving the status of the files in a Ggit.Repository. See Ggit.Repository.file_status_foreach().

Ggit.SubmoduleCallback(submodule, name, *user_data)
Parameters:
Returns:

0 to go for the next submodule or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for retrieving the submodules in a Ggit.Repository. See Ggit.Repository.submodule_foreach().

Ggit.TagCallback(name, tag_oid, *user_data)
Parameters:
  • name (str) – the tag name.

  • tag_oid (Ggit.OId) – the tag oid.

  • user_data (object or None) – user-suplied data.

Returns:

0 to go continue or a Ggit.Error in case there was an error.

Return type:

int

When iterating over all the tags, callback that will be issued per entry. See Ggit.Repository.tag_foreach().

Ggit.TransferProgressCallback(stats, *user_data)
Parameters:
Returns:

a value less than zero to cancel the transfer.

Return type:

int

Progress callbacks during indexing.

Ggit.TreeWalkCallback(root, entry, *user_data)
Parameters:
  • root (str) – the current (relative) root of the entry

  • entry (Ggit.TreeEntry) – the tree entry

  • user_data (object or None) – user-supplied data.

Returns:

0 to go for the next entry or a Ggit.Error in case there was an error.

Return type:

int

The type of the callback functions for walking a tree. See Ggit.Tree.walk().