summaryrefslogtreecommitdiff
path: root/include/git2
Commit message (Collapse)AuthorAgeFilesLines
* diff: treat binary patches with no data specialethomson/diff-read-empty-binaryEdward Thomson2016-09-051-0/+8
| | | | | | When creating and printing diffs, deal with binary deltas that have binary data specially, versus diffs that have a binary file but lack the actual binary data.
* index: support index v4David Turner2016-08-101-0/+25
| | | | | | | Support reading and writing index v4. Index v4 uses a very simple compression scheme for pathnames, but is otherwise similar to index v3. Signed-off-by: David Turner <dturner@twitter.com>
* diff: document `git_diff_from_buffer`ethomson/doc_diff_from_bufferEdward Thomson2016-08-051-0/+19
|
* odb: freshen existing objects when writingEdward Thomson2016-08-041-0/+11
| | | | | | When writing an object, we calculate its OID and see if it exists in the object database. If it does, we need to freshen the file that contains it.
* git_diff_file: move `id_abbrev`ethomson/diff_fileEdward Thomson2016-08-031-6/+6
| | | | | Move `id_abbrev` to a more reasonable place where it packs more nicely (before anybody starts using it).
* packbuilder: `size_t` all the thingsEdward Thomson2016-07-241-4/+4
| | | | | | | | After 1cd65991, we were passing a pointer to an `unsigned long` to a function that now expected a pointer to a `size_t`. These types differ on 64-bit Windows, which means that we trash the stack. Use `size_t`s in the packbuilder to avoid this.
* Add get user agent functionality.Andrius Bentkus2016-07-051-0/+1
|
* Merge pull request #3711 from joshtriplett/git_repository_discover_defaultEdward Thomson2016-07-011-1/+20
|\ | | | | Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment vars
| * Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment varsJosh Triplett2016-06-241-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_repository_open_ext provides parameters for the start path, whether to search across filesystems, and what ceiling directories to stop at. git commands have standard environment variables and defaults for each of those, as well as various other parameters of the repository. To avoid duplicate environment variable handling in users of libgit2, add a GIT_REPOSITORY_OPEN_FROM_ENV flag, which makes git_repository_open_ext automatically handle the appropriate environment variables. Commands that intend to act just like those built into git itself can use this flag to get the expected default behavior. git_repository_open_ext with the GIT_REPOSITORY_OPEN_FROM_ENV flag respects $GIT_DIR, $GIT_DISCOVERY_ACROSS_FILESYSTEM, $GIT_CEILING_DIRECTORIES, $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and $GIT_ALTERNATE_OBJECT_DIRECTORIES. In the future, when libgit2 gets worktree support, git_repository_open_env will also respect $GIT_WORK_TREE and $GIT_COMMON_DIR; until then, git_repository_open_ext with this flag will error out if either $GIT_WORK_TREE or $GIT_COMMON_DIR is set.
| * Add GIT_REPOSITORY_OPEN_NO_DOTGIT flag to avoid appending /.gitJosh Triplett2016-06-241-0/+4
| | | | | | | | | | | | | | | | | | | | GIT_REPOSITORY_OPEN_NO_SEARCH does not search up through parent directories, but still tries the specified path both directly and with /.git appended. GIT_REPOSITORY_OPEN_BARE avoids appending /.git, but opens the repository in bare mode even if it has a working directory. To support the semantics git uses when given $GIT_DIR in the environment, provide a new GIT_REPOSITORY_OPEN_NO_DOTGIT flag to not try appending /.git.
* | submodule: Try to fetch when update fails to find the target commit in the ↵Jason Haslam2016-06-281-3/+11
| | | | | | | | submodule.
* | Merge pull request #3223 from ethomson/applyEdward Thomson2016-06-252-8/+37
|\ \ | |/ |/| Reading patch files
| * Introduce `git_diff_to_buf`Edward Thomson2016-05-261-0/+15
| | | | | | | | | | Like `git_patch_to_buf`, provide a simple helper method that can print an entire diff directory to a `git_buf`.
| * introduce `git_diff_from_buffer` to parse diffsEdward Thomson2016-05-261-0/+5
| | | | | | | | Parse diff files into a `git_diff` structure.
| * patch: `git_patch_from_patchfile` -> `git_patch_from_buffer`Edward Thomson2016-05-261-26/+0
| |
| * Introduce git_patch_options, handle prefixesEdward Thomson2016-05-261-1/+14
| | | | | | | | | | Handle prefixes (in terms of number of path components) for patch parsing.
| * diff: include oid length in deltasEdward Thomson2016-05-261-1/+7
| | | | | | | | | | | | Now that `git_diff_delta` data can be produced by reading patch file data, which may have an abbreviated oid, allow consumers to know that the id is abbreviated.
| * Patch parsing from patch filesEdward Thomson2016-05-262-6/+21
| |
| * Introduce git_apply_patchEdward Thomson2016-05-261-1/+2
| | | | | | | | | | The beginnings of patch application from an existing (diff-created) git_patch object: applies the hunks of a git_patch to a buffer.
* | documentation: improve docs for `checkout_head`ethomson/checkout_head_docsEdward Thomson2016-06-151-0/+7
|/ | | | | `git_checkout_head` is sadly misunderstood as something that can switch branches. It cannot. Update the documentation to reflect this.
* Introduce a function to create a tree based on a different onecmn/tree-updateCarlos Martín Nieto2016-05-171-0/+46
| | | | | | | | | | | Instead of going through the usual steps of reading a tree recursively into an index, modifying it and writing it back out as a tree, introduce a function to perform simple updates more efficiently. `git_tree_create_updated` avoids reading trees which are not modified and supports upsert and delete operations. It is not as versatile as modifying the index, but it makes some common operations much more efficient.
* Introduce `git_signature_from_buffer`ethomson/signature_from_bufferEdward Thomson2016-04-281-0/+13
| | | | | Allow users to construct a signature from the type of signature lines that actually appear in commits.
* Remove traces of `git_blob_create_fromchunks`Arthur Schreiber2016-04-261-41/+0
|
* Allow creating copies of `git_reference` objects.Arthur Schreiber2016-04-221-0/+11
|
* proxy: don't specify the protocol in the typeCarlos Martín Nieto2016-04-191-10/+5
| | | | | | We leave this up to the scheme in the url field. The type should only tell us about whether we want a proxy and whether we want to auto-detect it.
* proxy: add a payload field for the proxy optionsCarlos Martín Nieto2016-04-192-0/+22
| | | | | I don't quite recall what we do in the other places where we use this, but we should pass this payload to the callbacks.
* net: use proxy options struct in the stream configCarlos Martín Nieto2016-04-191-1/+2
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-192-4/+19
|
* proxy: introduce a proxy options structCarlos Martín Nieto2016-04-191-0/+91
| | | | It is currently unused; it will go into the remote's options.
* Add missing ')' to callbacks documentationJosh Junon2016-04-121-1/+1
| | | | | Super minor, but it was bugging me. There was a missing closing paren in the docs.
* Add a no-op size_t typedef for the doc parsercmn/typedef-sizetCarlos Martín Nieto2016-03-311-0/+8
| | | | | | | | | Clang's documentation parser, which we use in our documentation system does not report any comments for functions which use size_t as a type. The root cause is buried somewhere in libclang but we can work around it by defining the type ourselves. This typedef makes sure that libclang sees it and that we do not change its size.
* git_object_dup: introduce typesafe versionsEdward Thomson2016-03-234-0/+36
|
* blob: introduce creating a blob by writing into a streamCarlos Martín Nieto2016-03-221-0/+43
| | | | | | | | | | | | | | | | | | | | | The pair of `git_blob_create_frombuffer()` and `git_blob_create_frombuffer_commit()` is meant to replace `git_blob_create_fromchunks()` by providing a way for a user to write a new blob when they want filtering or they do not know the size. This approach allows the caller to retain control over when to add data to this buffer and a more natural fit into higher-level language's own stream abstractions instead of having to handle IO wait in the callback. The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a round multiple of usual page sizes and a value where most blobs seem likely to be either going to be way below or way over that size. It's also a round number of pages. This implementation re-uses the helper we have from `_fromchunks()` so we end up writing everything to disk, but hopefully more efficiently than with a default filebuf. A later optimisation can be to avoid writing the in-memory contents to disk, with some extra complexity.
* merge driver: remove `check` callbackEdward Thomson2016-03-171-62/+6
| | | | | | Since the `apply` callback can defer, the `check` callback is not necessary. Removing the `check` callback further makes the `payload` unnecessary along with the `cleanup` callback.
* merge driver: improve inline documentationEdward Thomson2016-03-171-18/+21
|
* merge driver: allow custom default driverEdward Thomson2016-03-171-1/+10
| | | | | | Allow merge users to configure a custom default merge driver via `git_merge_options`. Similarly, honor the `merge.default` configuration option.
* merge driver: introduce custom merge driversEdward Thomson2016-03-171-0/+230
| | | | | | | | Consumers can now register custom merged drivers with `git_merge_driver_register`. This allows consumers to support the merge drivers, as configured in `.gitattributes`. Consumers will be asked to perform the file-level merge when a custom driver is configured.
* Merge pull request #3673 from libgit2/cmn/commit-with-signatureEdward Thomson2016-03-171-0/+21
|\ | | | | commit: add function to attach a signature to a commit
| * commit: add function to attach a signature to a commitcmn/commit-with-signatureCarlos Martín Nieto2016-03-151-0/+21
| | | | | | | | | | In combination with the function which creates a commit into a buffer, this allows us to more easily create signed commits.
* | Setup better defaults for OpenSSL ciphersDirkjan Bussink2016-03-141-0/+6
| | | | | | | | | | | | | | | | | | This ensures that when using OpenSSL a safe default set of ciphers is selected. This is done so that the client communicates securely and we don't accidentally enable unsafe ciphers like RC4, or even worse some old export ciphers. Implements the first part of https://github.com/libgit2/libgit2/issues/3682
* | Merge pull request #3636 from nerdishbynature/fix-non-modular-header-in-moduleCarlos Martín Nieto2016-03-111-1/+2
|\ \ | |/ |/| Don't include inttypes if compiling for Mac/iOS
| * Check for __CLANG_INTTYPES_HPiet Brauer2016-03-111-1/+2
| | | | | | | | | | | | This fixes an issue in Xcode 7.3 in objective-git where we get the error "Include of non-modular header file in module". Not importing this header again fixes the issue.
* | Merge pull request #3656 from ethomson/exists_prefixesVicent Marti2016-03-081-1/+47
|\ \ | | | | | | Introduce `git_odb_expand_ids`
| * | git_odb_expand_ids: accept git_odb_expand_id arrayEdward Thomson2016-03-081-10/+25
| | | | | | | | | | | | Take (and write to) an array of a struct, `git_odb_expand_id`.
| * | git_odb_expand_ids: rename func, return the typeEdward Thomson2016-03-081-6/+7
| | |
| * | git_odb_exists_many_prefixes: query odb for multiple short idsEdward Thomson2016-03-071-1/+31
| | | | | | | | | | | | | | | Query the object database for multiple objects at a time, given their object ID (which may be abbreviated) and optional type.
* | | commit: split creating the commit and writing it outcmn/commit-to-memoryCarlos Martín Nieto2016-03-081-0/+46
|/ / | | | | | | | | | | Sometimes you want to create a commit but not write it out to the objectdb immediately. For these cases, provide a new function to retrieve the buffer instead of having to go through the db.
* | Bump version to 0.24.0Carlos Martín Nieto2016-03-031-3/+3
| |
* | git_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`Edward Thomson2016-02-281-0/+9
| |
* | Merge pull request #3628 from pks-t/pks/coverity-fixesEdward Thomson2016-02-251-1/+1
|\ \ | |/ |/| Coverity fixes