summaryrefslogtreecommitdiff
path: root/include/git2/common.h
Commit message (Collapse)AuthorAgeFilesLines
* features: Rename `_HAS_` to `_FEATURE_`vmg/featuresVicent Marti2014-03-031-7/+7
|
* caps: Rename the enum name too!Vicent Marti2014-03-031-1/+1
|
* caps: Rename to features to avoid confusionVicent Marti2014-03-031-8/+13
|
* Address PR commentsRussell Belfer2014-02-201-7/+0
| | | | | | | * 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
* Fix typo in documentationLinquize2013-09-221-1/+1
|
* Can git_libgit2_opts() with GIT_OPT_GET_TEMPLATE_PATH and ↵Linquize2013-09-181-1/+15
| | | | GIT_OPT_SET_TEMPLATE_PATH
* Add GIT_CAP_SSH if library was built with SSHRussell Belfer2013-07-091-1/+2
| | | | | This also adds a test that actually calls git_libgit2_capabilities and git_libgit2_version.
* Docs for git_libgit2_opts and cache disable tweakRussell Belfer2013-05-241-2/+31
| | | | | | | 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.
* Add typedefs on some public enumsRussell Belfer2013-05-241-6/+7
| | | | Apparently this makes things easier to bind in some languages.
* docs: formatting fixesCarlos Martín Nieto2013-04-241-23/+31
|
* opts: Add getter for cached memoryvmg/atomic64Vicent Marti2013-04-231-1/+2
|
* cache: Max cache size, and evict when the cache fills upvmg/new-cacheVicent Marti2013-04-221-1/+2
|
* Global option settersVicent Marti2013-04-221-0/+2
|
* No longer neededVicent Marti2013-04-221-11/+0
|
* opts: allow configuration of odb cache sizeMichael Schubert2013-03-251-0/+11
| | | | | | | | 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.
* Switch search paths to classic delimited stringsRussell Belfer2013-03-181-19/+14
| | | | | | | | | | | | 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.
* Implement global/system file search pathsRussell Belfer2013-03-151-8/+38
| | | | | | | | | | | | | | | | | | | | | | | 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.
* opts: Add getters tooVicent Marti2013-01-231-2/+4
|
* Global options setterVicent Marti2013-01-231-0/+23
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Push! By schu, phkelley, and congyiwu, et alPhilip Kelley2012-11-281-0/+5
|
* Separated git_strarray from common.h. Added doxy comments.Paul Thompson2012-10-111-8/+1
|
* Add function to query for compile time settings.Sascha Cunz2012-08-011-0/+23
|
* Updates from comments on OS4 compatibility pull request ↵Chris Young2012-06-141-2/+0
| | | | http://github.com/libgit2/libgit2/pull/766
* Fix gethostbyname compatibilityChris Young2012-06-091-5/+1
|
* Generic needs compat filesChris Young2012-06-081-1/+1
|
* OS4 compatibilityChris Young2012-06-081-0/+2
|
* Network byte order is big-endian - the way it should be :)Chris Young2012-06-071-0/+8
|
* Revert "Specifiy dllimport to MSVC if we're not building libgit2.dll"Vicent Martí2012-05-141-5/+1
| | | | This reverts commit 1093e2de22f6ca245b09d758a3510899a8362048.
* Specifiy dllimport to MSVC if we're not building libgit2.dllSascha Cunz2012-05-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | 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.
* Fix comment typo in common.hScott J. Goldman2012-05-101-1/+1
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add support for pathspec to diff and statusRussell Belfer2012-04-131-0/+1
| | | | | | | | | | | | | | 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.
* | Check for _WIN32 is sufficient, even for x64 compilersSven Strickroth2012-04-211-1/+1
|/ | | | | | 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>
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* threads: Fix the shared global state with TLSVicent Marti2011-11-161-13/+0
| | | | | | | 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()`.
* fix build for x64Sven Strickroth2011-10-091-1/+1
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* msvc: Properly handle inttypes.h/stdint.hVicent Marti2011-10-051-0/+6
|
* Merge pull request #411 from boyski/gcc4Vicent Martí2011-09-181-2/+2
|\ | | | | Don't use '__attribute__ visibility' with gcc unless it's at version 4 or better
| * Don't use '__attribute__ visibility' with gcc unless it's atDavid Boyce2011-09-181-2/+2
| | | | | | | | version 4 or better.
* | Tabify everythingVicent Marti2011-09-191-11/+11
| | | | | | | | | | | | 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.
* | Cleanup legal dataVicent Marti2011-09-191-21/+3
|/ | | | | | | | | | 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.
* Add method to get the compiled version of the libVicent Marti2011-06-161-0/+10
|
* Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.Romain Geissler2011-06-151-0/+20
| | | | | GIT_PATH_LIST_SEPARATOR and GIT_PATH_MAX are made public so that it's can be used by a client.
* Move all error-related defines to `git2/errors.h`Vicent Marti2011-05-111-94/+0
|
* Fix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.kelly.leahy2011-05-091-0/+2
| | | | | | | | 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).
* Change error handling mechanism once againVicent Marti2011-05-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ok, this is the real deal. Hopefully. Here's how it's going to work: - One main method, called `git__throw`, that sets the error code and error message when an error happens. This method must be called in every single place where an error code was being returned previously, setting an error message instead. Example, instead of: return GIT_EOBJCORRUPTED; Use: return git__throw(GIT_EOBJCORRUPTED, "The object is missing a finalizing line feed"); And instead of: [...] { error = GIT_EOBJCORRUPTED; goto cleanup; } Use: [...] { error = git__throw(GIT_EOBJCORRUPTED, "What an error!"); goto cleanup; } The **only** exception to this are the allocation methods, which return NULL on failure but already set the message manually. /* only place where an error code can be returned directly, because the error message has already been set by the wrapper */ if (foo == NULL) return GIT_ENOMEM; - One secondary method, called `git__rethrow`, which can be used to fine-grain an error message and build an error stack. Example, instead of: if ((error = foobar(baz)) < GIT_SUCCESS) return error; You can now do: if ((error = foobar(baz)) < GIT_SUCCESS) return git__rethrow(error, "Failed to do a major operation"); The return of the `git_lasterror` method will be a string in the shape of: "Failed to do a major operation. (Failed to do an internal operation)" E.g. "Failed to open the index. (Not enough permissions to access '/path/to/index')." NOTE: do not abuse this method. Try to write all `git__throw` messages in a descriptive manner, to avoid having to rethrow them to clarify their meaning. This method should only be used in the places where the original error message set by a subroutine is not specific enough. It is encouraged to continue using this style as much possible to enforce error propagation: if ((error = foobar(baz)) < GIT_SUCCESS) return error; /* `foobar` has set an error message, and we are just propagating it */ The error handling revamp will take place in two phases: - Phase 1: Replace all pieces of code that return direct error codes with calls to `git__throw`. This can be done semi-automatically using `ack` to locate all the error codes that must be replaced. - Phase 2: Add some `git__rethrow` calls in those cases where the original error messages are not specific enough. Phase 1 is the main goal. A minor libgit2 release will be shipped once Phase 1 is ready, and the work will start on gradually improving the error handling mechanism by refining specific error messages. OTHER NOTES: - When writing error messages, please refrain from using weasel words. They add verbosity to the message without giving any real information. (<3 Emeric) E.g. "The reference file appears to be missing a carriage return" Nope. "The reference file is missing a carriage return" Yes. - When calling `git__throw`, please try to use more generic error codes so we can eventually reduce the list of error codes to something more reasonable. Feel free to add new, more generic error codes if these are going to replace several of the old ones. E.g. return GIT_EREFCORRUPTED; Can be turned into: return git__throw(GIT_EOBJCORRUPTED, "The reference is corrupted");
* errors: Update external API with new `git_lasterror`Vicent Marti2011-05-091-0/+3
|
* Properly check `strtol` for errorsVicent Marti2011-04-091-0/+6
| | | | | We are now using a custom `strtol` implementation to make sure we're not missing any overflow errors.
* Match the comment with the error stringCarlos Martín Nieto2011-03-291-1/+1
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>