| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We now have `_fromstate` and `_fromstate_on_head`, the latter of which updates
the current branch to point to the new commit.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
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.
|
|\ \
| | |
| | | |
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.
|
| | | |
|
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| | |
The streaming read functionality should provide the length and the type
of the object, like the normal read functionality does.
|
|\ \
| | |
| | | |
Use longer conflict markers in recursive merge base
|
| | |
| | |
| | |
| | |
| | |
| | | |
Allow for a custom conflict marker size, allowing callers to override
the default size of the "<<<<<<<" and ">>>>>>>" markers in the
conflicted output file.
|
|/ /
| |
| |
| | |
Fixes #4492, #4496.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Implement message trailer parsing API
|
| | | |
|
| | | |
|
| |\ \ |
|
| | | | |
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is implemented in trailer.c and borrows a large amount of logic
from Git core to ensure compatibility.
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| | |
Support using notes via a commit rather than a ref
|
| | |
| | |
| | |
| | | |
This also adds tests for this function.
|
| | |
| | |
| | |
| | | |
This also adds tests for this function.
|
| | |
| | |
| | |
| | | |
This also adds tests for this function.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Add git_status_file_at
|
| | |/
| |/|
| | |
| | | |
other than HEAD
|
| | |
| | |
| | | |
I'm not sure if worktree.h was intentionally left out of git2.h. Looks like an oversight since it is in fact documented.
|
| | |
| | |
| | |
| | |
| | | |
We default to off, but we might want to consider changing `GIT_DIFF_NORMAL` to
include it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | | |
optios -> options
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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`.
|
|/ /
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| | |
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.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Remove unused 'sys/remote.h' header
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
Patch ID calculation
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|/ / / |
|