summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4770 from tiennou/feature/merge-analysis-any-branchPatrick Steinhardt2018-11-301-0/+19
|\ | | | | Allow merge analysis against any reference
| * merge: make analysis possible against a non-HEAD referenceEtienne Samson2018-10-191-0/+19
| | | | | | | | | | | | | | This moves the current merge analysis code into a more generic version that can work against any reference. Also change the tests to check returned analysis values exactly.
* | Merge pull request #4888 from TheBB/add-cbPatrick Steinhardt2018-11-291-1/+1
|\ \ | | | | | | revwalk: Allow changing hide_cb
| * | revwalk: Allow changing hide_cbEivind Fonn2018-11-281-1/+1
| | | | | | | | | | | | | | | Since git_revwalk objects are encouraged to be reused, a public interface for changing hide_cb is desirable.
* | | stream registration: take an enum typeEdward Thomson2018-11-281-3/+15
| | | | | | | | | | | | | | | | | | Accept an enum (`git_stream_t`) during custom stream registration that indicates whether the registration structure should be used for standard (non-TLS) streams or TLS streams.
* | | stream: provide generic registration APIEdward Thomson2018-11-281-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update the new stream registration API to be `git_stream_register` which takes a registration structure and a TLS boolean. This allows callers to register non-TLS streams as well as TLS streams. Provide `git_stream_register_tls` that takes just the init callback for backward compatibliity.
* | | tls: introduce a wrap functionEdward Thomson2018-11-281-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce `git_tls_stream_wrap` which will take an existing `stream` with an already connected socket and begin speaking TLS on top of it. This is useful if you've built a connection to a proxy server and you wish to begin CONNECT over it to tunnel a TLS connection. Also update the pluggable TLS stream layer so that it can accept a registration structure that provides an `init` and `wrap` function, instead of a single initialization function.
* | | Merge pull request #4879 from libgit2/ethomson/defer_cert_cred_cbPatrick Steinhardt2018-11-283-3/+12
|\ \ \ | | | | | | | | Allow certificate and credential callbacks to decline to act
| * | | transport: allow cred/cert callbacks to return GIT_PASSTHROUGHethomson/defer_cert_cred_cbEdward Thomson2018-11-212-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow credential and certificate checking callbacks to return GIT_PASSTHROUGH, indicating that they do not want to act. Introduce this to support in both the http and ssh callbacks. Additionally, enable the same mechanism for certificate validation. This is most useful to disambiguate any meaning in the publicly exposed credential and certificate functions (`git_transport_smart_credentials` and `git_transport_smart_certificate_check`) but it may be more generally useful for callers to be able to defer back to libgit2.
| * | | transport: see if cert/cred callbacks exist before calling themEdward Thomson2018-11-151-2/+8
| |/ / | | | | | | | | | | | | | | | | | | Custom transports may want to ask libgit2 to invoke a configured credential or certificate callback; however they likely do not know if a callback was actually configured. Return a sentinal value (GIT_PASSTHROUGH) if there is no callback configured instead of crashing.
* | | Merge pull request #4884 from libgit2/ethomson/index_iteratorPatrick Steinhardt2018-11-212-0/+43
|\ \ \ | | | | | | | | index: introduce git_index_iterator
| * | | index: introduce git_index_iteratorethomson/index_iteratorEdward Thomson2018-11-142-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | Provide a public git_index_iterator API that is backed by an index snapshot. This allows consumers to provide a stable iteration even while manipulating the index during iteration.
* | | | worktree: Expose git_worktree_add_init_optionsOzan Sener2018-11-181-1/+1
| |/ / |/| |
* | | Merge pull request #4667 from tiennou/feature/remote-create-apiPatrick Steinhardt2018-11-131-0/+74
|\ \ \ | |/ / |/| | Remote creation API
| * | remote: add a flag to prevent generation of the default fetchspecEtienne Samson2018-11-021-0/+3
| | |
| * | remote: add a creation flag for ignoring url.insteadOfEtienne Samson2018-11-021-0/+11
| | |
| * | remote: provide a generic API for creating remotesEtienne Samson2018-11-021-0/+60
| | | | | | | | | | | | This supersedes the functionality of remote_create_with_fetchspec, remote_create_anonymous and remote_create_detached.
* | | apply: introduce a hunk callbackEdward Thomson2018-11-051-0/+17
| | | | | | | | | | | | | | | Introduce a callback to patch application that allows consumers to cancel hunk application.
* | | apply: introduce a delta callbackEdward Thomson2018-11-051-0/+19
| | | | | | | | | | | | | | | | | | | | | Introduce a callback to the application options that allow callers to add a per-delta callback. The callback can return an error code to stop patch application, or can return a value to skip the application of a particular delta.
* | | apply: move location to an argument, not the optsEdward Thomson2018-11-051-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | Move the location option to an argument, out of the options structure. This allows the options structure to be re-used for functions that don't need to know the location, since it's implicit in their functionality. For example, `git_apply_tree` should not take a location, but is expected to take all the other options.
* | | apply: return a specific exit code on failureEdward Thomson2018-11-041-0/+1
| | | | | | | | | | | | | | | | | | Return `GIT_EAPPLYFAIL` on patch application failure so that users can determine that patch application failed due to a malformed/conflicting patch by looking at the error code.
* | | apply: introduce `git_apply`Edward Thomson2018-11-041-0/+42
| | | | | | | | | | | | | | | | | | Introduce `git_apply`, which will take a `git_diff` and apply it to the working directory (akin to `git apply`), the index (akin to `git apply --cached`), or both (akin to `git apply --index`).
* | | apply: introduce `git_apply_tree`Edward Thomson2018-11-032-0/+42
|/ / | | | | | | | | Introduce `git_apply_tree`, which will apply a `git_diff` to a given `git_tree`, allowing an in-memory patch application for a repository.
* | util: allow callers to reset custom allocatorsEdward Thomson2018-10-211-1/+2
| | | | | | | | | | Provide a utility to reset custom allocators back to their default. This is particularly useful for testing.
* | path: export the dotgit-checking functionscmn/expose-gitfile-checkCarlos Martín Nieto2018-10-151-0/+64
|/ | | | | | | | These checks are preformed by libgit2 on checkout, but they're also useful for performing checks in applications which do not involve checkout. Expose them under `sys/` as it's still fairly in the weeds even for this library.
* config: fix incorrect filename in documentation commentEtienne Samson2018-10-011-1/+1
| | | The underlying code uses GIT_CONFIG_FILENAME_GLOBAL, which is .gitconfig.
* doc: small fixups & additionsEtienne Samson2018-10-013-19/+58
|
* revwalk: refer the sorting modes more to git's optionscmn/sorting-modesCarlos Martín Nieto2018-09-171-5/+5
| | | | | Show more directly what the sorting modes correspond to in git's `rev-list` as that's the reference implementation for what the possible sorting orders are.
* Merge pull request #4788 from tiennou/doc-fixesPatrick Steinhardt2018-08-303-113/+154
|\ | | | | Documentation fixes
| * diff: documentation mashupEtienne Samson2018-08-291-111/+151
| |
| * push: make the parallelism default follow the docsEtienne Samson2018-08-291-1/+1
| |
| * doc: fix comment on GIT_EUSEREtienne Samson2018-08-291-1/+2
| |
* | Merge pull request #4773 from RandomSort/giterrPatrick Steinhardt2018-08-301-1/+6
|\ \ | |/ |/| Document giterr_last() use only after error. #4772
| * Add two words to clarifyJohan Abildskov2018-08-271-1/+1
| |
| * Update giterr_last API documentation to reflect real behaviourJohan Abildskov2018-08-201-1/+6
| |
* | Merge pull request #4374 from pks-t/pks/pack-file-verifyEdward Thomson2018-08-261-4/+30
|\ \ | |/ |/| Pack file verification
| * indexer: add ability to select connectivity checksPatrick Steinhardt2018-06-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, we simply turn on connectivity checks in the indexer as soon as we have access to an object database. But seeing that the connectivity checks may incur additional overhead, we do want the user to decide for himself whether he wants to allow those checks. Furthermore, it might also be desirable to check connectivity in case where no object database is given at all, e.g. in case where a fully connected pack file is expected. Add a flag `verify` to `git_indexer_options` to enable additional verification checks. Also avoid to query the ODB in case none is given to allow users to enable checks when they do not have an ODB.
| * indexer: introduce options struct to `git_indexer_new`Patrick Steinhardt2018-06-221-4/+27
| | | | | | | | | | | | | | | | | | | | We strive to keep an options structure to many functions to be able to extend options in the future without breaking the API. `git_indexer_new` doesn't have one right now, but we want to be able to add an option for enabling strict packfile verification. Add a new `git_indexer_options` structure and adjust callers to use that.
* | Merge pull request #4721 from nelhage/max-objectsPatrick Steinhardt2018-07-261-1/+15
|\ \ | | | | | | Add a configurable limit to the max pack size that will be indexed
| * | INDEXER_MAX_OBJECTS -> PACK_MAX_OBJECTSNelson Elhage2018-07-161-4/+4
| | |
| * | Add a git_libgit2_opts option to set the max indexer object countNelson Elhage2018-07-121-1/+15
| | |
* | | Merge pull request #4692 from tiennou/examples/checkoutPatrick Steinhardt2018-07-201-0/+9
|\ \ \ | | | | | | | | Add a checkout example
| * | | annotated_commit: make the refname accessibleEtienne Samson2018-07-071-0/+9
| |/ / | | | | | | | | | | | | | | | As git_annotated_commit seems to behave like cgit's refish, it's quite helpful to abstract away "targets" via git_annotated_commit_from_id/from_ref. As the former is accessible via git_annotated_commit_id, make the latter also available to users.
* | | ignore: improve `git_ignore_path_is_ignored` description Git analogyIgor Djordjevic2018-07-141-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In attempt to provide adequate Git command analogy in regards to ignored files handling, `git_ignore_path_is_ignored` description mentions doing `git add .` on directory containing the file, and whether the file in question would be added or not - but behavior of the two matches for untracked files only, making the comparison misleading in general sense. For tracked files, Git doesn't subject them to ignore rules, so even if a rule applies, `git add .` would actually add the tracked file changes to index, while `git_ignore_path_is_ignored` would still consider the file being ignored (as it doesn't check the index, as documented). Let's provide `git check-ignore --no-index` as analogous Git command example instead, being more aligned with what `git_ignore_path_is_ignored` is about, no matter if the file in question is already tracked or not. See issue #4720 (git_ignore_path_is_ignored documentation misleading?, 2018-07-10)[1] for additional information. [1] https://github.com/libgit2/libgit2/issues/4720
* | Merge pull request #4536 from libgit2/ethomson/index_dirtyEdward Thomson2018-06-302-1/+11
|\ \ | | | | | | Add a "dirty" state to the index when it has unsaved changes
| * | settings: optional unsaved index safetyEdward Thomson2018-06-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the `GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY` option, which will cause commands that reload the on-disk index to fail if the current `git_index` has changed that have not been saved. This will prevent users from - for example - adding a file to the index then calling a function like `git_checkout` and having that file be silently removed from the index since it was re-read from disk. Now calls that would re-read the index will fail if the index is "dirty", meaning changes have been made to it but have not been written. Users can either `git_index_read` to discard those changes explicitly, or `git_index_write` to write them.
| * | index: return a unique error code on dirty indexEdward Thomson2018-06-291-0/+1
| |/ | | | | | | | | When the index is dirty, return GIT_EINDEXDIRTY so that consumers can identify the exact problem programatically.
* | refspec: add public parsing apicynecx2018-06-221-0/+17
|/ | | | | | | | | | | | | | | | | | | | Fix typo Fix some type issues More fixes Address requested changes Add test Fix naming Fix condition and tests Address requested changes Fix typo
* Fix last references to deprecated git_buf_freeSven Strickroth2018-06-182-2/+2
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Require the length argument to git_mailmap_from_buffer and make ↵Nika Layzell2018-06-171-17/+1
| | | | mailmap_add_buffer internal