summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* remote: add git_refspec to update_tipsethomson/update_tips_specEdward Thomson2023-05-111-3/+7
|
* diff: parse patches with sha256Edward Thomson2023-04-101-0/+8
|
* index: add sha256 supportEdward Thomson2023-04-101-0/+4
|
* object: lookup sha256 objectsEdward Thomson2023-02-121-1/+8
| | | | | This is much of the plumbing for the object database to support SHA256, and for objects to be able to parse SHA256 versions of themselves.
* sha256: indirection for experimental functionsEdward Thomson2022-07-132-1/+36
| | | | | The experimental function signature is only available when `GIT_EXPERIMENTAL_SHA256` is enabled.
* oid: give oids a typeEdward Thomson2022-06-202-9/+9
| | | | | `git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
* oid: define GIT_OID_SHA1_ZEROEdward Thomson2022-06-141-1/+1
| | | | | Callers should not assume the layout of the oid structure; provide them a macro that defines the null / zero sha1 object id.
* oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`Edward Thomson2022-06-149-23/+23
| | | | | In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
* cmake: rename git2internal target to libgit2Edward Thomson2022-02-221-2/+2
| | | | | The `git2internal` target is actually the git library; call it such so that IDE users have visibility into it.
* cmake: document CMakeLists.txt hierarchyEdward Thomson2022-02-221-0/+2
|
* Free parent and ref in lg2_commit before returning.Ashok P. Nadkarni2022-02-141-6/+8
|
* Update common.hapnadkarni2022-02-131-1/+1
|
* indexer: use a byte array for checksumEdward Thomson2022-01-271-3/+1
| | | | | | | | The index's checksum is not an object ID, so we should not use the `git_oid` type. Use a byte array for checksum calculation and storage. Deprecate the `git_indexer_hash` function. Callers should use the new `git_indexer_name` function which provides a unique packfile name.
* Fix typosDimitris Apostolou2022-01-051-2/+2
|
* Make enum in src,tests and examples C90 compliant by removing trailing comma.Peter Pettersson2021-11-153-3/+3
|
* cmake: refactor global variablesEdward Thomson2021-11-141-4/+5
| | | | | Update the global variables `LIBGIT2_OBJECTS` to `LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
* example: declare print_usage functionEdward Thomson2021-11-111-1/+1
|
* examples: remove unused functionEdward Thomson2021-11-111-15/+0
|
* cmake: stylistic refactoringEdward Thomson2021-10-181-11/+11
| | | | | Ensure that we always use lowercase function names, and that we do not have spaces preceding open parentheses, for consistency.
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* examples: Free the git_config and git_config_entry after usePaymon MARANDI2021-09-241-0/+9
|
* Fix typo in general.cCrayon2021-07-281-1/+1
|
* Remove duplicate line, in example codepunkymaniac2021-03-171-5/+0
|
* Fix some typosAaron Franke2021-02-153-4/+4
|
* revspec: rename git_revparse_mode_t to git_revspec_tethomson/revparseEdward Thomson2021-01-314-8/+8
| | | | | | The information about the type of a revision spec is not information about the parser. Name it accordingly, so that `git_revparse_mode_t` is now `git_revspec_t`. Deprecate the old name.
* examples: log: fix documentation generationPatrick Steinhardt2020-06-081-9/+18
| | | | | | Docurium seems to be confused by our use of `/** comment */;` use in the log example. Let's just switch it around to help Docurium get this right.
* strarray: we should `dispose` instead of `free`Edward Thomson2020-06-014-5/+5
| | | | | | We _dispose_ the contents of objects; we _free_ objects (and their contents). Update `git_strarray_free` to be `git_strarray_dispose`. `git_strarray_free` remains as a deprecated proxy function.
* examples: additions and fixesPeter Salomonsen2020-04-025-1/+147
| | | | | | add example for git commit fix example for git add add example for git push
* credential: change git_cred to git_credentialethomson/credtypeEdward Thomson2020-01-262-8/+8
| | | | | | | | | | | | | | | | We avoid abbreviations where possible; rename git_cred to git_credential. In addition, we have standardized on a trailing `_t` for enum types, instead of using "type" in the name. So `git_credtype_t` has become `git_credential_t` and its members have become `GIT_CREDENTIAL` instead of `GIT_CREDTYPE`. Finally, the source and header files have been renamed to `credential` instead of `cred`. Keep previous name and values as deprecated, and include the new header files from the previous ones.
* Merge pull request #5283 from pks-t/pks/example-checkout-remote-branchPatrick Steinhardt2019-12-131-5/+78
|\ | | | | examples: checkout: implement guess heuristic for remote branches
| * examples: checkout: implement guess heuristic for remote branchesPatrick Steinhardt2019-10-251-5/+78
| |
* | Merge pull request #5272 from tiennou/examples/cli-ificationPatrick Steinhardt2019-11-2822-444/+521
|\ \ | | | | | | Various examples shape-ups
| * | examples: buff up rev-list by adding OID supportEtienne Samson2019-11-061-22/+58
| | | | | | | | | | | | This allows the example to be used as a quick revwalk test harness.
| * | examples: normalize decls and usage of options structsEtienne Samson2019-11-0612-89/+86
| | |
| * | examples: add comments to add.cEtienne Samson2019-11-061-0/+2
| | |
| * | examples: modernize add codeEtienne Samson2019-11-061-45/+49
| | |
| * | examples: extract argument conversion helperEtienne Samson2019-11-062-0/+19
| | |
| * | examples: fixup for-each-ref styleEtienne Samson2019-11-061-33/+33
| | |
| * | examples: keep track of whether we processed a "--" argEtienne Samson2019-11-065-10/+23
| | |
| * | examples: move "args" to its own headerEtienne Samson2019-11-064-239/+251
| | |
| * | examples: remove duplicate includes from common.cEtienne Samson2019-11-061-9/+1
| | |
| * | global: DRY includes of assert.hEtienne Samson2019-11-066-6/+4
| | |
| * | examples: add missing include barriersEtienne Samson2019-11-061-0/+4
| | |
| * | examples: add *.h files to IDEsEtienne Samson2019-11-061-1/+1
| |/
* | example: use `git_object_size_t` for object sizeEdward Thomson2019-11-221-1/+1
|/
* Merge pull request #5113 from pks-t/pks/stash-perfEdward Thomson2019-08-113-0/+159
|\ | | | | stash: avoid recomputing tree when committing worktree
| * examples: implement git-stash examplePatrick Steinhardt2019-07-203-0/+159
| | | | | | | | | | | | | | | | | | Implement a new example that resembles the git-stash(1) command. Right now, it only provides the apply, list, save and pop subcommands without any options. This example is mostly used to test libgit2's stashing performance on big repositories.
* | Merge pull request #5146 from scottfurry/StaticFixesExamplesPatrick Steinhardt2019-08-023-8/+8
|\ \ | | | | | | Adjust printf specifiers in examples code
| * | Adjust printf specifiers in examples codeScott Furry2019-08-013-8/+8
| | | | | | | | | | | | | | | | | | | | | Static analysis of example code found multiple findings of `printf` usage where filling value is members of git_indexer_progress object. Specifier used was for signed int but git_indexer_progress members are typed as unsigned ints. `printf` specifiers were altered to match type.
* | | Merge pull request #5184 from novalis/fix-examplePatrick Steinhardt2019-08-011-1/+1
|\ \ \ | |/ / |/| | Fix example checkout to forbid rather than require --