Commit Graph

2180 Commits

Author SHA1 Message Date
Edward Thomson
3f54ba8b61 credential: change git_cred to git_credential
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.
2020-01-26 18:39:41 +00:00
Edward Thomson
e9cef7c4b1 http: introduce GIT_ERROR_HTTP
Disambiguate between general network problems and HTTP problems in error
codes.
2020-01-24 10:39:56 -06:00
Edward Thomson
7372573b5f httpclient: support expect/continue
Allow users to opt-in to expect/continue handling when sending a POST
and we're authenticated with a "connection-based" authentication
mechanism like NTLM or Negotiate.

If the response is a 100, return to the caller (to allow them to post
their body).  If the response is *not* a 100, buffer the response for
the caller.

HTTP expect/continue is generally safe, but some legacy servers
have not implemented it correctly.  Require it to be opt-in.
2020-01-24 10:16:36 -06:00
Laurence McGlashan
1bddbd02a6 merge: Return non-const git_repository from git_merge_driver_source_repo accessor. 2020-01-15 10:30:00 +00:00
Remy Suen
5930cf253c Correct typo in name of referenced parameter
Signed-off-by: Remy Suen <remy.suen@gmail.com>
2020-01-02 14:57:55 -05:00
Patrick Steinhardt
2f6f10bb80 Merge pull request #5300 from tiennou/fix/branch-documentation
branch: clarify documentation around branches
2019-12-13 13:35:40 +01:00
Etienne Samson
97b8491b01 refs: rename git_reference__set_name to git_reference__realloc
As git_reference__name will reallocate storage to account for longer
names (it's actually allocator-dependent), it will cause all existing
pointers to the old object to become dangling, as they now point to
freed memory.

Fix the issue by renaming to a more descriptive name, and pass a pointer
to the actual reference that can safely be invalidated if the realloc
succeeds.
2019-12-13 12:01:10 +01:00
Etienne Samson
39f78b0c03 branch: clarify documentation around branches 2019-12-07 10:31:27 +01:00
Josh Bleecher Snyder
64e6db5b6e stash: make comment match code
There is no git_stash_apply_flags_t above.
2019-12-04 14:37:26 -08:00
Edward Thomson
d298f9b287 Merge pull request #5315 from kastiglione/dl/fix-copypaste-in-git_cherrypick_commit-docstring
Fix copy&paste in git_cherrypick_commit docstring
2019-12-01 14:11:56 +11:00
Dave Lee
b7cf4b9e48 Fix copy&paste in git_cherrypick_commit docstring 2019-11-29 14:19:40 -08:00
Patrick Steinhardt
fb439c975a Merge pull request #5306 from herrerog/patchid
diff: complete support for git patchid
2019-11-28 14:41:58 +01:00
Patrick Steinhardt
0b5540b923 Merge pull request #5307 from palmin/hash_sha256
ssh: include sha256 host key hash when supported
2019-11-28 13:56:54 +01:00
Patrick Steinhardt
0e5243b78f Merge pull request #5123 from libgit2/ethomson/off_t
Move `git_off_t` to `git_object_size_t`
2019-11-28 12:42:36 +01:00
Lukas Berk
5ace4ccf39 Move deprecated git_attr_t typedef to previous attribute section 2019-11-27 22:40:17 -05:00
Lukas Berk
3739a15c00 Add attr.h include 2019-11-27 21:31:25 -05:00
Lukas Berk
aea049b63a Add compat typdef for git_attr_t
Some libraries haven't updated to git_attr_value_t and break.  Adding
the comapt typedef as suggested.
2019-11-27 21:24:16 -05:00
Edward Thomson
fefefd1d39 odb: use git_object_size_t for object size
Instead of using a signed type (`off_t`) use a new `git_object_size_t`
for the sizes of objects.
2019-11-22 15:14:13 +11:00
Edward Thomson
4334b1779f blob: use git_object_size_t for object size
Instead of using a signed type (`off_t`) use a new `git_object_size_t`
for the sizes of objects.
2019-11-22 15:10:19 +11:00
Edward Thomson
bed9fc6b59 odb: use git_object_size_t for object size
Instead of using a signed type (`off_t`) use a new `git_object_size_t`
for the sizes of objects.
2019-11-22 15:09:17 +11:00
Edward Thomson
9b04d0be29 types: introduce git_object_size_t
Introduce `git_object_size_t`, an unsigned type that we can use for the
maximum size of git objects.
2019-11-22 15:04:09 +11:00
Anders Borum
48c3f7e1f1 ssh: include sha256 host key hash when supported 2019-11-20 11:24:14 +01:00
Gregory Herrero
b921964b25 diff_print: add support for GIT_DIFF_FORMAT_PATCH_ID.
Git is generating patch-id using a stripped down version of a patch
where hunk header and index information are not present.

Signed-off-by: Gregory Herrero <gregory.herrero@oracle.com>
2019-11-19 09:33:12 +01:00
Drew DeVault
02af1fcb69 apply: add GIT_APPLY_CHECK
This adds an option which will check if a diff is applicable without
actually applying it; equivalent to git apply --check.
2019-10-22 10:23:24 -04:00
Etienne Samson
3c5d78bd7e submodule: provide a wrapper for simple submodule clone steps 2019-10-17 13:09:39 +02:00
Patrick Steinhardt
7032537066 Merge pull request #5106 from tiennou/fix/ref-api-fixes
git_refdb API fixes
2019-09-27 11:16:02 +02:00
Sven Strickroth
452b7f8f4c Don't use enum for flags
Using an `enum` causes trouble when used with C++ as bitwise operations are not possible w/o casting (e.g., `opts.flags &= ~GIT_BLOB_FILTER_CHECK_FOR_BINARY;` is invalid as there is no `&=` operator for `enum`).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2019-09-26 08:26:09 +02:00
Etienne Samson
71ca3dc771 transport: move transport-related typedef in transport.h 2019-09-13 16:54:40 +02:00
Etienne Samson
606f6e21a9 cert: move cert enums & struct to its own header 2019-09-13 16:54:40 +02:00
Etienne Samson
8bf0f7eb26 cred: separate public interface from low-level details 2019-09-13 16:54:40 +02:00
Etienne Samson
8db9fd3b0d refdb: documentation 2019-09-05 10:26:38 +02:00
Edward Thomson
6de48085b6 Merge pull request #5189 from libgit2/ethomson/attrs_from_head
Optionally read `.gitattributes` from HEAD
2019-08-27 11:29:24 -04:00
Edward Thomson
fba3bf7978 blob: optionally read attributes from repository
When `GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD` is passed to
`git_blob_filter`, read attributes from `gitattributes` files that
are checked in to the repository at the HEAD revision.  This passes
the flag `GIT_FILTER_ATTRIBUTES_FROM_HEAD` to the filter functions.
2019-08-11 20:47:59 +01:00
Edward Thomson
f0f27c1c2b filter: optionally read attributes from repository
When `GIT_FILTER_ATTRIBUTES_FROM_HEAD` is specified, configure the
filter to read filter attributes from `gitattributes` files that are
checked in to the repository at the HEAD revision.  This passes the flag
`GIT_ATTR_CHECK_INCLUDE_HEAD` to the attribute reading functions.
2019-08-11 20:47:59 +01:00
Edward Thomson
4fd5748c4b attr: optionally read attributes from repository
When `GIT_ATTR_CHECK_INCLUDE_HEAD` is specified, read `gitattribute`
files that are checked into the repository at the HEAD revision.
2019-08-11 20:47:59 +01:00
Edward Thomson
a5392eae3d blob: allow blob filtering to ignore system gitattributes
Introduce `GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES`, which tells
`git_blob_filter` to ignore the system-wide attributes file, usually
`/etc/gitattributes`.

This simply passes the appropriate flag to the attribute loading code.
2019-08-11 20:47:59 +01:00
Edward Thomson
22eb12afef filter: add GIT_FILTER_NO_SYSTEM_ATTRIBUTES option
Allow system-wide attributes (the ones specified in
`/etc/gitattributes`) to be ignored if the flag
`GIT_FILTER_NO_SYSTEM_ATTRIBUTES` is specified.
2019-08-11 20:47:59 +01:00
Edward Thomson
45ddb58634 filter: document GIT_FILTER_ALLOW_UNSAFE 2019-08-11 20:47:59 +01:00
Edward Thomson
fa1a4c77f5 blob: deprecate git_blob_filtered_content
Users should now use `git_blob_filter`.
2019-08-11 20:47:59 +01:00
Edward Thomson
a32ab076bd blob: introduce git_blob_filter
Provide a function to filter blobs that allows for more functionality
than the existing `git_blob_filtered_content` function.
2019-08-11 20:47:59 +01:00
Patrick Steinhardt
b0692d6b3e Merge pull request #4913 from implausible/feature/signing-rebase-commits
Add sign capability to git_rebase_commit
2019-08-09 09:01:56 +02:00
Carlos Martín Nieto
c8e249b032 object: deprecate git_object__size for removal
In #5118 we remove the double-underscore to make it a normally-named public
function. However, this is not an interesting function outside of the library
and it takes up a name for something that could be more useful.

Remove the single-underscore version as we have not done any releases with it.
2019-07-29 11:15:32 +02:00
Edward Thomson
36558513c8 configuration: deprecate git_cvar safely 2019-07-18 13:59:05 +02:00
Patrick Steinhardt
658022c41a configuration: cvar -> configmap
`cvar` is an unhelpful name.  Refactor its usage to `configmap` for more
clarity.
2019-07-18 13:53:41 +02:00
Tyler Ang-Wanek
8f68ad9df1 documentation: add small explanation for commit signing 2019-07-02 10:14:46 -07:00
Tyler Ang-Wanek
a5d4237c91 fixup: code cleanup around rebase commit signing
Use ci_git_fail_with where appropriate.
Use correct initializer for callback.
2019-07-02 10:14:02 -07:00
Tyler Ang-Wanek
759471056f commit: git_commit_create_with_signature should support null signature
If provided with a null signature, skip adding the signature header and create the commit anyway.
2019-07-02 09:56:19 -07:00
Patrick Steinhardt
b6625a3b6e Merge pull request #5128 from tiennou/fix/docs
More documentation
2019-06-27 10:12:16 +02:00
Etienne Samson
33448b4519 docs: More of it 2019-06-26 15:49:37 +02:00
Etienne Samson
501c51b244 repo: commondir resolution can sometimes fallback to the repodir
For example, https://git-scm.com/docs/gitrepository-layout says:

    info
    Additional information about the repository is recorded in this directory.
    This directory is ignored if $GIT_COMMON_DIR is set
    and "$GIT_COMMON_DIR/info" will be used instead.

So when looking for `info/attributes`, we need to check the commondir first,
or fallback to "our" `info/attributes`.
2019-06-26 14:49:50 +02:00