Commit Graph

60 Commits

Author SHA1 Message Date
William Swanson
737b445a18 Add support for setting the SSL CA location
This allows users to specify self-signed certificates, or to provide their
own certificate stores on limited platforms such as mobile phones.
2014-09-30 17:26:39 -07:00
Carlos Martín Nieto
6057c4a038 opts: bits are not bytes
The default cache size is 256 megabytes, not megabits as claimed in the
docs.
2014-03-24 13:21:51 +01:00
Carlos Martín Nieto
42dee8ecd7 settings: use git_buf for returning strings
This survived the last round of culling, as the signature is only in the
comments.
2014-03-24 13:21:51 +01:00
Arthur Schreiber
96484ecd9e Fix the description for GIT_FEATURE_SSH. 2014-03-03 12:59:35 +01:00
Vicent Marti
ebb3c506fd features: Rename _HAS_ to _FEATURE_ 2014-03-03 12:40:25 +01:00
Vicent Marti
2491c416ed caps: Rename the enum name too! 2014-03-03 12:13:17 +01:00
Vicent Marti
c9f5298b0e caps: Rename to features to avoid confusion 2014-03-03 12:10:36 +01:00
Russell Belfer
72556cc63b Address PR comments
* Make GIT_INLINE an internal definition so it cannot be used in
  public headers
* Fix language in CONTRIBUTING
* Make index caps API use signed instead of unsigned values
2014-02-20 14:27:10 -08:00
Linquize
1b57699a3a Fix typo in documentation 2013-09-22 09:38:51 +08:00
Linquize
b99b10f285 Can git_libgit2_opts() with GIT_OPT_GET_TEMPLATE_PATH and GIT_OPT_SET_TEMPLATE_PATH 2013-09-18 00:00:41 +08:00
Russell Belfer
290e147985 Add GIT_CAP_SSH if library was built with SSH
This also adds a test that actually calls git_libgit2_capabilities
and git_libgit2_version.
2013-07-09 16:17:41 -07:00
Russell Belfer
2e62e7c23c Docs for git_libgit2_opts and cache disable tweak
This adds docs for the cache control options to git_libgit2_opts
and also tweaks the cache code so that if the cache is disabled,
then the next time we attempt to insert something into the cache
in question, we will actually clear any old cached objects.
2013-05-24 10:33:41 -07:00
Russell Belfer
0f1f9833cf Add typedefs on some public enums
Apparently this makes things easier to bind in some languages.
2013-05-24 10:32:07 -07:00
Carlos Martín Nieto
b4117e19b7 docs: formatting fixes 2013-04-24 20:25:57 +02:00
Vicent Marti
a2378ae4fe opts: Add getter for cached memory 2013-04-23 20:42:29 +02:00
Vicent Marti
d877159260 cache: Max cache size, and evict when the cache fills up 2013-04-22 17:04:52 +02:00
Vicent Marti
ee12272d17 Global option setters 2013-04-22 16:50:51 +02:00
Vicent Marti
e16e268457 No longer needed 2013-04-22 16:50:51 +02:00
Michael Schubert
f5e28202cb opts: allow configuration of odb cache size
Currently, the odb cache has a fixed size of 128 slots as defined by
GIT_DEFAULT_CACHE_SIZE. Allow users to set the size of the cache via
git_libgit2_opts().

Fixes #1035.
2013-03-25 15:45:56 +01:00
Russell Belfer
41954a49c1 Switch search paths to classic delimited strings
This switches the APIs for setting and getting the global/system
search paths from using git_strarray to using a simple string with
GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment
PATH variable would contain.  This makes it simpler to get and set
the value.

I also added code to expand "$PATH" when setting a new value to
embed the old value of the path.  This means that I no longer
require separate actions to PREPEND to the value.
2013-03-18 14:19:35 -07:00
Russell Belfer
5540d9477e Implement global/system file search paths
The goal of this work is to expose the search logic for "global",
"system", and "xdg" files through the git_libgit2_opts() interface.

Behind the scenes, I changed the logic for finding files to have a
notion of a git_strarray that represents a search path and to store
a separate search path for each of the three tiers of config file.
For each tier, I implemented a function to initialize it to default
values (generally based on environment variables), and then general
interfaces to get it, set it, reset it, and prepend new directories
to it.

Next, I exposed these interfaces through the git_libgit2_opts
interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
for the user to control which search path they were modifying.
There are alternative designs for the opts interface / argument
ordering, so I'm putting this phase out for discussion.

Additionally, I ended up doing a little bit of clean up regarding
attr.h and attr_file.h, adding a new attrcache.h so the other two
files wouldn't have to be included in so many places.
2013-03-15 16:39:00 -07:00
Vicent Marti
a0f777c87f opts: Add getters too 2013-01-23 23:44:34 +01:00
Vicent Marti
59853eff99 Global options setter 2013-01-23 02:58:58 +01:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Philip Kelley
613d5eb939 Push! By schu, phkelley, and congyiwu, et al 2012-11-28 11:42:37 -05:00
Paul Thompson
b46708aaf9 Separated git_strarray from common.h. Added doxy comments. 2012-10-11 23:04:08 +11:00
Sascha Cunz
e564e4969c Add function to query for compile time settings. 2012-08-01 20:02:32 +02:00
Chris Young
a8df98c6fb Updates from comments on OS4 compatibility pull request http://github.com/libgit2/libgit2/pull/766 2012-06-14 18:57:24 +01:00
Chris Young
327fb51cec Fix gethostbyname compatibility 2012-06-09 18:13:07 +01:00
Chris Young
fa56478fb8 Generic needs compat files 2012-06-08 19:15:11 +01:00
Chris Young
aa5a92d121 OS4 compatibility 2012-06-08 18:57:35 +01:00
Chris Young
0f5e1f3b68 Network byte order is big-endian - the way it should be :) 2012-06-07 21:56:19 +01:00
Vicent Martí
79fdde494f Revert "Specifiy dllimport to MSVC if we're not building libgit2.dll"
This reverts commit 1093e2de22.
2012-05-14 22:15:53 +02:00
Sascha Cunz
1093e2de22 Specifiy dllimport to MSVC if we're not building libgit2.dll
Building a "shared object" (DLL) in Windows includes 2 steps:

- specify __declspec(dllexport)
  when building the library itself. MSVC will disallow itself from
  optimizing these symbols out and reference them in the PE's
  Exports-Table.
  Further, a static link library will be generated. This library
  contains the symbols which are exported via the declsepc above.
  The __declspec(dllexport) becomes part of the symbol-signature
  (like parameter types in C++ are 'mangled' into the symbol name,
  the export specifier is mingled with the name)

- specify __declspec(dllimport)
  when using the library. This again mingles the declspec into the
  name and declares the function / variable with external linkage.

cmake automatically adds -Dgit2_EXPORTS to the compiler arguments
when compiling the libgit2 project.
The 'git2' is the name specified via PROJECT() in CMakeLists.txt.
2012-05-14 20:22:50 +02:00
Scott J. Goldman
b1ec25facc Fix comment typo in common.h 2012-05-10 17:16:38 -07:00
Vicent Martí
40879facad Merge branch 'new-error-handling' into development
Conflicts:
	.travis.yml
	include/git2/diff.h
	src/config_file.c
	src/diff.c
	src/diff_output.c
	src/mwindow.c
	src/path.c
	tests-clar/clar_helpers.c
	tests-clar/object/tree/frompath.c
	tests/t00-core.c
	tests/t03-objwrite.c
	tests/t08-tag.c
	tests/t10-refs.c
	tests/t12-repo.c
	tests/t18-status.c
	tests/test_helpers.c
	tests/test_main.c
2012-05-02 15:59:02 -07:00
Sven Strickroth
c02f13925a Check for _WIN32 is sufficient, even for x64 compilers
There is no need to check for _WIN32 and _WIN64. x64 compiler also set _WIN32 (compare http://sourceforge.net/apps/mediawiki/predef/index.php?title=Operating_Systems#Windows).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-04-21 18:43:10 +02:00
Russell Belfer
14a513e058 Add support for pathspec to diff and status
This adds preliminary support for pathspecs to diff and status.
The implementation is not very optimized (it still looks at
every single file and evaluated the the pathspec match against
them), but it works.
2012-04-13 15:00:29 -07:00
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Vicent Marti
a15c550db8 threads: Fix the shared global state with TLS
See `global.c` for a description of what we're doing.

When libgit2 is built with GIT_THREADS support, the threading system
must be explicitly initialized with `git_threads_init()`.
2011-11-16 14:09:44 +01:00
Sven Strickroth
314f54eb06 fix build for x64
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 05:29:57 +02:00
Vicent Marti
c060854ed5 msvc: Properly handle inttypes.h/stdint.h 2011-10-05 16:21:16 -04:00
Vicent Martí
e311519dce Merge pull request #411 from boyski/gcc4
Don't use '__attribute__ visibility' with gcc unless it's at version 4 or better
2011-09-18 19:38:14 -07:00
David Boyce
d2a1861ea1 Don't use '__attribute__ visibility' with gcc unless it's at
version 4 or better.
2011-09-18 21:27:25 -04:00
Vicent Marti
87d9869fc3 Tabify everything
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
2011-09-19 03:34:49 +03:00
Vicent Marti
bb742ede3d Cleanup legal data
1. The license header is technically not valid if it doesn't have a
copyright signature.

2. The COPYING file has been updated with the different licenses used in
the project.

3. The full GPLv2 header in each file annoys me.
2011-09-19 01:54:32 +03:00
Vicent Marti
536955f9d7 Add method to get the compiled version of the lib 2011-06-16 02:21:33 +02:00
Romain Geissler
0657e46dee Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.
GIT_PATH_LIST_SEPARATOR and GIT_PATH_MAX are made public so
that it's can be used by a client.
2011-06-15 22:11:18 +02:00
Vicent Marti
6810bf28f8 Move all error-related defines to git2/errors.h 2011-05-11 00:40:07 +03:00
kelly.leahy
ab86f159e5 Fix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.
The GIT_EXPORT macro is used to declare a function to be externally
accessible to other libraries.  This commit uses GIT_EXPORT to declare
the git_lasterror() function as externally exported.  I verified with
depends.exe that the function is available to external callers (i.e.
in the exports table of the PE file).
2011-05-09 23:39:32 -07:00