summaryrefslogtreecommitdiff
path: root/include/git2/common.h
Commit message (Collapse)AuthorAgeFilesLines
* amiga: use ';' as path list separator on AmigaOSPeter Pettersson2021-08-081-3/+3
| | | | Like on Windows ':' is used for volume names in absolute paths.
* odb: Implement option for overriding of default odb backend priorityTony De La Nuez2021-07-301-1/+11
| | | | | | | | | | | Introduce GIT_OPT_SET_ODB_LOOSE_PRIORITY and GIT_OPT_SET_ODB_PACKED_PRIORITY to allow overriding the default priority values for the default ODB backends. Libgit2 has historically assumed that most objects for long- running operations will be packed, therefore GIT_LOOSE_PRIORITY is set to 1 by default, and GIT_PACKED_PRIORITY to 2. When a client allows libgit2 to set the default backends, they can specify an override for the two priority values in order to change the order in which each ODB backend is accessed.
* Add documentation about GIT_OPT_GET_USER_AGENTpunkymaniac2021-06-021-0/+5
|
* Review feedbacklhchavez2020-06-261-1/+1
| | | | | | | | | | * Change the default of the file limit to 0 (unlimited). * Changed the heuristic to close files to be the file that contains the least-recently-used window such that the window is the most-recently-used in the file, and the file does not have in-use windows. * Parameterized the filelimit test to check for a limit of 1 and 100 open windows.
* mwindow: set limit on number of open fileslhchavez2020-06-211-3/+15
| | | | | | | | | | | | | | | | | | There are some cases in which repositories accrue a large number of packfiles. The existing mwindow limit applies only to the total size of mmap'd files, not on their number. This leads to a situation in which having lots of small packfiles could exhaust the allowed number of open files, particularly on macOS, where the default ulimit is very low (256). This change adds a new configuration parameter (GIT_OPT_SET_MWINDOW_FILE_LIMIT) that sets the maximum number of open packfiles, with a default of 128. This is low enough so that even macOS users should not hit it during normal use. Based on PR #5386, originally written by @josharian. Fixes: #2758
* git_libgit2_version: return an intethomson/no_voidEdward Thomson2020-01-241-1/+2
| | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
* httpclient: support expect/continueEdward Thomson2020-01-241-1/+7
| | | | | | | | | | | | | 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.
* Remove public 'inttypes.h' headerethomson/inttypesEdward Thomson2019-02-211-4/+1
| | | | | | | | | | | Remove an `inttypes.h` header that is too large in scope, and far too public. For Visual Studio 2012 and earlier (ie, `_MSC_VER < 1800`), we do need to include `stdint.h` in our public headers, for types like `uint32_t`. Internally, we also need to define `PRId64` as a printf formatting string when it is not available.
* Allow bypassing check '.keep' files using libgit2 option ↵Dhruva Krishnamurthy2019-02-021-1/+6
| | | | 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK'
* deprecation: add `used` attributeEdward Thomson2019-01-201-0/+1
| | | | | Recent GCC enables `-Wunused-const-variables`, which makes output quite noisy. Disable unused warnings for our deprecated variables.
* Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-171-0/+7
| | | | | | | | | Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
* Use cdecl calling conventions on Win32Edward Thomson2019-01-171-1/+1
| | | | | | | | | | | | | | | | | | | The recommendation from engineers within Microsoft is that libraries should have a calling convention specified in the public API, and that calling convention should be cdecl unless there are strong reasons to use a different calling convention. We previously offered end-users the choice between cdecl and stdcall calling conventions. We did this for presumed wider compatibility: most Windows applications will use cdecl, but C# and PInvoke default to stdcall for WINAPI compatibility. (On Windows, the standard library functions are are stdcall so PInvoke also defaults to stdcall.) However, C# and PInvoke can easily call cdecl APIs by specifying an annotation. Thus, we will explicitly declare ourselves cdecl and remove the option to build as stdcall.
* object_type: update public API to use git_object_tEdward Thomson2018-12-011-3/+3
| | | | | | git_object_t is the future; update the public API to use it. This will also ensure that we can build our tests which make use of the old API without modification (and without compiler warnings).
* util: allow callers to reset custom allocatorsEdward Thomson2018-10-211-1/+2
| | | | | Provide a utility to reset custom allocators back to their default. This is particularly useful for testing.
* INDEXER_MAX_OBJECTS -> PACK_MAX_OBJECTSNelson Elhage2018-07-161-4/+4
|
* Add a git_libgit2_opts option to set the max indexer object countNelson Elhage2018-07-121-1/+15
|
* settings: optional unsaved index safetyEdward Thomson2018-06-291-1/+10
| | | | | | | | | | | | | | Add the `GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY` option, which will cause commands that reload the on-disk index to fail if the current `git_index` has changed that have not been saved. This will prevent users from - for example - adding a file to the index then calling a function like `git_checkout` and having that file be silently removed from the index since it was re-read from disk. Now calls that would re-read the index will fail if the index is "dirty", meaning changes have been made to it but have not been written. Users can either `git_index_read` to discard those changes explicitly, or `git_index_write` to write them.
* Merge pull request #4436 from pks-t/pks/packfile-stream-freeEdward Thomson2018-06-111-0/+11
|\ | | | | pack: rename `git_packfile_stream_free`
| * common.h: create `GIT_DEPRECATED` macroPatrick Steinhardt2018-06-101-0/+11
| |
* | settings: allow swapping out memory allocatorPatrick Steinhardt2018-06-071-0/+7
|/ | | | | | | 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.
* settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`Patrick Steinhardt2017-06-081-3/+3
| | | | | | | | | | | 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.
* odb: add option to turn off hash verificationPatrick Steinhardt2017-04-281-0/+8
| | | | | | | | | | | Verifying hashsums of objects we are reading from the ODB may be costly as we have to perform an additional hashsum calculation on the object. Especially when reading large objects, the penalty can be as high as 35%, as can be seen when executing the equivalent of `git cat-file` with and without verification enabled. To mitigate for this, we add a global option for libgit2 which enables the developer to turn off the verification, e.g. when he can be reasonably sure that the objects on disk won't be corrupted.
* Allow to configure default file share mode for opening filesSven Strickroth2017-04-031-0/+13
| | | | | | This can prevent FILE_SHARED_VIOLATIONS when used in tools such as TortoiseGit TGitCache and FILE_SHARE_DELETE, because files can be opened w/o being locked any more. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* fsync: call it "synchronous" object writingEdward Thomson2017-02-281-2/+2
| | | | | Rename `GIT_OPT_ENABLE_SYNCHRONIZED_OBJECT_CREATION` -> `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`.
* Add `ENABLE_SYNCHRONIZED_OBJECT_CREATION` optionEdward Thomson2017-02-281-0/+8
| | | | Allow users to enable `SYNCHRONIZED_OBJECT_CREATION` with a setting.
* Changes to provide option to turn off/on ofs_deltaGaurav Saral2017-02-101-0/+11
| | | | This change provides an option in git_libgit2_opt_t which can be used in git_libgit2_opts to turn off/on ofs_delta capability in libGit2
* Merge branch 'pr/3912'Edward Thomson2017-01-211-0/+10
|\
| * symbolic ref target validation: fixupsEdward Thomson2017-01-211-10/+8
| | | | | | | | Fixups requested in #3912.
| * Make symbolic ref target validation optionalRichard Ipsum2016-08-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce GIT_OPT_ENABLE_SYMBOLIC_REF_TARGET_VALIDATION option. Setting this option to 0 allows validation of a symbolic ref's target to be bypassed. This option is enabled by default. This mechanism is added primarily to address a discrepancy between git behaviour and libgit2 behaviour, whereby the former allows the symbolic ref target to carry an arbitrary string and the latter does not, so: $ git symbolic-ref refs/heads/foo bar $ cat .git/refs/heads/foo ref: bar where as attempting the same via libgit2 raises an error: The given reference name 'bar' is not valid this mechanism also allows those that might want to make use of git's more lenient treatment of symbolic ref targets to do so.
* | settings: clarify what each value meanscmn/https-cap-no-hardcodeCarlos Martín Nieto2016-12-171-0/+18
| | | | | | | | Most importantly, clarify what it means for HTTPS and SSH to be supported.
* | docs: GIT_OPT_ENABLE_STRICT_OBJECT_CREATION is enabledethomson/settings_docsEdward Thomson2016-10-091-1/+2
|/ | | | | We changed the defaults on strict object creation - it is enabled by default. Update the documentation to reflect that.
* Add get user agent functionality.Andrius Bentkus2016-07-051-0/+1
|
* Add a no-op size_t typedef for the doc parsercmn/typedef-sizetCarlos Martín Nieto2016-03-311-0/+8
| | | | | | | | | Clang's documentation parser, which we use in our documentation system does not report any comments for functions which use size_t as a type. The root cause is buried somewhere in libclang but we can work around it by defining the type ourselves. This typedef makes sure that libclang sees it and that we do not change its size.
* Setup better defaults for OpenSSL ciphersDirkjan Bussink2016-03-141-0/+6
| | | | | | | | | This ensures that when using OpenSSL a safe default set of ciphers is selected. This is done so that the client communicates securely and we don't accidentally enable unsafe ciphers like RC4, or even worse some old export ciphers. Implements the first part of https://github.com/libgit2/libgit2/issues/3682
* Merge pull request #3636 from nerdishbynature/fix-non-modular-header-in-moduleCarlos Martín Nieto2016-03-111-1/+2
|\ | | | | Don't include inttypes if compiling for Mac/iOS
| * Check for __CLANG_INTTYPES_HPiet Brauer2016-03-111-1/+2
| | | | | | | | | | | | This fixes an issue in Xcode 7.3 in objective-git where we get the error "Include of non-modular header file in module". Not importing this header again fixes the issue.
* | git_libgit2_opts: introduce `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION`Edward Thomson2016-02-281-0/+9
|/
* git_libgit2_opts: document GIT_OPT_SET_USER_AGENTEdward Thomson2016-02-221-0/+6
|
* settings: allow users to set PROGRAMDATAEdward Thomson2015-11-161-5/+6
| | | | | | Allow users to set the `git_libgit2_opts` search path for the `GIT_CONFIG_LEVEL_PROGRAMDATA`. Convert `GIT_CONFIG_LEVEL_PROGRAMDATA` to `GIT_SYSDIR_PROGRAMDATA` for setting the configuration.
* Merge pull request #3170 from CmdrMoozy/nsec_fixCarlos Martín Nieto2015-11-121-2/+3
|\ | | | | git_index_entry__init_from_stat: set nsec fields in entry stats
| * settings: expose GIT_USE_NSEC flag in git_libgit2_featuresAxel Rasmussen2015-09-181-2/+3
| |
* | settings: add a setter for a custom user-agentCarlos Martín Nieto2015-11-121-0/+3
| |
* | inttypes.h is built-in header file since MSVC 2013Linquize2015-10-221-1/+1
| | | | | | | | | | | | | | The reason is that the types defined in libgit2's inttypes.h collide with system inttypes.h 3rd party library header files may directly reference MSVC's built-in inttypes.h Fixes #3476
* | win32: add c linkage guard around inttypes.h inclusionEdward Thomson2015-10-211-6/+8
|/
* doc: add documentation to all the public structs and enumscmn/doc-allCarlos Martín Nieto2014-12-061-1/+6
| | | | | | | | | | This makes them show up in the reference, even if the text itself isn't the most descriptive. These have been found with grep -Przon '\n\ntypedef struct.*?\{' -- include grep -Przon '\n\ntypedef enum.*?\{' -- include
* Move un-namespaced constant to internal headerRussell Belfer2014-10-101-2/+0
| | | | FLAG_BITS only seems to be used internally
* Merge pull request #2588 from swansontec/ssl-cert-path2Carlos Martín Nieto2014-10-101-1/+13
|\ | | | | Add support for setting the SSL CA location
| * Add support for setting the SSL CA locationWilliam Swanson2014-09-301-1/+13
| | | | | | | | | | This allows users to specify self-signed certificates, or to provide their own certificate stores on limited platforms such as mobile phones.
* | object: introduce git_describe_object()nulltoken2014-04-301-0/+2
|/
* opts: bits are not bytesCarlos Martín Nieto2014-03-241-1/+1
| | | | | The default cache size is 256 megabytes, not megabits as claimed in the docs.