summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* commit: rearrange _fromstate and _on_head variantsCarlos Martín Nieto2018-03-221-10/+9
| | | | | We now have `_fromstate` and `_fromstate_on_head`, the latter of which updates the current branch to point to the new commit.
* commit: provide functions with and without a reference nameCarlos Martín Nieto2018-03-221-8/+36
| | | | | | | | | | Currently git_commit_create() takes on creating a commit and updating a reference. Provide a better interface by splitting up each of the concerns into named functions for each. git_commit_create() will only create the commit, it will not modify any reference. git_commit_create_on() takes a reference name to update and git_commit_create_on_head() is a convenience function to update HEAD.
* commit: introduce _fromstate()Carlos Martín Nieto2018-03-221-0/+21
| | | | | | This variant of the commit creation function takes the reference to update, the tree and the parents from the current branch, index and merging state, allowing for simpler use of a common use-case.
* Merge pull request #4544 from josharian/docsPatrick Steinhardt2018-03-131-18/+35
|\ | | | | pathspec: improve git_pathspec_flag_t doc rendering
| * pathspec: improve git_pathspec_flag_t doc renderingJosh Bleecher Snyder2018-02-231-18/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4396 from libgit2/cmn/config-regex-is-normalisedEdward Thomson2018-03-121-2/+26
|\ \ | | | | | | config: specify how we match the regular expressions
| * | config: explicitly state that subsections are case-sensitivecmn/config-regex-is-normalisedCarlos Martín Nieto2018-03-111-6/+11
| | |
| * | config: specify how we match the regular expressionsCarlos Martín Nieto2017-11-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | diff: ensure an unsigned number is shiftedJacques Germishuys2018-03-081-3/+3
| | |
* | | worktree: lock reason should be constJacques Germishuys2018-03-021-1/+1
| |/ |/|
* | Update version number to v0.27Patrick Steinhardt2018-02-201-3/+3
| |
* | odb: provide length and type with streaming readEdward Thomson2018-02-012-2/+10
| | | | | | | | | | The streaming read functionality should provide the length and the type of the object, like the normal read functionality does.
* | Merge pull request #4488 from libgit2/ethomson/conflict_marker_sizeEdward Thomson2018-01-311-0/+6
|\ \ | | | | | | Use longer conflict markers in recursive merge base
| * | merge: allow custom conflict marker sizeEdward Thomson2018-01-211-0/+6
| | | | | | | | | | | | | | | | | | Allow for a custom conflict marker size, allowing callers to override the default size of the "<<<<<<<" and ">>>>>>>" markers in the conflicted output file.
* | | odb: export mempack backendAdrián Medraño Calvo2018-01-221-4/+5
|/ / | | | | | | Fixes #4492, #4496.
* | message: update docs for git_message_prettifycmn/prettify-docsCarlos Martín Nieto2018-01-191-3/+2
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #4451 from libgit2/charliesome/trailer-infoBrian Lopez2018-01-171-0/+41
|\ \ | | | | | | Implement message trailer parsing API
| * | update code docsBrian Lopez2018-01-161-4/+15
| | |
| * | Change trailer API to return a simple arrayBrian Lopez2018-01-161-7/+17
| | |
| * | Merge remote-tracking branch 'origin/master' into charliesome/trailer-infoBrian Lopez2018-01-101-3/+4
| |\ \
| * | | remove empty lines between @-linesBrian Lopez2018-01-031-3/+0
| | | |
| * | | Merge remote-tracking branch 'origin/master' into charliesome/trailer-infoBrian Lopez2018-01-021-0/+89
| |\ \ \
| * | | | message: add routine for parsing trailers from messagesCharlie Somerville2017-12-191-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | This is implemented in trailer.c and borrows a large amount of logic from Git core to ensure compatibility.
* | | | | refs: document need to free refs in foreach-callbackPatrick Steinhardt2018-01-121-0/+3
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | docs: git_treebuilder_insert validates entriesethomson/treebuilder_docsEdward Thomson2017-12-311-3/+4
| |/ / |/| | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #4159 from richardipsum/notes-commitEdward Thomson2017-12-301-0/+89
|\ \ \ | |/ / |/| | Support using notes via a commit rather than a ref
| * | notes: Add git_note_commit_iterator_newRichard Ipsum2017-10-071-0/+14
| | | | | | | | | | | | This also adds tests for this function.
| * | notes: Add git_note_commit_removeRichard Ipsum2017-10-071-0/+26
| | | | | | | | | | | | This also adds tests for this function.
| * | notes: Add git_note_commit_readRichard Ipsum2017-10-071-0/+19
| | | | | | | | | | | | This also adds tests for this function.
| * | notes: Add git_note_commit_createRichard Ipsum2017-10-071-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #4318 from Uncommon/amend_statusEdward Thomson2017-12-011-0/+4
|\ \ \ | | | | | | | | Add git_status_file_at
| * | | status: Add a baseline field to git_status_options for comparing to trees ↵David Catmull2017-11-301-0/+4
| | |/ | |/| | | | | | | other than HEAD
* | | Include git2/worktree.h in git2.hapnadkarni2017-11-251-0/+1
| | | | | | | | | I'm not sure if worktree.h was intentionally left out of git2.h. Looks like an oversight since it is in fact documented.
* | | diff: expose the "indent heuristic" in the diff optionsCarlos Martín Nieto2017-11-191-0/+6
| | | | | | | | | | | | | | | We default to off, but we might want to consider changing `GIT_DIFF_NORMAL` to include it.
* | | signature: distinguish +0000 and -0000 UTC offsetsHenry Kleynhans2017-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | describe.h: fix spelling in commentsKen Dreyer2017-11-101-1/+1
| | | | | | | | | | | | optios -> options
* | | config: pass repository when opening config filesPatrick Steinhardt2017-10-092-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | repository: constify several repo parameters for gettersPatrick Steinhardt2017-10-091-6/+6
|/ / | | | | | | | | | | | | 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.
* | remote: add typedef to normalize push_update_reference callbackCarson Howard2017-10-061-4/+16
| | | | | | 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.
* | graph: document that a commit isn't a descendant of itselfJacob Wahlgren2017-10-061-0/+3
| |
* | Docs: Fix inline comments for git_diff_hunkAlpha2017-08-111-6/+6
| |
* | Merge pull request #4304 from pks-t/pks/patch-buffersEdward Thomson2017-07-311-2/+2
|\ \ | | | | | | patch_generate: represent buffers as void pointers
| * | patch_generate: represent buffers as void pointersPatrick Steinhardt2017-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #4323 from libgit2/ethomson/remove_sys_remote_hEdward Thomson2017-07-311-16/+0
|\ \ \ | | | | | | | | Remove unused 'sys/remote.h' header
| * | | Remove unused 'sys/remote.h' headerethomson/remove_sys_remote_hEdward Thomson2017-07-311-16/+0
| | | |
* | | | Merge branch '4233'Edward Thomson2017-07-311-0/+18
|\ \ \ \ | |/ / / |/| | |
| * | | remote: add function to create detached remotesEric Myhre2017-05-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now it is only possible to create remotes from a repository. While this is probably the most common use-case, there are commands which make sense even without a repository, e.g. the equivalence of `git ls-remote`. Add a new function `git_remote_create_detached`, which simply accepts a URL.
* | | | Merge pull request #4272 from pks-t/pks/patch-idEdward Thomson2017-07-191-0/+45
|\ \ \ \ | | | | | | | | | | Patch ID calculation
| * | | | diff: implement function to calculate patch IDPatrick Steinhardt2017-06-261-0/+45
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | git_reset_*: pass parameters as const pointersAndrey Davydov2017-06-301-4/+4
|/ / /