Ggit.Diff¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | blob_to_buffer(old_blob, old_as_path, buffer, buffer_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data) | 
| class | blobs(old_blob, old_as_path, new_blob, new_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data) | 
| class | new_buffers(buffer1, buffer1_as_path, buffer2, buffer2_as_path, diff_options) | 
| class | new_index_to_workdir(repository, index, diff_options) | 
| class | new_tree_to_index(repository, old_tree, index, diff_options) | 
| class | new_tree_to_tree(repository, old_tree, new_tree, diff_options) | 
| class | new_tree_to_workdir(repository, old_tree, diff_options) | 
| find_similar(options) | |
| foreach(file_cb, binary_cb, hunk_cb, line_cb, *user_data) | |
| format_email(options) | |
| get_delta(index) | |
| get_num_deltas() | |
| merge(from_) | |
| print_(type, print_cb, *user_data) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Inherited: | Ggit.Native (1) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| repository | Ggit.Repository | r/w/co | Repository | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Ggit.Diff(**kwargs)¶
- Bases: - Ggit.Native- Abstract: - No - Structure: - Ggit.DiffClass- Represents a diff list. - 
classmethod blob_to_buffer(old_blob, old_as_path, buffer, buffer_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters: - old_blob (Ggit.BloborNone) – aGgit.Blobto diff from.
- old_as_path (strorNone) – treat old_blob as if it had this filename, orNone,
- buffer (bytesorNone) – a buffer to diff to.
- buffer_as_path (strorNone) – treat buffer as if it had this filename, orNone,
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
- file_cb (Ggit.DiffFileCallbackorNone) – aGgit.DiffFileCallback.
- binary_cb (Ggit.DiffBinaryCallbackorNone) – aGgit.DiffBinaryCallback.
- hunk_cb (Ggit.DiffHunkCallbackorNone) – aGgit.DiffHunkCallback.
- line_cb (Ggit.DiffLineCallbackorNone) – aGgit.DiffLineCallback.
- user_data (objectorNone) – callback user data.
 - Raises: - Same as - Ggit.Diff.blobs() but using a buffer.
- old_blob (
 - 
classmethod blobs(old_blob, old_as_path, new_blob, new_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters: - old_blob (Ggit.BloborNone) – aGgit.Blobto diff from.
- old_as_path (strorNone) – treat old_blob as if it had this filename, orNone,
- new_blob (Ggit.BloborNone) – aGgit.Blobto diff to.
- new_as_path (strorNone) – treat new_blob as if it had this filename, orNone,
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
- file_cb (Ggit.DiffFileCallbackorNone) – aGgit.DiffFileCallback.
- binary_cb (Ggit.DiffBinaryCallbackorNone) – aGgit.DiffBinaryCallback.
- hunk_cb (Ggit.DiffHunkCallbackorNone) – aGgit.DiffHunkCallback.
- line_cb (Ggit.DiffLineCallbackorNone) – aGgit.DiffLineCallback.
- user_data (objectorNone) – callback user data.
 - Raises: - Iterates over the diff calling file_cb, binary_cb, hunk_cb and line_cb. - The - Ggit.DiffFilemode always be 0, path will be- Noneand when a blob is- Nonethe oid will be 0.- If diff_options is - Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- old_blob (
 - 
classmethod new_buffers(buffer1, buffer1_as_path, buffer2, buffer2_as_path, diff_options)¶
- Parameters: - buffer1 (bytesorNone) – a buffer to diff from.
- buffer1_as_path (strorNone) – treat buffer1 as if it had this filename, orNone,
- buffer2 (bytesorNone) – a buffer to diff to.
- buffer2_as_path (strorNone) – treat buffer2 as if it had this filename, orNone,
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
 - Raises: - Returns: - a newly allocated - Ggit.Diffif there was no error,- Noneotherwise.- Return type: - Same as - Ggit.Diff.blobs() but using a buffers. Creates a- Ggit.Diffwhich compares buffer1 and buffer2.- If diff_options is - Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- buffer1 (
 - 
classmethod new_index_to_workdir(repository, index, diff_options)¶
- Parameters: - repository (Ggit.Repository) – aGgit.Repository.
- index (Ggit.IndexorNone) – aGgit.Index, orNone.
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
 - Raises: - Returns: - a newly allocated - Ggit.Diffif there was no error,- Noneotherwise.- Return type: - Creates a - Ggit.Diffwhich compares the working directory and the index.- If index is - Nonethen repository index is used. If diff_options is- Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- repository (
 - 
classmethod new_tree_to_index(repository, old_tree, index, diff_options)¶
- Parameters: - repository (Ggit.Repository) – aGgit.Repository.
- old_tree (Ggit.TreeorNone) – aGgit.Treeto diff from.
- index (Ggit.IndexorNone) – aGgit.Index, orNone.
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
 - Raises: - Returns: - a newly allocated - Ggit.Diffif there was no error,- Noneotherwise.- Return type: - Creates a - Ggit.Diffwhich compares old_tree and the index.- If index is - Nonethen repository index is used. If diff_options is- Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- repository (
 - 
classmethod new_tree_to_tree(repository, old_tree, new_tree, diff_options)¶
- Parameters: - repository (Ggit.Repository) – aGgit.Repository.
- old_tree (Ggit.TreeorNone) – aGgit.Treeto diff from.
- new_tree (Ggit.TreeorNone) – aGgit.Treeto diff to.
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
 - Raises: - Returns: - a newly allocated - Ggit.Diffif there was no error,- Noneotherwise.- Return type: - Creates a - Ggit.Diffwhich compares old_tree and new_tree.- If diff_options is - Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- repository (
 - 
classmethod new_tree_to_workdir(repository, old_tree, diff_options)¶
- Parameters: - repository (Ggit.Repository) – aGgit.Repository.
- old_tree (Ggit.TreeorNone) – aGgit.Treeto diff from.
- diff_options (Ggit.DiffOptionsorNone) – aGgit.DiffOptions, orNone.
 - Raises: - Returns: - a newly allocated - Ggit.Diffif there was no error,- Noneotherwise.- Return type: - Creates a - Ggit.Diffwhich compares the working directory and old_tree.- If diff_options is - Nonethen the defaults specified in- Ggit.DiffOptions.new() are used.
- repository (
 - 
find_similar(options)¶
- Parameters: - options ( - Ggit.DiffFindOptionsor- None) – a- Ggit.DiffFindOptionsor- None.- Raises: - GLib.Error- Returns: - Trueif there were no errors,- Falseotherwise.- Return type: - bool- Transform self marking file renames, copies, etc.. If options is set to - None, then the default options will be used.
 - 
foreach(file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters: - file_cb (Ggit.DiffFileCallbackorNone) – aGgit.DiffFileCallback.
- binary_cb (Ggit.DiffBinaryCallbackorNone) – aGgit.DiffBinaryCallback.
- hunk_cb (Ggit.DiffHunkCallbackorNone) – aGgit.DiffHunkCallback.
- line_cb (Ggit.DiffLineCallbackorNone) – aGgit.DiffLineCallback.
- user_data (objectorNone) – callback user data.
 - Raises: - Iterates over the diff calling file_cb, binary_cb, hunk_cb and line_cb. 
- file_cb (
 - 
format_email(options)¶
- Parameters: - options ( - Ggit.DiffFormatEmailOptions) – a- Ggit.DiffFormatEmailOptions.- Raises: - GLib.Error- Returns: - the patch or - Noneif an error occurred.- Return type: - stror- None- Create an e-mail ready patch from a diff. 
 - 
get_delta(index)¶
- Parameters: - index ( - int) – the index.- Returns: - a - Ggit.DiffDeltaor- None.- Return type: - Ggit.DiffDeltaor- None- Get the delta at the specified index. 
 - 
get_num_deltas()¶
- Returns: - the number of deltas. - Return type: - int- Get the number of deltas in the diff. 
 - 
merge(from_)¶
- Parameters: - from ( - Ggit.Diff) – the- Ggit.Diffto merge.- Raises: - GLib.Error- Merges from into self unless error is set. 
 - 
print_(type, print_cb, *user_data)¶
- Parameters: - type (Ggit.DiffFormatType) – aGgit.DiffFormatType.
- print_cb (Ggit.DiffLineCallback) – aGgit.DiffLineCallback.
- user_data (objectorNone) – callback user data.
 - Raises: - Iterates over self generating text output like “git diff”. 
- type (
 
- 
classmethod 
Property Details¶
- 
Ggit.Diff.props.repository¶
- Name: - repository- Type: - Ggit.Repository- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- Repository