1 /* 2 * ggit-types.h 3 * This file is part of libgit2-glib 4 * 5 * Copyright (C) 2011 - Garrett Regier 6 * 7 * libgit2-glib is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * libgit2-glib is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __GGIT_TYPES_H__ 22 #define __GGIT_TYPES_H__ 23 24 #include <glib.h> 25 26 G_BEGIN_DECLS 27 28 /** 29 * GgitAnnotatedCommit: 30 * 31 * Represents an annotated commit object. 32 */ 33 typedef struct _GgitAnnotatedCommit GgitAnnotatedCommit; 34 35 /** 36 * GgitBranchEnumerator: 37 * 38 * Represents a branch enumerator. 39 */ 40 typedef struct _GgitBranchEnumerator GgitBranchEnumerator; 41 42 /** 43 * GgitCloneOptions: 44 * 45 * Represents the options used when cloning. 46 */ 47 typedef struct _GgitCloneOptions GgitCloneOptions; 48 49 /** 50 * GgitConfigEntry: 51 * 52 * Represents a git configuration entry. 53 */ 54 typedef struct _GgitConfigEntry GgitConfigEntry; 55 56 /** 57 * GgitCredSshInteractivePrompt: 58 * 59 * Represents a ssh interactive prompt. 60 */ 61 typedef struct _GgitCredSshInteractivePrompt GgitCredSshInteractivePrompt; 62 63 /** 64 * GgitDiffBinary: 65 * 66 * Represents a diff binary. 67 */ 68 typedef struct _GgitDiffBinary GgitDiffBinary; 69 70 /** 71 * GgitDiffBinaryFile: 72 * 73 * Represents a diff binary file. 74 */ 75 typedef struct _GgitDiffBinaryFile GgitDiffBinaryFile; 76 77 /** 78 * GgitDiffDelta: 79 * 80 * Represents the changes done to one file. 81 */ 82 typedef struct _GgitDiffDelta GgitDiffDelta; 83 84 /** 85 * GgitDiffFile: 86 * 87 * Represents a file in a #GgitDiff. 88 */ 89 typedef struct _GgitDiffFile GgitDiffFile; 90 91 /** 92 * GgitDiffHunk: 93 * 94 * Represents the hunk of a diff. 95 */ 96 typedef struct _GgitDiffHunk GgitDiffHunk; 97 98 /** 99 * GgitDiffLine: 100 * 101 * Represents the line of a diff. 102 */ 103 typedef struct _GgitDiffLine GgitDiffLine; 104 105 /** 106 * GgitDiffSimilarityMetric: 107 * 108 * Represents a similarity metric. 109 */ 110 typedef struct _GgitDiffSimilarityMetric GgitDiffSimilarityMetric; 111 112 /** 113 * GgitBlameHunk: 114 * 115 * Represents a blame hunk. 116 */ 117 typedef struct _GgitBlameHunk GgitBlameHunk; 118 119 /** 120 * GgitFetchOptions: 121 * 122 * Represents a git fetch options. 123 */ 124 typedef struct _GgitFetchOptions GgitFetchOptions; 125 126 /** 127 * GgitIndexEntries: 128 * 129 * Represents the entries in an index object. 130 */ 131 typedef struct _GgitIndexEntries GgitIndexEntries; 132 133 /** 134 * GgitIndexEntry: 135 * 136 * Represents an index entry object. 137 */ 138 typedef struct _GgitIndexEntry GgitIndexEntry; 139 140 /** 141 * GgitIndexEntriesResolveUndo: 142 * 143 * Represents the resolve undo entries in an index object. 144 */ 145 typedef struct _GgitIndexEntriesResolveUndo GgitIndexEntriesResolveUndo; 146 147 /** 148 * GgitIndexEntryResolveUndo: 149 * 150 * Represents an resolve undo index entry object. 151 */ 152 typedef struct _GgitIndexEntryResolveUndo GgitIndexEntryResolveUndo; 153 154 /** 155 * GgitMergeOptions: 156 * 157 * Represents the options used when merging. 158 */ 159 typedef struct _GgitMergeOptions GgitMergeOptions; 160 161 /** 162 * GgitNote: 163 * 164 * Represents a note object. 165 */ 166 typedef struct _GgitNote GgitNote; 167 168 /** 169 * GgitOId: 170 * 171 * Represents a unique ID of any object. 172 */ 173 typedef struct _GgitOId GgitOId; 174 175 /** 176 * GgitPatch: 177 * 178 * Represents a patch object. 179 */ 180 typedef struct _GgitPatch GgitPatch; 181 182 /** 183 * GgitRebaseOperation: 184 * 185 * Represents a rebase operation. 186 */ 187 typedef struct _GgitRebaseOperation GgitRebaseOperation; 188 189 /** 190 * GgitRebaseOptions: 191 * 192 * Represents the options used when rebasing. 193 */ 194 typedef struct _GgitRebaseOptions GgitRebaseOptions; 195 196 /** 197 * GgitRef: 198 * 199 * Reprensents a git reference. 200 */ 201 typedef struct _GgitRef GgitRef; 202 203 /** 204 * GgitRefSpec: 205 * 206 * Reprensents a git reference specification. 207 */ 208 typedef struct _GgitRefSpec GgitRefSpec; 209 210 /** 211 * GgitReflog: 212 * 213 * Represents a reflog. 214 */ 215 typedef struct _GgitReflog GgitReflog; 216 217 /** 218 * GgitReflogEntry: 219 * 220 * Represents a reflog entry. 221 */ 222 typedef struct _GgitReflogEntry GgitReflogEntry; 223 224 /** 225 * GgitRemoteHead: 226 * 227 * Represents a git remote head. 228 */ 229 typedef struct _GgitRemoteHead GgitRemoteHead; 230 231 /** 232 * GgitRemote: 233 * 234 * Represents a git remote. 235 */ 236 typedef struct _GgitRemote GgitRemote; 237 238 /** 239 * GgitRepository: 240 * 241 * Represents an existing git repository including all of it's 242 * object contents. 243 */ 244 typedef struct _GgitRepository GgitRepository; 245 246 /** 247 * GgitStatusOptions: 248 * 249 * Represents the options used when creating getting file status. 250 */ 251 typedef struct _GgitStatusOptions GgitStatusOptions; 252 253 /** 254 * GgitSubmodule: 255 * 256 * Represents a git submodule. 257 */ 258 typedef struct _GgitSubmodule GgitSubmodule; 259 260 /** 261 * GgitTransferProgress: 262 * 263 * Represents transfering progress. 264 */ 265 typedef struct _GgitTransferProgress GgitTransferProgress; 266 267 /** 268 * GgitTreeEntry: 269 * 270 * Represents an entry in a tree. 271 */ 272 typedef struct _GgitTreeEntry GgitTreeEntry; 273 274 /** 275 * GgitBlameOptions: 276 * 277 * Represents blame options. 278 */ 279 typedef struct _GgitBlameOptions GgitBlameOptions; 280 281 /** 282 * GgitRevertOptions: 283 * 284 * Represents the options used when reverting. 285 */ 286 typedef struct _GgitRevertOptions GgitRevertOptions; 287 288 /** 289 * GgitBranchType: 290 * @GGIT_BRANCH_LOCAL: specifies a local branch. 291 * @GGIT_BRANCH_REMOTE: specifies a remote branch. 292 * 293 * The type of a branch. 294 */ 295 typedef enum 296 { 297 GGIT_BRANCH_LOCAL = 1, 298 GGIT_BRANCH_REMOTE = 2 299 } GgitBranchType; 300 301 typedef enum 302 { 303 GGIT_FEATURE_THREADS = 1 << 0, 304 GGIT_FEATURE_HTTPS = 1 << 1, 305 GGIT_FEATURE_SSH = (1 << 2) 306 } GgitFeatureFlags; 307 308 /** 309 * GgitDiffBinaryType: 310 * @GIT_DIFF_BINARY_NONE: There is no binary delta. 311 * @GIT_DIFF_BINARY_LITERAL: The binary data is the literal contents of the file. 312 * @GIT_DIFF_BINARY_DELTA: The binary data is the delta from one side to the other. 313 * 314 * When producing a binary diff, the binary data returned will be 315 * either the deflated full ("literal") contents of the file, or 316 * the deflated binary delta between the two sides (whichever is 317 * smaller). 318 */ 319 typedef enum { 320 GGIT_DIFF_BINARY_NONE, 321 GGIT_DIFF_BINARY_LITERAL, 322 GGIT_DIFF_BINARY_DELTA 323 } GgitDiffBinaryType; 324 325 /** 326 * GgitBlameFlags: 327 * @GGIT_BLAME_NORMAL: Normal blame, the default. 328 * @GGIT_BLAME_TRACK_COPIES_SAME_FILE: Track lines that have moved within a file 329 * (like git blame -M) 330 */ 331 typedef enum 332 { 333 GGIT_BLAME_NORMAL = 0, 334 GGIT_BLAME_TRACK_COPIES_SAME_FILE = 1 << 0 335 } GgitBlameFlags; 336 337 /** 338 * GgitConfigLevel: 339 * @GGIT_CONFIG_LEVEL_PROGRAMDATA: System-wide on Windows, for compatibility with portable git. 340 * @GGIT_CONFIG_LEVEL_SYSTEM: System-wide configuration file. 341 * @GGIT_CONFIG_LEVEL_XDG: XDG compatible configuration file (.config/git/config). 342 * @GGIT_CONFIG_LEVEL_GLOBAL: User-specific configuration file, also called Global configuration file. 343 * @GGIT_CONFIG_LEVEL_LOCAL: Repository specific configuration file. 344 * @GGIT_CONFIG_LEVEL_APP: Application specific configuration file; freely defined by applications. 345 * @GGIT_CONFIG_LEVEL_HIGHEST: Represents the highest level of a config file. 346 * 347 * Priority level of a config file. 348 * These priority levels correspond to the natural escalation logic 349 * (from higher to lower) when searching for config entries in git.git. 350 */ 351 typedef enum 352 { 353 GGIT_CONFIG_LEVEL_PROGRAMDATA = 1, 354 GGIT_CONFIG_LEVEL_SYSTEM = 2, 355 GGIT_CONFIG_LEVEL_XDG = 3, 356 GGIT_CONFIG_LEVEL_GLOBAL = 4, 357 GGIT_CONFIG_LEVEL_LOCAL = 5, 358 GGIT_CONFIG_LEVEL_APP = 6, 359 GGIT_CONFIG_LEVEL_HIGHEST = -1 360 } GgitConfigLevel; 361 362 /** 363 * GgitCreateFlags: 364 * @GGIT_CREATE_NONE: attempt to create. 365 * @GGIT_CREATE_FORCE: force creation. 366 * 367 * Describes how something should be created. 368 */ 369 typedef enum 370 { 371 GGIT_CREATE_NONE = 0, 372 GGIT_CREATE_FORCE = 1 << 0 373 } GgitCreateFlags; 374 375 /** 376 * GgitDeltaType: 377 * @GGIT_DELTA_UNMODIFIED: unmodified. 378 * @GGIT_DELTA_ADDED: added. 379 * @GGIT_DELTA_DELETED: deleted. 380 * @GGIT_DELTA_MODIFIED: modified. 381 * @GGIT_DELTA_RENAMED: renamed. 382 * @GGIT_DELTA_COPIED: copied. 383 * @GGIT_DELTA_IGNORED: ignored. 384 * @GGIT_DELTA_UNTRACKED: untracked. 385 * 386 * Describes the type of change the delta is. 387 */ 388 typedef enum { 389 GGIT_DELTA_UNMODIFIED = 0, 390 GGIT_DELTA_ADDED = 1, 391 GGIT_DELTA_DELETED = 2, 392 GGIT_DELTA_MODIFIED = 3, 393 GGIT_DELTA_RENAMED = 4, 394 GGIT_DELTA_COPIED = 5, 395 GGIT_DELTA_IGNORED = 6, 396 GGIT_DELTA_UNTRACKED = 7 397 } GgitDeltaType; 398 399 /** 400 * GgitDiffFormatType: 401 * @GGIT_DIFF_FORMAT_PATCH: full git diff. 402 * @GGIT_DIFF_FORMAT_PATCH_HEADER: just the file headers of patch. 403 * @GGIT_DIFF_FORMAT_RAW: like git diff --raw. 404 * @GGIT_DIFF_FORMAT_NAME_ONLY: like git diff --name-only. 405 * @GGIT_DIFF_FORMAT_NAME_STATUS: like git diff --name-status. 406 * 407 * Possible output formats for diff data. 408 */ 409 typedef enum { 410 GGIT_DIFF_FORMAT_PATCH = 1u, 411 GGIT_DIFF_FORMAT_PATCH_HEADER = 2u, 412 GGIT_DIFF_FORMAT_RAW = 3u, 413 GGIT_DIFF_FORMAT_NAME_ONLY = 4u, 414 GGIT_DIFF_FORMAT_NAME_STATUS = 5u 415 } GgitDiffFormatType; 416 417 /** 418 * GgitDiffOption: 419 * @GGIT_DIFF_NORMAL: normal. 420 * @GGIT_DIFF_REVERSE: reverse the sides of the diff. 421 * @GGIT_DIFF_INCLUDE_IGNORED: include ignored files. 422 * @GGIT_DIFF_RECURSE_IGNORED_DIRS: also add all files under ignored dirs. 423 * @GGIT_DIFF_INCLUDE_UNTRACKED: include untracked files. 424 * @GGIT_DIFF_RECURSE_UNTRACKED_DIRS: recurse to untracked directories. 425 * @GGIT_DIFF_INCLUDE_UNMODIFIED: include unmodified files. 426 * @GGIT_DIFF_INCLUDE_TYPECHANGE: enable generation of typechange detal records. 427 * @GGIT_DIFF_INCLUDE_TYPECHANGE_TREES: try to label tree transitions as type changes. 428 * @GGIT_DIFF_IGNORE_FILE_MODE: ignore file mode changes. 429 * @GGIT_DIFF_IGNORE_SUBMODULES: ignore submodules. 430 * @GGIT_DIFF_IGNORE_CASE: use case insensitive filename comparison. 431 * @GGIT_DIFF_DISABLE_PATHSPEC_MATCH: use exact path matching. 432 * @GGIT_DIFF_SKIP_BINARY_CHECK: disable updating the binary flag in delta records. 433 * @GGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS: immediately label untracked directories as 434 * untracked, without checking inside. 435 * @GGIT_DIFF_FORCE_TEXT: force text. 436 * @GGIT_DIFF_FORCE_BINARY: treat all files as binary, disabling text diffs. 437 * @GGIT_DIFF_IGNORE_WHITESPACE: ignore whitespace. 438 * @GGIT_DIFF_IGNORE_WHITESPACE_CHANGE: ignore whitespace change. 439 * @GGIT_DIFF_IGNORE_WHITESPACE_EOL: ignore whitespace at end-of-line. 440 * @GGIT_DIFF_SHOW_UNTRACKED_CONTENT: include content of untracked files. 441 * this implies GGIT_DIFF_INCLUDE_UNTRACKED but not GGIT_DIFF_RECURSE_UNTRACKED_DIRS. 442 * @GGIT_DIFF_SHOW_UNMODIFIED: show unmodified files. 443 * @GGIT_DIFF_PATIENCE: generate using the "patience diff" algorithm. 444 * @GGIT_DIFF_MINIMAL: take extra time to find minimal diff. 445 * @GGIT_DIFF_SHOW_BINARY: include deflate/delta information for binary files. 446 * 447 * How the diff should be generated. 448 */ 449 typedef enum { 450 GGIT_DIFF_NORMAL = 0, 451 GGIT_DIFF_REVERSE = 1u << 0, 452 GGIT_DIFF_INCLUDE_IGNORED = 1u << 1, 453 GGIT_DIFF_RECURSE_IGNORED_DIRS = 1u << 2, 454 GGIT_DIFF_INCLUDE_UNTRACKED = 1u << 3, 455 GGIT_DIFF_RECURSE_UNTRACKED_DIRS = 1u << 4, 456 GGIT_DIFF_INCLUDE_UNMODIFIED = 1u << 5, 457 GGIT_DIFF_INCLUDE_TYPECHANGE = 1u << 6, 458 GGIT_DIFF_INCLUDE_TYPECHANGE_TREES = 1u << 7, 459 GGIT_DIFF_IGNORE_FILE_MODE = 1u << 8, 460 GGIT_DIFF_IGNORE_SUBMODULES = 1u << 9, 461 GGIT_DIFF_IGNORE_CASE = 1u << 10, 462 463 GGIT_DIFF_DISABLE_PATHSPEC_MATCH = 1u << 12, 464 GGIT_DIFF_SKIP_BINARY_CHECK = 1u << 13, 465 GGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS = 1u << 14, 466 467 GGIT_DIFF_FORCE_TEXT = 1u << 20, 468 GGIT_DIFF_FORCE_BINARY = 1u << 21, 469 GGIT_DIFF_IGNORE_WHITESPACE = 1u << 22, 470 GGIT_DIFF_IGNORE_WHITESPACE_CHANGE = 1u << 23, 471 GGIT_DIFF_IGNORE_WHITESPACE_EOL = 1u << 24, 472 473 GGIT_DIFF_SHOW_UNTRACKED_CONTENT = 1u << 25, 474 GGIT_DIFF_SHOW_UNMODIFIED = 1u << 26, 475 476 GGIT_DIFF_PATIENCE = 1u << 28, 477 GGIT_DIFF_MINIMAL = 1u << 29, 478 GGIT_DIFF_SHOW_BINARY = 1u << 30 479 } GgitDiffOption; 480 481 /** 482 * GgitDiffFlag: 483 * @GGIT_DIFF_FLAG_BINARY: if the file is binary. 484 * @GGIT_DIFF_FLAG_NOT_BINARY: if the file is not binary. 485 * @GGIT_DIFF_FLAG_VALID_ID: if the ID is valid. 486 * 487 * Describes the diff file and/or delta flags 488 */ 489 typedef enum { 490 GGIT_DIFF_FLAG_BINARY = 1 << 0, 491 GGIT_DIFF_FLAG_NOT_BINARY = 1 << 1, 492 GGIT_DIFF_FLAG_VALID_ID = 1 << 2 493 } GgitDiffFlag; 494 495 /** 496 * GgitDiffLineType: 497 * @GGIT_DIFF_LINE_CONTEXT: line is part of the context. 498 * @GGIT_DIFF_LINE_ADDITION: line that was added. 499 * @GGIT_DIFF_LINE_DELETION: line that was removed. 500 * @GGIT_DIFF_LINE_CONTEXT_EOFNL: Both files have no LF at end. 501 * @GGIT_DIFF_LINE_ADD_EOFNL: LF was added at end of file. 502 * @GGIT_DIFF_LINE_DEL_EOFNL: LF was removed at end of file. 503 * @GGIT_DIFF_LINE_FILE_HDR: the file header. 504 * @GGIT_DIFF_LINE_HUNK_HDR: the hunk header. 505 * @GGIT_DIFF_LINE_BINARY: is binary. 506 * 507 * These values describe where a line came from and will be passed to 508 * the #GgitDiffLineCallback when iterating over a diff. 509 * 510 * The #GGIT_DIFF_LINE_FILE_HDR, #GGIT_DIFF_LINE_HUNK_HDR and 511 * #GGIT_DIFF_LINE_BINARY values are only sent when the diff is being printed. 512 */ 513 typedef enum { 514 GGIT_DIFF_LINE_CONTEXT = ' ', 515 GGIT_DIFF_LINE_ADDITION = '+', 516 GGIT_DIFF_LINE_DELETION = '-', 517 GGIT_DIFF_LINE_CONTEXT_EOFNL = '=', 518 GGIT_DIFF_LINE_ADD_EOFNL = '>', 519 GGIT_DIFF_LINE_DEL_EOFNL = '<', 520 GGIT_DIFF_LINE_FILE_HDR = 'F', 521 GGIT_DIFF_LINE_HUNK_HDR = 'H', 522 GGIT_DIFF_LINE_BINARY = 'B' 523 } GgitDiffLineType; 524 525 /* NOTE: keep in sync with git2/errors.h */ 526 /** 527 * GgitError: 528 * @GGIT_ERROR_GIT_ERROR: A generic error for when an operation fails. 529 * @GGIT_ERROR_NOTFOUND: Input does not exist in the scope searched. 530 * @GGIT_ERROR_EXISTS: A reference with this name already exists. 531 * @GGIT_ERROR_AMBIGUOUS: The given error is ambiguous. 532 * @GGIT_ERROR_BUFS: The buffer is too short. 533 * @GGIT_ERROR_PASSTHROUGH: Skip and passthrough the given ODB backend. 534 * @GGIT_ERROR_ITEROVER: The iteration has finished. 535 * 536 * Error codes for the %GGIT_ERROR error domain. 537 */ 538 typedef enum { 539 GGIT_ERROR_GIT_ERROR = -1, 540 GGIT_ERROR_NOTFOUND = -3, 541 GGIT_ERROR_EXISTS = -4, 542 GGIT_ERROR_AMBIGUOUS = -5, 543 GGIT_ERROR_BUFS = -6, 544 GGIT_ERROR_PASSTHROUGH = -30, 545 GGIT_ERROR_ITEROVER = -31 546 } GgitError; 547 548 /* NOTE: keep in sync with git2/refs.h */ 549 typedef enum { 550 GGIT_FILE_MODE_UNREADABLE = 0000000, 551 GGIT_FILE_MODE_TREE = 0040000, 552 GGIT_FILE_MODE_BLOB = 0100644, 553 GGIT_FILE_MODE_BLOB_EXECUTABLE = 0100755, 554 GGIT_FILE_MODE_LINK = 0120000, 555 GGIT_FILE_MODE_COMMIT = 0160000 556 } GgitFileMode; 557 558 /* NOTE: keep in sync with git2/merge.h */ 559 /** 560 * GgitMergeAutomergeMode: 561 * @GGIT_MERGE_FILE_FAVOR_NORMAL: When a region of a file is changed in both branches, 562 * a conflict will be recorded in the index so that `git_checkout` can produce 563 * a merge file with conflict markers in the working directory. This is the default. 564 * @GGIT_MERGE_FILE_FAVOR_OURS: When a region of a file is changed in both branches, the file 565 * created in the index will contain the "ours" side of any conflicting 566 * region. The index will not record a conflict. 567 * @GGIT_MERGE_FILE_FAVOR_THEIRS: When a region of a file is changed in both branches, the file 568 * created in the index will contain the "theirs" side of any conflicting 569 * region. The index will not record a conflict. 570 * @GGIT_MERGE_FILE_FAVOR_UNION: When a region of a file is changed in both branches, the file 571 * created in the index will contain each unique line from each side, 572 * which has the result of combining both files. The index will not 573 * record a conflict. 574 */ 575 typedef enum { 576 GGIT_MERGE_FILE_FAVOR_NORMAL = 0, 577 GGIT_MERGE_FILE_FAVOR_OURS = 1, 578 GGIT_MERGE_FILE_FAVOR_THEIRS = 2, 579 GGIT_MERGE_FILE_FAVOR_UNION = 3 580 } GgitMergeFileFavor; 581 582 /** 583 * GgitMergeFileFlags: 584 * GGIT_MERGE_FILE_DEFAULT: Defaults. 585 * GGIT_MERGE_FILE_STYLE_MERGE: Create standard conflicted merge files. 586 * GGIT_MERGE_FILE_STYLE_DIFF3: Create diff3-style files. 587 * GGIT_MERGE_FILE_SIMPLIFY_ALNUM: Condense non-alphanumeric regions for simplified diff file. 588 * GGIT_MERGE_FILE_IGNORE_WHITESPACE: Ignore all whitespace. 589 * GGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE: Ignore changes in amount of whitespace. 590 * GGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL: Ignore whitespace at end of line. 591 * GGIT_MERGE_FILE_DIFF_PATIENCE: Use the "patience diff" algorithm. 592 * GGIT_MERGE_FILE_DIFF_MINIMAL: Take extra time to find minimal diff. 593 */ 594 typedef enum { 595 GGIT_MERGE_FILE_DEFAULT = 0, 596 GGIT_MERGE_FILE_STYLE_MERGE = (1 << 0), 597 GGIT_MERGE_FILE_STYLE_DIFF3 = (1 << 1), 598 GGIT_MERGE_FILE_SIMPLIFY_ALNUM = (1 << 2), 599 GGIT_MERGE_FILE_IGNORE_WHITESPACE = (1 << 3), 600 GGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = (1 << 4), 601 GGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5), 602 GGIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6), 603 GGIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7), 604 } GgitMergeFileFlags; 605 606 /** 607 * GgitMergeFlags: 608 * @GGIT_MERGE_FIND_RENAMES: detect renames that occur between the common 609 * ancestor and the "ours" side or the common ancestor and the "theirs" side. 610 * This will enable the ability to merge between a modified and renamed file. 611 * @GGIT_MERGE_FAIL_ON_CONFLICT: If a conflict occurs, exit immediately instead 612 * of attempting to continue resolving conflicts. The merge operation will 613 * fail with @GGIT_EMERGECONFLICT and no index will be returned. 614 * @GGIT_MERGE_SKIP_REUC: do not write the REUC extension on the generated index. 615 * @GGIT_MERGE_NO_RECURSIVE: If the commits being merged have multiple merge bases, 616 * do not build a recursive merge base (by merging the multiple merge bases), 617 * instead simply use the first base. This flag provides a similar 618 * merge base to `git-merge-resolve`. 619 */ 620 typedef enum { 621 GGIT_MERGE_FIND_RENAMES = (1 << 0), 622 GGIT_MERGE_FAIL_ON_CONFLICT = (1 << 1), 623 GGIT_MERGE_SKIP_REUC = (1 << 2), 624 GGIT_MERGE_NO_RECURSIVE = (1 << 3) 625 } GgitMergeFlags; 626 627 /** 628 * GgitProxyType: 629 * @GGIT_PROXY_NONE: Do not attempt to connect through a proxy. 630 * @GGIT_PROXY_AUTO: Try to auto-detect the proxy from the git configuration. 631 * @GGIT_PROXY_SPECIFIED: Connect via the URL given in the options. 632 * 633 * The type of proxy to use. 634 */ 635 typedef enum { 636 GGIT_PROXY_NONE, 637 GGIT_PROXY_AUTO, 638 GGIT_PROXY_SPECIFIED 639 } GgitProxyType; 640 641 /** 642 * GgitRebaseOperationType: 643 * @GGIT_REBASE_OPERATION_PICK: The given commit is to be cherry-picked. 644 * The client should commit the changes and continue if there are no conflicts. 645 * @GGIT_REBASE_OPERATION_REWORD: The given commit is to be cherry-picked, 646 * but the client should prompt the user to provide an updated commit message. 647 * @GGIT_REBASE_OPERATION_EDIT: The given commit is to be cherry-picked, 648 * but the client should stop to allow the user to edit the changes before 649 * committing them. 650 * @GGIT_REBASE_OPERATION_SQUASH: The given commit is to be squashed into 651 * the previous commit. The commit message will be merged with the previous message. 652 * @GGIT_REBASE_OPERATION_FIXUP: The given commit is to be squashed into the 653 * previous commit. The commit message from this commit will be discarded. 654 * @GGIT_REBASE_OPERATION_EXEC: No commit will be cherry-picked. 655 * The client should run the given command and (if successful) continue. 656 * 657 * Type of rebase operation in-progress. 658 */ 659 typedef enum { 660 GGIT_REBASE_OPERATION_PICK = 0, 661 GGIT_REBASE_OPERATION_REWORD, 662 GGIT_REBASE_OPERATION_EDIT, 663 GGIT_REBASE_OPERATION_SQUASH, 664 GGIT_REBASE_OPERATION_FIXUP, 665 GGIT_REBASE_OPERATION_EXEC 666 } GgitRebaseOperationType; 667 668 /* NOTE: keep in sync with git2/refs.h */ 669 /** 670 * GgitRemoteDownloadTagsType: 671 * @GGIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED: Use the setting from the configuration. 672 * @GGIT_REMOTE_DOWNLOAD_TAGS_AUTO: Ask the server for tags pointing to objects we're already 673 * downloading. 674 * @GGIT_REMOTE_DOWNLOAD_TAGS_NONE: Don't ask for any tags beyond the refspecs. 675 * @GGIT_REMOTE_DOWNLOAD_TAGS_ALL: Ask for the all the tags. 676 * 677 * Automatic tag following option 678 * 679 * Lets us select the --tags option to use. 680 */ 681 typedef enum { 682 GGIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED = 0, 683 GGIT_REMOTE_DOWNLOAD_TAGS_AUTO, 684 GGIT_REMOTE_DOWNLOAD_TAGS_NONE, 685 GGIT_REMOTE_DOWNLOAD_TAGS_ALL 686 } GgitRemoteDownloadTagsType; 687 688 /* NOTE: keep in sync with git2/remote.h */ 689 /** 690 * GgitRemoteCompletionType: 691 * @GGIT_REMOTE_COMPLETION_DOWNLOAD: download. 692 * @GGIT_REMOTE_COMPLETION_INDEXING: indexing. 693 * @GGIT_REMOTE_COMPLETION_ERROR: error. 694 * 695 * Argument to the completion callback which tells it which operation finished. 696 */ 697 typedef enum { 698 GGIT_REMOTE_COMPLETION_DOWNLOAD = 0, 699 GGIT_REMOTE_COMPLETION_INDEXING = 1, 700 GGIT_REMOTE_COMPLETION_ERROR = 2 701 } GgitRemoteCompletionType; 702 703 /* NOTE: keep in sync with git2/refs.h */ 704 /** 705 * GgitRefType: 706 * @GGIT_REF_INVALID: An invalid reference. 707 * @GGIT_REF_OID: A reference which points at an object id. 708 * @GGIT_REF_SYMBOLIC: A reference which points at another reference. 709 * @GGIT_REF_LISTALL: All reference types. 710 * 711 * Describes the type a reference is. 712 */ 713 typedef enum { 714 GGIT_REF_INVALID = 0, 715 GGIT_REF_OID = 1, 716 GGIT_REF_SYMBOLIC = 2, 717 GGIT_REF_LISTALL = GGIT_REF_OID | GGIT_REF_SYMBOLIC 718 } GgitRefType; 719 720 /** 721 * GgitResetType: 722 * @GGIT_RESET_SOFT: The head will be moved to the commit. 723 * @GGIT_RESET_MIXED: the head will be moved to the commit and the index 724 * will be replaced with the content of the commit tree. 725 * @GGIT_RESET_HARD: MIXED plus changes in working tree discarded. 726 * 727 * Describes the type of reset to perform. 728 */ 729 typedef enum { 730 GGIT_RESET_SOFT = 1, 731 GGIT_RESET_MIXED = 2, 732 GGIT_RESET_HARD = 3 733 } GgitResetType; 734 735 /** 736 * GgitSortMode: 737 * @GGIT_SORT_NONE: Sorts the repository contents in no particular ordering; 738 * this sorting is arbitrary, implementation-specific 739 * and subject to change at any time. 740 * @GGIT_SORT_TOPOLOGICAL: Sorts the repository contents in topological order 741 * (parents before children); this sorting mode 742 * can be combined with time sorting. 743 * @GGIT_SORT_TIME: Sort the repository contents by commit time; 744 * this sorting mode can be combined with 745 * topological sorting. 746 * @GGIT_SORT_REVERSE: Iterate through the repository contents in reverse 747 * order; this sorting mode can be combined with 748 * any of the above. 749 * 750 * The type of sorting mode for the revision walker. 751 */ 752 typedef enum { 753 GGIT_SORT_NONE = 0, 754 GGIT_SORT_TOPOLOGICAL = 1 << 0, 755 GGIT_SORT_TIME = 1 << 1, 756 GGIT_SORT_REVERSE = 1 << 2 757 } GgitSortMode; 758 759 /** 760 * GgitStashFlags: 761 * @GGIT_STASH_DEFAULT: default stash. 762 * @GGIT_STASH_KEEP_INDEX: All changes already added to the index 763 * are left intact in the working directory. 764 * @GGIT_STASH_INCLUDE_UNTRACKED: All untracked files are also stashed and then 765 * cleaned up from the working directory. 766 * @GGIT_STASH_INCLUDE_IGNORED: All ignored files are also stashed and then 767 * cleaned up from the working directory. 768 * 769 * Describes how a stash should be applied. 770 */ 771 typedef enum { 772 GGIT_STASH_DEFAULT = 0, 773 GGIT_STASH_KEEP_INDEX = 1 << 0, 774 GGIT_STASH_INCLUDE_UNTRACKED = 1 << 1, 775 GGIT_STASH_INCLUDE_IGNORED = 1 << 2 776 } GgitStashFlags; 777 778 /* NOTE: keep in sync with git2/status.h */ 779 /** 780 * GgitStatusFlags: 781 * @GGIT_STATUS_CURRENT: file is current. 782 * @GGIT_STATUS_INDEX_NEW: file in index is new. 783 * @GGIT_STATUS_INDEX_MODIFIED: file in index is modified. 784 * @GGIT_STATUS_INDEX_DELETED: file in index is deleted. 785 * @GGIT_STATUS_WORKING_TREE_NEW: file in working tree is new. 786 * @GGIT_STATUS_WORKING_TREE_MODIFIED: file in working tree is modified. 787 * @GGIT_STATUS_WORKING_TREE_DELETED: file in working tree is deleted. 788 * @GGIT_STATUS_IGNORED: file is ignored. 789 * 790 * Describes a file's status. 791 */ 792 typedef enum { 793 GGIT_STATUS_CURRENT = 0, 794 GGIT_STATUS_INDEX_NEW = 1 << 0, 795 GGIT_STATUS_INDEX_MODIFIED = 1 << 1, 796 GGIT_STATUS_INDEX_DELETED = 1 << 2, 797 GGIT_STATUS_INDEX_RENAMED = 1 << 3, 798 GGIT_STATUS_INDEX_TYPECHANGE = 1 << 4, 799 GGIT_STATUS_WORKING_TREE_NEW = 1 << 7, 800 GGIT_STATUS_WORKING_TREE_MODIFIED = 1 << 8, 801 GGIT_STATUS_WORKING_TREE_DELETED = 1 << 9, 802 GGIT_STATUS_WORKING_TREE_TYPECHANGE = 1 << 10, 803 GGIT_STATUS_IGNORED = 1 << 14 804 } GgitStatusFlags; 805 806 /** 807 * GgitSubmoduleIgnore: 808 * @GGIT_SUBMODULE_IGNORE_UNSPECIFIED: reset to on-disk value. 809 * @GGIT_SUBMODULE_IGNORE_NONE: don't ignore any change. 810 * @GGIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files. 811 * @GGIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory. 812 * @GGIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty. 813 * 814 * Describes which submodules should be ignored. 815 */ 816 typedef enum { 817 GGIT_SUBMODULE_IGNORE_UNSPECIFIED = -1, 818 819 GGIT_SUBMODULE_IGNORE_NONE = 1, 820 GGIT_SUBMODULE_IGNORE_UNTRACKED = 2, 821 GGIT_SUBMODULE_IGNORE_DIRTY = 3, 822 GGIT_SUBMODULE_IGNORE_ALL = 4 823 } GgitSubmoduleIgnore; 824 825 /** 826 * GgitSubmoduleRecurse: 827 * @GGIT_SUBMODULE_RECURSE_NO: do no recurse into submodules. 828 * @GGIT_SUBMODULE_RECURSE_YES: recurse into submodules. 829 * @GGIT_SUBMODULE_RECURSE_ONDEMAND: recurse into submodules only when 830 * commit not already in local clone. 831 * 832 * Options for submodule recurse. 833 * Represents the value of `submodule.$name.fetchRecurseSubmodules` 834 */ 835 typedef enum { 836 GGIT_SUBMODULE_RECURSE_NO = 0, 837 GGIT_SUBMODULE_RECURSE_YES = 1, 838 GGIT_SUBMODULE_RECURSE_ONDEMAND = 2 839 } GgitSubmoduleRecurse; 840 841 /** 842 * GgitSubmoduleStatus: 843 * FIXME 844 */ 845 typedef enum { 846 GGIT_SUBMODULE_STATUS_IN_HEAD = 1 << 0, 847 GGIT_SUBMODULE_STATUS_IN_INDEX = 1 << 1, 848 GGIT_SUBMODULE_STATUS_IN_CONFIG = 1 << 2, 849 GGIT_SUBMODULE_STATUS_IN_WD = 1 << 3, 850 GGIT_SUBMODULE_STATUS_INDEX_ADDED = 1 << 4, 851 GGIT_SUBMODULE_STATUS_INDEX_DELETED = 1 << 5, 852 GGIT_SUBMODULE_STATUS_INDEX_MODIFIED = 1 << 6, 853 GGIT_SUBMODULE_STATUS_WD_UNINITIALIZED = 1 << 7, 854 GGIT_SUBMODULE_STATUS_WD_ADDED = 1 << 8, 855 GGIT_SUBMODULE_STATUS_WD_DELETED = 1 << 9, 856 GGIT_SUBMODULE_STATUS_WD_MODIFIED = 1 << 10, 857 GGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED = 1 << 11, 858 GGIT_SUBMODULE_STATUS_WD_WD_MODIFIED = 1 << 12, 859 GGIT_SUBMODULE_STATUS_WD_UNTRACKED = 1 << 13 860 } GgitSubmoduleStatus; 861 862 /** 863 * GgitSubmoduleUpdate: 864 * @GGIT_SUBMODULE_UPDATE_CHECKOUT: checkout the submodule. 865 * @GGIT_SUBMODULE_UPDATE_REBASE: rebase the current branch onto the 866 * commit recorded in the superproject. 867 * @GGIT_SUBMODULE_UPDATE_MERGE: merge the commit recorded in the 868 * superproject into the current branch. 869 * @GGIT_SUBMODULE_UPDATE_NONE: do not update this submodule. 870 * @GGIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer 871 * when we don't want any particular update rule to be specified. 872 * 873 * Describes how a submodule should be updated. 874 */ 875 typedef enum { 876 GGIT_SUBMODULE_UPDATE_CHECKOUT = 1, 877 GGIT_SUBMODULE_UPDATE_REBASE = 2, 878 GGIT_SUBMODULE_UPDATE_MERGE = 3, 879 GGIT_SUBMODULE_UPDATE_NONE = 4, 880 881 GGIT_SUBMODULE_UPDATE_DEFAULT = 0 882 } GgitSubmoduleUpdate; 883 884 /** 885 * GgitTreeWalkMode: 886 * @GGIT_TREE_WALK_MODE_PRE: walk tree in pre-order 887 * @GGIT_TREE_WALK_MODE_POST: walk tree in post-order 888 * 889 * Describes in which order a tree walk should be performed. 890 */ 891 typedef enum { 892 GGIT_TREE_WALK_MODE_PRE = 0, 893 GGIT_TREE_WALK_MODE_POST = 1 894 } GgitTreeWalkMode; 895 896 /** 897 * GgitStatusOption: 898 * GGIT_STATUS_OPTION_INCLUDE_UNTRACKED: include untracked files (default). 899 * GGIT_STATUS_OPTION_INCLUDE_IGNORED: include ignored files (default). 900 * GGIT_STATUS_OPTION_INCLUDE_UNMODIFIED: include unmodified files. 901 * GGIT_STATUS_OPTION_EXCLUDE_SUBMODULES: exclude submodules. 902 * GGIT_STATUS_OPTION_RECURSE_UNTRACKED_DIRS: search untracked directories recursively (default). 903 * GGIT_STATUS_OPTION_DISABLE_PATHSPEC_MATCH: do not match path specifications. 904 * GGIT_STATUS_OPTION_RECURSE_IGNORED_DIRS: search ignored directories recursively. 905 * GGIT_STATUS_OPTION_RENAMES_HEAD_TO_INDEX: indicates that rename detection 906 * should be processed between the head and the index and enables 907 * the GIT_STATUS_INDEX_RENAMED as a possible status flag. 908 * GGIT_STATUS_OPTION_RENAMES_INDEX_TO_WORKDIR: indicates tha rename 909 * detection should be run between the index and the working directory 910 * and enabled GIT_STATUS_WT_RENAMED as a possible status flag. 911 * GGIT_STATUS_OPTION_SORT_CASE_SENSITIVELY: sort case sensitive. 912 * GGIT_STATUS_OPTION_SORT_CASE_INSENSITIVELY: sort case insensitive. 913 * GGIT_STATUS_OPTION_DEFAULT: default flags. 914 * 915 * Status options specified when using #ggit_repository_file_status_foreach. 916 * 917 */ 918 typedef enum { 919 GGIT_STATUS_OPTION_INCLUDE_UNTRACKED = (1 << 0), 920 GGIT_STATUS_OPTION_INCLUDE_IGNORED = (1 << 1), 921 GGIT_STATUS_OPTION_INCLUDE_UNMODIFIED = (1 << 2), 922 GGIT_STATUS_OPTION_EXCLUDE_SUBMODULES = (1 << 3), 923 GGIT_STATUS_OPTION_RECURSE_UNTRACKED_DIRS = (1 << 4), 924 GGIT_STATUS_OPTION_DISABLE_PATHSPEC_MATCH = (1 << 5), 925 GGIT_STATUS_OPTION_RECURSE_IGNORED_DIRS = (1 << 6), 926 GGIT_STATUS_OPTION_RENAMES_HEAD_TO_INDEX = (1 << 7), 927 GGIT_STATUS_OPTION_RENAMES_INDEX_TO_WORKDIR = (1 << 8), 928 GGIT_STATUS_OPTION_SORT_CASE_SENSITIVELY = (1 << 9), 929 GGIT_STATUS_OPTION_SORT_CASE_INSENSITIVELY = (1 << 10), 930 GGIT_STATUS_OPTION_DEFAULT = GGIT_STATUS_OPTION_INCLUDE_IGNORED | GGIT_STATUS_OPTION_INCLUDE_UNTRACKED | GGIT_STATUS_OPTION_RECURSE_UNTRACKED_DIRS 931 } GgitStatusOption; 932 933 /** 934 * GgitStatusShow: 935 * @GGIT_STATUS_SHOW_INDEX_AND_WORKDIR: receive one callback for each file, 936 * even if the file is in both the index and the workdir (combining #GgitStatusFlags). 937 * @GGIT_STATUS_SHOW_INDEX_ONLY: only receive callbacks for files in the index. 938 * @GGIT_STATUS_SHOW_WORKDIR_ONLY: only receive callbacks for files in the workdir. 939 * 940 * Show options for #ggit_repository_file_status_foreach. Determines which 941 * files are included in the status. 942 * 943 */ 944 typedef enum { 945 GGIT_STATUS_SHOW_INDEX_AND_WORKDIR = 0, 946 GGIT_STATUS_SHOW_INDEX_ONLY = 1, 947 GGIT_STATUS_SHOW_WORKDIR_ONLY = 2 948 } GgitStatusShow; 949 950 /** 951 * GgitAttributeCheckFlags: 952 * @GGIT_ATTRIBUTE_CHECK_FILE_THEN_INDEX: check working directory, then index. 953 * @GGIT_ATTRIBUTE_CHECK_INDEX_THEN_FILE: check index, then working directory. 954 * @GGIT_ATTRIBUTE_CHECK_INDEX_ONLY: check only index. 955 * @GGIT_ATTRIBUTE_CHECK_NO_SYSTEM: ignore system wide attributes. 956 * 957 * Attribute check flags indicate the order in which to check for gitattributes. 958 * git core uses @GGIT_ATTRIBUTE_CHECK_FILE_THEN_INDEX for all operations, 959 * except on checkout, where it uses @GGIT_ATTRIBUTE_CHECK_INDEX_THEN_FILE. 960 * 961 */ 962 typedef enum 963 { 964 GGIT_ATTRIBUTE_CHECK_FILE_THEN_INDEX = 0, 965 GGIT_ATTRIBUTE_CHECK_INDEX_THEN_FILE = 1 << 0, 966 GGIT_ATTRIBUTE_CHECK_INDEX_ONLY = 1 << 1, 967 GGIT_ATTRIBUTE_CHECK_NO_SYSTEM = 1 << 2 968 } GgitAttributeCheckFlags; 969 970 /** 971 * GgitPackbuilderStage: 972 * @GGIT_PACKBUILDER_STAGE_ADDING_OBJECTS: adding objects. 973 * @GGIT_PACKBUILDER_STAGE_DELTAFICATION: deltafication. 974 * 975 * Valid stages for pack building. 976 */ 977 typedef enum 978 { 979 GGIT_PACKBUILDER_STAGE_ADDING_OBJECTS = 0, 980 GGIT_PACKBUILDER_STAGE_DELTAFICATION = 1 981 } GgitPackbuilderStage; 982 983 typedef enum 984 { 985 GGIT_CHECKOUT_NONE = 0, 986 GGIT_CHECKOUT_SAFE = (1u << 0), 987 GGIT_CHECKOUT_FORCE = (1u << 1), 988 GGIT_CHECKOUT_RECREATE_MISSING = (1u << 2), 989 GGIT_CHECKOUT_ALLOW_CONFLICTS = (1u << 4), 990 GGIT_CHECKOUT_REMOVE_UNTRACKED = (1u << 5), 991 GGIT_CHECKOUT_REMOVE_IGNORED = (1u << 6), 992 GGIT_CHECKOUT_UPDATE_ONLY = (1u << 7), 993 GGIT_CHECKOUT_DONT_UPDATE_INDEX = (1u << 8), 994 GGIT_CHECKOUT_NO_REFRESH = (1u << 9), 995 GGIT_CHECKOUT_SKIP_UNMERGED = (1u << 10), 996 GGIT_CHECKOUT_USE_OURS = (1u << 11), 997 GGIT_CHECKOUT_USE_THEIRS = (1u << 12), 998 GGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH = (1u << 13), 999 GGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES = (1u << 18), 1000 GGIT_CHECKOUT_DONT_OVERWRITE_IGNORED = (1u << 19), 1001 GGIT_CHECKOUT_CONFLICT_STYLE_MERGE = (1u << 20), 1002 GGIT_CHECKOUT_CONFLICT_STYLE_DIFF3 = (1u << 21), 1003 GGIT_CHECKOUT_DONT_REMOVE_EXISTING = (1u << 22), 1004 GGIT_CHECKOUT_DONT_WRITE_INDEX = (1u << 23), 1005 GGIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16), 1006 GGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17) 1007 } GgitCheckoutStrategy; 1008 1009 typedef enum { 1010 GGIT_CHECKOUT_NOTIFY_NONE = 0, 1011 GGIT_CHECKOUT_NOTIFY_CONFLICT = (1u << 0), 1012 GGIT_CHECKOUT_NOTIFY_DIRTY = (1u << 1), 1013 GGIT_CHECKOUT_NOTIFY_UPDATED = (1u << 2), 1014 GGIT_CHECKOUT_NOTIFY_UNTRACKED = (1u << 3), 1015 GGIT_CHECKOUT_NOTIFY_IGNORED = (1u << 4), 1016 1017 GGIT_CHECKOUT_NOTIFY_ALL = 0x0FFFFu 1018 } GgitCheckoutNotifyFlags; 1019 1020 typedef enum { 1021 GGIT_DIFF_FIND_BY_CONFIG = 0, 1022 GGIT_DIFF_FIND_RENAMES = (1u << 0), 1023 GGIT_DIFF_FIND_RENAMES_FROM_REWRITES = (1u << 1), 1024 GGIT_DIFF_FIND_COPIES = (1u << 2), 1025 GGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED = (1u << 3), 1026 GGIT_DIFF_FIND_REWRITES = (1u << 4), 1027 GGIT_DIFF_BREAK_REWRITES = (1u << 5), 1028 GGIT_DIFF_FIND_AND_BREAK_REWRITES = (GGIT_DIFF_FIND_REWRITES | GGIT_DIFF_BREAK_REWRITES), 1029 GGIT_DIFF_FIND_FOR_UNTRACKED = (1u << 6), 1030 GGIT_DIFF_FIND_ALL = (0x0ff), 1031 GGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE = 0, 1032 GGIT_DIFF_FIND_IGNORE_WHITESPACE = (1u << 12), 1033 GGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE = (1u << 13), 1034 GGIT_DIFF_FIND_EXACT_MATCH_ONLY = (1u << 14), 1035 GGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY = (1u << 15), 1036 GGIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16) 1037 } GgitDiffFindFlags; 1038 1039 typedef enum 1040 { 1041 GGIT_DIFF_FORMAT_EMAIL_NONE = 0, 1042 GGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0) 1043 } GgitDiffFormatEmailFlags; 1044 1045 typedef enum 1046 { 1047 GGIT_CREDTYPE_USERPASS_PLAINTEXT = (1u << 0), 1048 GGIT_CREDTYPE_SSH_KEY = (1u << 1), 1049 GGIT_CREDTYPE_SSH_CUSTOM = (1u << 2), 1050 GGIT_CREDTYPE_DEFAULT = (1u << 3), 1051 GGIT_CREDTYPE_SSH_INTERACTIVE = (1u << 4), 1052 } GgitCredtype; 1053 1054 typedef enum 1055 { 1056 GGIT_DIRECTION_FETCH = 0, 1057 GGIT_DIRECTION_PUSH = 1 1058 } GgitDirection; 1059 1060 typedef enum 1061 { 1062 GGIT_CLONE_LOCAL_AUTO = 0, 1063 GGIT_CLONE_LOCAL_LOCAL = 1, 1064 GGIT_CLONE_LOCAL_NO_LOCAL = 2, 1065 GGIT_CLONE_LOCAL_NO_LINKS = 3 1066 } GgitCloneLocal; 1067 1068 /** 1069 * GgitConfigCallback: 1070 * @entry: a #GgitConfigEntry. 1071 * @user_data: (closure): user-supplied data. 1072 * 1073 * The type of the callback functions for retrieving values from a #GgitConfig. 1074 * See ggit_config_foreach(). 1075 * 1076 * Returns: 0 to go for the next config value or a #GgitError in case there was 1077 * an error. 1078 */ 1079 typedef gint (* GgitConfigCallback) (GgitConfigEntry *entry, 1080 gpointer user_data); 1081 1082 /** 1083 * GgitConfigMatchCallback: 1084 * @match_info: the match 1085 * @value: the value 1086 * @user_data: (closure): user-supplied data. 1087 * 1088 * The type of the callback functions for retrieving values from a #GgitConfig 1089 * using a regular expression. See ggit_config_match_foreach(). 1090 * 1091 * Returns: 0 to go for the next config value or a #GgitError in case there was 1092 * an error. 1093 */ 1094 typedef gint (* GgitConfigMatchCallback) (GMatchInfo *match_info, 1095 const gchar *value, 1096 gpointer user_data); 1097 1098 /** 1099 * GgitDiffBinaryCallback: 1100 * @delta: a #GgitDiffDelta. 1101 * @binary: a #GgitDiffBinary. 1102 * @user_data: (closure): user-supplied data. 1103 * 1104 * Called for each file. 1105 * 1106 * Returns: 0 to go continue or a #GgitError in case there was an error. 1107 */ 1108 typedef gint (* GgitDiffBinaryCallback) (GgitDiffDelta *delta, 1109 GgitDiffBinary *binary, 1110 gpointer user_data); 1111 1112 /** 1113 * GgitDiffFileCallback: 1114 * @delta: a #GgitDiffDelta. 1115 * @progress: the progress. 1116 * @user_data: (closure): user-supplied data. 1117 * 1118 * Called for each file. 1119 * 1120 * Returns: 0 to go continue or a #GgitError in case there was an error. 1121 */ 1122 typedef gint (* GgitDiffFileCallback) (GgitDiffDelta *delta, 1123 gfloat progress, 1124 gpointer user_data); 1125 1126 /** 1127 * GgitDiffHunkCallback: 1128 * @delta: a #GgitDiffDelta. 1129 * @hunk: a #GgitDiffHunk. 1130 * @user_data: (closure): user-supplied data. 1131 * 1132 * Called for each hunk. 1133 * 1134 * Returns: 0 to go continue or a #GgitError in case there was an error. 1135 */ 1136 typedef gint (* GgitDiffHunkCallback) (GgitDiffDelta *delta, 1137 GgitDiffHunk *hunk, 1138 gpointer user_data); 1139 1140 /** 1141 * GgitDiffLineCallback: 1142 * @delta: a #GgitDiffDelta. 1143 * @hunk: (nullable): a #GgitDiffHunk. 1144 * @line: a #GgitDiffLine. 1145 * @user_data: (closure): user-supplied data. 1146 * 1147 * Called for each line. 1148 * 1149 * Returns: 0 to go continue or a #GgitError in case there was an error. 1150 */ 1151 typedef gint (* GgitDiffLineCallback) (GgitDiffDelta *delta, 1152 GgitDiffHunk *hunk, 1153 GgitDiffLine *line, 1154 gpointer user_data); 1155 1156 /* 1157 * FIXME: request docs for this to libgit2 1158 */ 1159 typedef gint (* GgitDiffSimilarityMetricFileSignatureCallback) (GgitDiffFile *file, 1160 const gchar *fullpath, 1161 gpointer *out, 1162 gpointer user_data); 1163 1164 1165 typedef gint (* GgitDiffSimilarityMetricBufferSignatureCallback) (GgitDiffFile *file, 1166 const gchar *buf, 1167 gsize buflen, 1168 gpointer *out, 1169 gpointer user_data); 1170 1171 typedef void (* GgitDiffSimilarityMetricFreeSignatureCallback) (gpointer signature, 1172 gpointer user_data); 1173 1174 typedef gint (* GgitDiffSimilarityMetricSimilarityCallback) (gint *score, 1175 gpointer signature_a, 1176 gpointer signature_b, 1177 gpointer user_data); 1178 1179 /** 1180 * GgitNoteCallback: 1181 * @blob_id: id of the blob containing the message. 1182 * @annotated_object_id: id of the git object being annotated. 1183 * @user_data: (closure): user-suplied data. 1184 * 1185 * When iterating over all the notes, callback that will be 1186 * issued per note. See ggit_repository_note_foreach(). 1187 * 1188 * Returns: 0 to go continue or a #GgitError in case there was an error. 1189 */ 1190 typedef gint (* GgitNoteCallback) (GgitOId *blob_id, 1191 GgitOId *annotated_object_id, 1192 gpointer user_data); 1193 1194 /** 1195 * GgitReferencesNameCallback: 1196 * @name: the name of the reference 1197 * @user_data: (closure): user-supplied data. 1198 * 1199 * The type of the callback functions for retrieving the references 1200 * in a #GgitRepository. See ggit_repository_references_foreach_name(). 1201 * 1202 * Returns: 0 to go for the next references or a #GgitError in case there was an error. 1203 */ 1204 typedef gint (* GgitReferencesNameCallback) (const gchar *name, 1205 gpointer user_data); 1206 1207 /** 1208 * GgitReferencesCallback: 1209 * @reference: (transfer full): the reference. 1210 * @user_data: (closure): user-supplied data. 1211 * 1212 * The type of the callback functions for retrieving the references 1213 * in a #GgitRepository. See ggit_repository_references_foreach(). 1214 * 1215 * Returns: 0 to go for the next references or a #GgitError in case there was an error. 1216 */ 1217 typedef gint (* GgitReferencesCallback) (GgitRef *reference, 1218 gpointer user_data); 1219 1220 /** 1221 * GgitRemoteListCallback: 1222 * @name: the name of the reference. 1223 * @oid: the reference's oid. 1224 * @loid: the reference's loid. 1225 * @local: if available locally. 1226 * @user_data: (closure): user-supplied data. 1227 * 1228 * The type of the callback functions for listing the references of a 1229 * #GgitRemote. See ggit_remote_list(). 1230 * 1231 * Returns: 0 to go continue or a #GgitError in case there was an error. 1232 */ 1233 typedef gint (* GgitRemoteListCallback) (const gchar *name, 1234 GgitOId *oid, 1235 GgitOId *loid, 1236 gboolean local, 1237 gpointer user_data); 1238 1239 /** 1240 * GgitStashCallback: 1241 * @index: the position within the stash list. 0 points to the 1242 * most recent stashed state. 1243 * @message: the stash message. 1244 * @stash_oid: the commit oid of the stashed state. 1245 * @user_data: (closure): user-suplied data. 1246 * 1247 * When iterating over all the stashed states, callback that will be 1248 * issued per entry. See ggit_repository_stash_foreach(). 1249 * 1250 * Returns: 0 to go continue or a #GgitError in case there was an error. 1251 */ 1252 typedef gint (* GgitStashCallback) (gsize index, 1253 const gchar *message, 1254 GgitOId *stash_oid, 1255 gpointer user_data); 1256 1257 /** 1258 * GgitStatusCallback: 1259 * @path: the file to retrieve status for, rooted at the repository working dir. 1260 * @status_flags: the status value. 1261 * @user_data: (closure): user-supplied data. 1262 * 1263 * The type of the callback functions for retrieving the status of the files 1264 * in a #GgitRepository. See ggit_repository_file_status_foreach(). 1265 * 1266 * Returns: 0 to go for the next file or a #GgitError in case there was an error. 1267 */ 1268 typedef gint (* GgitStatusCallback) (const gchar *path, 1269 GgitStatusFlags status_flags, 1270 gpointer user_data); 1271 1272 /** 1273 * GgitSubmoduleCallback: 1274 * @submodule: a #GgitSubmodule. 1275 * @name: the name of the submodule. 1276 * @user_data: (closure): user-supplied data. 1277 * 1278 * The type of the callback functions for retrieving the submodules 1279 * in a #GgitRepository. See ggit_repository_submodule_foreach(). 1280 * 1281 * Returns: 0 to go for the next submodule or a #GgitError in case there was an error. 1282 */ 1283 typedef gint (* GgitSubmoduleCallback) (GgitSubmodule *submodule, 1284 const gchar *name, 1285 gpointer user_data); 1286 1287 /** 1288 * GgitTagCallback: 1289 * @name: the tag name. 1290 * @tag_oid: the tag oid. 1291 * @user_data: (closure): user-suplied data. 1292 * 1293 * When iterating over all the tags, callback that will be 1294 * issued per entry. See ggit_repository_tag_foreach(). 1295 * 1296 * Returns: 0 to go continue or a #GgitError in case there was an error. 1297 */ 1298 typedef gint (* GgitTagCallback) (const gchar *name, 1299 GgitOId *tag_oid, 1300 gpointer user_data); 1301 1302 /** 1303 * GgitTransferProgressCallback: 1304 * @stats: a #GgitTransferProgress. 1305 * @user_data: (closure): user-supplied data. 1306 * 1307 * Progress callbacks during indexing. 1308 * 1309 * Returns: a value less than zero to cancel the transfer. 1310 */ 1311 typedef gint (* GgitTransferProgressCallback) (GgitTransferProgress *stats, 1312 gpointer user_data); 1313 1314 /** 1315 * GgitTreeWalkCallback: 1316 * @root: the current (relative) root of the entry 1317 * @entry: the tree entry 1318 * @user_data: (closure): user-supplied data. 1319 * 1320 * The type of the callback functions for walking a tree. 1321 * See ggit_tree_walk(). 1322 * 1323 * Returns: 0 to go for the next entry or a #GgitError in case there was an error. 1324 * 1325 */ 1326 typedef gint (* GgitTreeWalkCallback) (const gchar *root, 1327 const GgitTreeEntry *entry, 1328 gpointer user_data); 1329 1330 G_END_DECLS 1331 1332 #endif /* __GGIT_TYPES_H__ */ 1333 1334 /* ex:set ts=8 noet: */ 1335