include/git2


Log

Author Commit Date CI Message
Sven Strickroth b5818dda 2018-06-18T13:05:08 Fix last references to deprecated git_buf_free Signed-off-by: Sven Strickroth <email@cs-ware.de>
Nika Layzell f98131be 2018-06-17T00:40:25 Require the length argument to git_mailmap_from_buffer and make mailmap_add_buffer internal
Nika Layzell 56303e1a 2018-05-07T11:59:00 mailmap: API and style cleanup
Nika Layzell 8ff0504d 2018-04-08T03:01:14 mailmap: Rewrite API to support accurate mailmap resolution
Nika Layzell 18ff9bab 2018-03-27T22:48:03 mailmap: API and style cleanup
Nika Layzell d91d2968 2018-06-14T16:49:48 mailmap: Hide EEXISTS to simplify git_mailmap_add_entry callers
Nika Layzell 57cfeab9 2018-03-26T15:05:37 mailmap: Switch mailmap parsing to use the git_parse module
Emilio Cobos Álvarez 5c6c8a9b 2018-03-18T01:26:30 mailmap: Fix some other minor style nits
Nika Layzell 4ff44be8 2018-03-17T18:24:15 mailmap: Fix more bugs which snuck in when I rebased
Nika Layzell e3dcaca5 2018-03-17T18:15:01 mailmap: Integrate mailmaps with blame and signatures
Nika Layzell b05fbba3 2018-03-17T18:14:31 mailmap: Make everything a bit more style conforming
Nika Layzell 49620359 2018-03-17T02:29:41 mailmap: Clean up mailmap parser, and finish API
Emilio Cobos Álvarez 7a169390 2018-03-15T16:34:30 mailmap: WIP mailmap support
Edward Thomson 291cf12e 2018-06-12T12:40:11 Merge pull request #4680 from pks-t/pks/diff-opts-enum diff: fix enum value being out of allowed range
Patrick Steinhardt 2d9d2464 2018-06-12T10:34:10 diff: fix enum value being out of allowed range The C89 standard states in §6.7.2.2 "Enumeration specifiers": > The expression that defines the value of an enumeration constant shall > be an integer constant expression that has a value representable as an > int. On most platforms, this effectively limits the range to a 32 bit signed integer. The enum `git_diff_option_t` though recently gained an entry `GIT_DIFF_INDENT_HEURISTIC = (1u << 31)`, which breaks this limit. Fix the issue by using a gap in `git_diff_option_t`'s enum values. While this has the benefit of retaining our API, it may break applications which do not get recompiled after upgrading libgit2. But as we are bumping the soversion on each release anyway and thus force a recompile of dependents, this is not a problem.
Edward Thomson 3be73011 2018-06-11T18:26:22 Merge pull request #4436 from pks-t/pks/packfile-stream-free pack: rename `git_packfile_stream_free`
Patrick Steinhardt 56ffdfc6 2018-02-08T11:14:30 buffer: deprecate `git_buf_free` in favor of `git_buf_dispose`
Patrick Steinhardt 396e4960 2018-02-08T11:05:17 common.h: create `GIT_DEPRECATED` macro
Patrick Steinhardt 74b7ddbf 2018-03-16T10:14:50 settings: allow swapping out memory allocator Tie in the newly created infrastructure for swapping out memory allocators into our settings code. A user can now simply use the new option "GIT_OPT_SET_ALLOCATOR" with `git_libgit2_opts`, passing in an already initialized allocator structure as vararg.
Patrick Steinhardt 9865cd16 2018-03-20T14:23:49 alloc: make memory allocators use function pointers Currently, our memory allocators are being redirected to the correct implementation at compile time by simply using macros. In order to make them swappable at runtime, this commit reshuffles that by instead making use of a global "git_allocator" structure, whose pointers are set up to reference the allocator functions. Like this, it becomes easy to swap out allocators by simply setting these function pointers. In order to initialize a "git_allocator", our provided allocators "stdalloc" and "crtdbg" both provide an init function. This is being called to initialize a passed in allocator struct and set up its members correctly. No support is yet included to enable users of libgit2 to switch out the memory allocator at a global level.
Carlos Martín Nieto 177dcfc7 2018-05-18T15:16:53 path: hide the dotgit file functions These can't go into the public API yet as we don't want to introduce API or ABI changes in a security release.
Carlos Martín Nieto 0aa65f8d 2018-05-16T15:56:04 path: add functions to detect .gitconfig and .gitattributes
Etienne Samson 04c48afc 2018-04-20T21:07:17 docs: standardize struct git_*_options comments
Etienne Samson c7b42f44 2018-04-11T22:26:31 docs: fix comment style
Etienne Samson 3ec35d9c 2018-03-26T20:23:59 attr: fix typo
Etienne Samson 78ea5adc 2018-03-22T23:27:35 branch: typo
Etienne Samson bf46d458 2018-03-22T23:27:34 docs: move blame options struct field comments
Etienne Samson 25e8a293 2018-03-22T23:27:31 docs: correct defgroup
Etienne Samson 29afb257 2018-03-22T23:27:30 docs: fix incorrect codeblock on output
Etienne Samson bf70fa4b 2018-03-22T23:27:28 docs: move comment so docurium sees it
Etienne Samson ca5a15e5 2018-03-22T23:27:27 docs: standardize comment block for git_*_init_options functions
Etienne Samson 8ee183a2 2018-03-22T23:27:25 docs: missing documentation comment
Etienne Samson f46c360e 2018-03-22T23:27:24 docs: move callback-specific documentation to the callback
Etienne Samson efad967a 2018-03-22T23:27:23 docs: fix some comment-marker typos
Etienne Samson 96576372 2018-03-22T23:27:21 docs: fix more missing includes
Etienne Samson 84bcae6c 2018-03-22T23:27:20 docs: add buffer.h & oid.h to types.h Otherwise docurium/clang chokes on the types, and ignores the documentation comments altogether.
Patrick Steinhardt b33b6d33 2018-04-30T09:27:47 Merge pull request #4640 from mkeeler/worktree-convenience2 worktree: add functions to get name and path
Matt Keeler 3da1ad20 2018-04-24T17:09:34 worktree: add functions to get name and path
Edward Thomson 5d346c11 2018-04-22T14:51:00 Merge pull request #4525 from pks-t/pks/config-iterate-in-order Configuration entry iteration in order
Edward Thomson 8529ac9b 2018-04-17T23:38:46 Merge pull request #4524 from pks-t/pks/worktree-refs worktree: add ability to create worktree with pre-existing branch
Patrick Steinhardt 0eca4230 2018-04-06T10:03:09 Merge pull request #4597 from cjhoward92/fix/cert-check-docs remote/proxy: fix git_transport_certificate_check_db description
Patrick Steinhardt a57f42ac 2018-04-06T09:40:34 Merge pull request #4587 from rcjsuen/patch-2 Flag options in describe.h as being optional
Carson Howard 370ecdb2 2018-03-27T10:10:09 types: remove unused git_merge_result `git_merge_result` is currently unused in the codebase and generates a blank page in the [documentation](https://libgit2.github.com/libgit2/#HEAD/type/git_merge_result).
Carson Howard e6c720ea 2018-03-27T10:05:21 remote/proxy: fix git_transport_certificate_check_db comment
Remy Suen db90e951 2018-03-27T20:09:45 Flag options in describe.h as being optional The git_describe_options in git_describe_commit and git_describe_workdir and the git_describe_format_options in git_describe_format are optional and can be NULL. State this in the documentation to make people's lives easier when calling these functions. Signed-off-by: Remy Suen <remy.suen@gmail.com>
Etienne Samson cdd0bc2f 2018-03-26T18:44:13 checkout: change default strategy to SAFE As per #4200, our default is quite surprising to users that expect checkout to just "do the thing".
Patrick Steinhardt 26cf48fc 2018-02-09T11:35:16 config_file: move include depth into config entry In order to reject writes to included configuration entries, we need to keep track of whether an entry was included via another configuration file or not. This information is being stored in the `cvar` structure, which is a rather weird location, as it is only used to create a list structure of config entries. Move the include depth into the structure `git_config_entry` instead. While this fixes the layering issue, it enables users of libgit2 to access the depth, too.
Patrick Steinhardt 937e7e26 2018-03-13T13:04:38 Merge pull request #4544 from josharian/docs pathspec: improve git_pathspec_flag_t doc rendering
Edward Thomson 358cc2e2 2018-03-12T09:50:00 Merge pull request #4396 from libgit2/cmn/config-regex-is-normalised config: specify how we match the regular expressions
Carlos Martín Nieto 2f89bd90 2018-03-11T12:36:13 config: explicitly state that subsections are case-sensitive
Jacques Germishuys 5f6383ca 2018-03-08T08:17:29 diff: ensure an unsigned number is shifted
Jacques Germishuys 12356076 2018-03-02T12:41:04 worktree: lock reason should be const
Josh Bleecher Snyder b72717b0 2018-02-23T08:19:49 pathspec: improve git_pathspec_flag_t doc rendering By placing docs per enum value rather than in a large block, the automated doc generation tool can make nicer docs, as could other automated tools, such as the mooted https://github.com/libgit2/git2go/issues/427. The current rendering is somewhat ugly: https://libgit2.github.com/libgit2/#HEAD/type/git_pathspec_flag_t No textual changes, just reorganization.
Patrick Steinhardt 23d4a91b 2018-02-16T08:38:44 Update version number to v0.27
Patrick Steinhardt a22f19e6 2018-02-09T10:38:11 worktree: add ability to create worktree with pre-existing branch Currently, we always create a new branch after the new worktree's name when creating a worktree. In some workflows, though, the caller may want to check out an already existing reference instead of creating a new one, which is impossible to do right now. Add a new option `ref` to the options structure for adding worktrees. In case it is set, a branch and not already checked out by another worktree, we will re-use this reference instead of creating a new one.
Edward Thomson 97f9a5f0 2017-12-17T01:12:49 odb: provide length and type with streaming read The streaming read functionality should provide the length and the type of the object, like the normal read functionality does.
Edward Thomson 9d8510b3 2018-01-31T09:28:43 Merge pull request #4488 from libgit2/ethomson/conflict_marker_size Use longer conflict markers in recursive merge base
Adrián Medraño Calvo d23ce187 2018-01-22T11:55:28 odb: export mempack backend Fixes #4492, #4496.
Edward Thomson b8e9467a 2018-01-20T19:39:34 merge: allow custom conflict marker size Allow for a custom conflict marker size, allowing callers to override the default size of the "<<<<<<<" and ">>>>>>>" markers in the conflicted output file.
Carlos Martín Nieto dcb668ba 2018-01-19T01:11:37 message: update docs for git_message_prettify We used to hard-code the octothorpe as the comment character and the documentation still mentions this even though we accept the comment character as a parameter. Update the line to indicate this and clean up the first paragraph a bit.
Brian Lopez 4893a9c0 2018-01-17T13:54:42 Merge pull request #4451 from libgit2/charliesome/trailer-info Implement message trailer parsing API
Brian Lopez 3e5239e4 2018-01-16T23:55:46 update code docs
Brian Lopez d43974fb 2018-01-16T13:40:26 Change trailer API to return a simple array
Patrick Steinhardt 5963292f 2018-01-12T13:03:19 refs: document need to free refs in foreach-callback References passed to the callback function of `git_reference_foreach` are expected to be owned by the callback. As such, they are never being freed by `git_reference_foreach`, but will have to be freed by the caller. This small detail is never mentioned in the function's documentation, though, making it easy to get wrong. Document this to make it discoverable.
Brian Lopez 5734768b 2018-01-10T19:19:34 Merge remote-tracking branch 'origin/master' into charliesome/trailer-info
Brian Lopez fb29ba09 2018-01-03T18:32:09 remove empty lines between @-lines
Brian Lopez e8bc8558 2018-01-02T13:29:49 Merge remote-tracking branch 'origin/master' into charliesome/trailer-info
Edward Thomson 346c1b16 2017-12-31T09:25:42 docs: git_treebuilder_insert validates entries The documentation for `git_treebuilder_insert` erroneously states that we do not validate that the entry being inserted exists. We do, as of https://github.com/libgit2/libgit2/pull/3633. Update the documentation to reflect the new reality.
Edward Thomson d6210245 2017-12-30T13:09:43 Merge pull request #4159 from richardipsum/notes-commit Support using notes via a commit rather than a ref
Charlie Somerville 1c43edca 2017-12-14T18:37:10 message: add routine for parsing trailers from messages This is implemented in trailer.c and borrows a large amount of logic from Git core to ensure compatibility.
Edward Thomson 429bb357 2017-12-01T11:45:53 Merge pull request #4318 from Uncommon/amend_status Add git_status_file_at
David Catmull 4ccacdc8 2017-07-21T17:07:10 status: Add a baseline field to git_status_options for comparing to trees other than HEAD
Carlos Martín Nieto 7e3faf58 2017-10-29T15:05:28 diff: expose the "indent heuristic" in the diff options We default to off, but we might want to consider changing `GIT_DIFF_NORMAL` to include it.
Carlos Martín Nieto 158a42a5 2017-11-04T15:28:35 config: specify how we match the regular expressions We do it the same as git does: case-sensitively on the normalized form of the variable name. While here also specify that we're case-sensitive on the values when handling the values when setting or deleting multivars.
Henry Kleynhans f063dafb 2017-11-12T10:56:50 signature: distinguish +0000 and -0000 UTC offsets Git considers '-0000' a valid offset for signature lines. They need to be treated as _not_ equal to a '+0000' signature offset. Parsing a signature line stores the offset in a signed integer which does not distinguish between `+0` and `-0`. This patch adds an additional flag `sign` to the `git_time` in the `signature` object which is populated with the sign of the offset. In addition to exposing this information to the user, this information is also used to compare signatures. /cc @pks-t @ethomson
Ken Dreyer 38169764 2017-11-10T16:19:39 describe.h: fix spelling in comments optios -> options
Patrick Steinhardt 529e873c 2017-05-23T11:51:00 config: pass repository when opening config files Our current configuration logic is completely oblivious of any repository, but only cares for actual file paths. Unfortunately, we are forced to break this assumption by the introduction of conditional includes, which are evaluated in the context of a repository. Right now, only one conditional exists with "gitdir:" -- it will only include the configuration if the current repository's git directory matches the value passed to "gitdir:". To support these conditionals, we have to break our API and make the repository available when opening a configuration file. This commit extends the `open` call of configuration backends to include another repository and adjusts existing code to have it available. This includes the user-visible functions `git_config_add_file_ondisk` and `git_config_add_backend`.
Patrick Steinhardt d02cf564 2017-05-23T12:56:41 repository: constify several repo parameters for getters Several functions to retrieve variables from a repository only return immutable values, which allows us to actually constify the passed-in repository parameter. Do so to help a later patch, which will only have access to a constant repository.
Richard Ipsum 60bee89d 2017-03-19T18:34:07 notes: Add git_note_commit_iterator_new This also adds tests for this function.
Richard Ipsum 9a02725d 2017-03-15T18:17:42 notes: Add git_note_commit_remove This also adds tests for this function.
Richard Ipsum 7096bf1e 2017-03-15T11:54:45 notes: Add git_note_commit_read This also adds tests for this function.
Richard Ipsum a46e743d 2017-09-23T17:46:46 notes: Add git_note_commit_create This adds a new function that will allow creation of notes without necessarily updating a particular ref, the notes tree is obtained from the git_commit object parameter, a new commit object pointing to the current tip of the notes tree is optionally returned via the 'note_commit_out' parameter, optionally the blob id for the note is returned through the 'note_blob_out' object.
Carson Howard 7138ce37 2017-10-06T07:16:26 remote: add typedef to normalize push_update_reference callback Very many callbacks in libgit2 have some sort of typedef to normalize the name at git_<name_of_operation>_cb. Add a typedef for push_update_references in the remote so the name follows the same conventions.
Jacob Wahlgren 56ac6c0a 2017-09-30T17:23:11 graph: document that a commit isn't a descendant of itself
Alpha 2a3cfc23 2017-08-11T17:15:51 Docs: Fix inline comments for git_diff_hunk
Edward Thomson a9d6b9d5 2017-07-31T01:20:21 Merge pull request #4304 from pks-t/pks/patch-buffers patch_generate: represent buffers as void pointers
Edward Thomson dca8c44f 2017-07-31T01:17:24 Merge pull request #4323 from libgit2/ethomson/remove_sys_remote_h Remove unused 'sys/remote.h' header
Edward Thomson fb585d01 2017-07-31T00:58:58 Merge branch '4233'
Edward Thomson 37841317 2017-07-31T00:38:28 Remove unused 'sys/remote.h' header
Edward Thomson a94a5402 2017-07-19T13:28:32 Merge pull request #4272 from pks-t/pks/patch-id Patch ID calculation
Patrick Steinhardt 9093ced6 2017-07-10T11:42:26 patch_generate: represent buffers as void pointers Pointers to general data should usually be used as a void pointer such that it is possible to hand in variables of a different pointer type without the need to cast. This is the same when creating patches from buffers, where the buffers may contain arbitrary data. Instead of requiring the caller to care whether his buffer is e.g. `char *` or `unsigned char *`, we should instead just accept a `void *`. This is also consistent in how we tread other types like for example `git_blob`, which also just has a void pointer as its raw contents.
Andrey Davydov d4e03be6 2017-06-30T11:21:18 git_reset_*: pass parameters as const pointers
Patrick Steinhardt 89a34828 2017-06-16T13:34:43 diff: implement function to calculate patch ID The upstream git project provides the ability to calculate a so-called patch ID. Quoting from git-patch-id(1): A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with whitespace and line numbers ignored." Patch IDs can be used to identify two patches which are probably the same thing, e.g. when a patch has been cherry-picked to another branch. This commit implements a new function `git_diff_patchid`, which gets a patch and derives an OID from the diff. Note the different terminology here: a patch in libgit2 are the differences in a single file and a diff can contain multiple patches for different files. The implementation matches the upstream implementation and should derive the same OID for the same diff. In fact, some code has been directly derived from the upstream implementation. The upstream implementation has two different modes to calculate patch IDs, which is the stable and unstable mode. The old way of calculating the patch IDs was unstable in a sense that a different ordering the diffs was leading to different results. This oversight was fixed in git 1.9, but as git tries hard to never break existing workflows, the old and unstable way is still default. The newer and stable way does not care for ordering of the diff hunks, and in fact it is the mode that should probably be used today. So right now, we only implement the stable way of generating the patch ID.
Mohseen Mukaddam a78441bc 2017-06-13T11:05:40 Adding git_filter_init for initializing `git_filter` struct + unit test
Mohseen Mukaddam 7f7dabda 2017-06-12T13:40:47 adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention
Edward Thomson 9d49a43c 2017-06-12T12:01:10 repository_item_path: return ENOTFOUND when appropriate Disambiguate error values: return `GIT_ENOTFOUND` when the item cannot exist in the repository (perhaps because the repository is inmemory or otherwise not backed by a filesystem), return `-1` when there is a hard failure.
Edward Thomson 2a3cc403 2017-06-11T12:23:34 Update version number to v0.26
Patrick Steinhardt 6c23704d 2017-06-08T21:40:18 settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION` Initially, the setting has been solely used to enable the use of `fsync()` when creating objects. Since then, the use has been extended to also cover references and index files. As the option is not yet part of any release, we can still correct this by renaming the option to something more sensible, indicating not only correlation to objects. This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also move the variable from the object to repository source code.
Edward Thomson dd0aa811 2017-06-04T22:46:07 Merge branch 'pr/4228'
Edward Thomson f0848dd7 2017-06-04T22:44:30 worktree: upgrade lock to an int