src


Log

Author Commit Date CI Message
Carlos Martín Nieto a02fc2cd 2011-05-24T15:24:45 index: correctly parse invalidated TREE extensions A TREE extension with an entry count of -1 means that it was invalidated and we should ignore it. Do so instead of returning an error. This fixes issue #202 Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto cdd9fd47 2011-05-24T14:55:34 Allow read_tree_internal to return an error code There are two reasons why read_tree_internal might return a NULL tree. The first one is a corrupt index, but the second one is an invalidated TREE extension. Up to now, its only way to communicate with its caller was through the return value being NULL or not. Allow read_tree_internal to report its exit status independently from the tree pointer. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti f7e59c4d 2011-06-01T18:34:21 index: Change the memory management for repo indexes The `git_repository_index` call now returns a brand new index that must be manually free'd.
nulltoken 3a1c4310 2011-05-24T18:55:35 Fix compilation warnings in MSVC This allows to successfully build libgit2 with waf on Windows.
Vicent Marti 8146fe7c 2011-05-23T21:41:13 index: Fix unused error messages
Jakob Pfender d320c52d 2011-05-19T15:59:18 index.c: Move to new error handling mechanism
Jakob Pfender ec9edd56 2011-05-19T15:46:36 config_file.c: Move to new error handling mechanism
Jakob Pfender a6d647d2 2011-05-19T15:37:10 win32/pthread.c: Move to new error handling mechanism
Jakob Pfender 7c8b597e 2011-05-19T15:36:09 win32/map.c: Move to new error handling mechanism
Jakob Pfender 450ac186 2011-05-19T15:29:22 unix/map.c: Move to new error handling mechanism
Jakob Pfender 57435a6d 2011-05-19T15:24:24 backends/sqlite.c: Move to new error handling mechanism
Jakob Pfender 43a0bc01 2011-05-19T15:17:06 backends/hiredis.c: Move to new error handling mechanism
Jakob Pfender bc06a4ee 2011-05-19T15:10:54 tree.c: Move to new error handling mechanism
Jakob Pfender 33b1d19e 2011-05-19T15:13:40 util.c: Move to new error handling mechanism
Jakob Pfender 6e34ee61 2011-05-19T15:07:41 tag.c: Move to new error handling mechanism
Jakob Pfender 00556496 2011-05-19T14:59:10 signature.c: Move to new error handling mechanism
Jakob Pfender c0cd9d50 2011-05-19T14:57:41 revwalk.c: Move to new error handling mechanism
Jakob Pfender 4f664a1b 2011-05-19T14:51:16 repository.c: Move to new error handling mechanism
Vicent Marti 0d5d5190 2011-05-23T21:37:48 refs: Reword errors
Jakob Pfender 5bdf7b9f 2011-05-19T14:36:52 refs.c: Move to new error handling mechanism
Jakob Pfender bea54842 2011-05-19T13:50:46 oid.c: Move to new error handling mechanism
Vicent Marti f84d9819 2011-05-23T21:14:58 odb_pack: Reword errors
Jakob Pfender 267d539f 2011-05-19T13:38:12 odb_pack.c: Move to new error handling mechanism
Vicent Marti 60e1b49a 2011-05-23T21:12:18 odb_loose: Reword errors
Jakob Pfender dfb12cd5 2011-05-19T12:28:46 odb_loose.c: Move to new error handling mechanism
Jakob Pfender f93f8ec5 2011-05-19T12:27:43 odb_loose.c: Return GIT_ENOMEM when allocation fails When trying to inflate a buffer, a GIT_ERROR was returned when malloc() failed. Fix this to return GIT_ENOMEM.
Vicent Marti 1e85d1aa 2011-05-23T21:09:07 odb: Reword errors
Jakob Pfender d3d5d86d 2011-05-18T12:35:08 odb.c: Move to new error handling mechanism
Vicent Marti 6623f5c9 2011-05-23T21:05:43 object: Reword errors
Jakob Pfender 75eb97fe 2011-05-18T12:19:48 object.c: Move to new error handling mechanism
Vicent Marti 0be7f000 2011-05-23T21:04:09 hashtable: Reword errors
Jakob Pfender da533495 2011-05-18T12:12:16 hashtable.c: Move to new error handling mechanism
Vicent Marti d3ca89fe 2011-05-23T21:03:01 fileops: Cleanup
Jakob Pfender cc2ac058 2011-05-17T18:02:08 fileops.c: Move to new error handling mechanism
Vicent Marti f6328611 2011-05-23T21:00:19 filebuf: Reword errors
Jakob Pfender 374db5f9 2011-05-17T17:43:00 filebuf.c: Move to new error handling mechanism
Jakob Pfender 68384a27 2011-05-17T17:24:28 config.c: Fix format string error
Jakob Pfender 4152a44b 2011-05-17T17:22:33 delta-apply.c: Move to new error handling mechanism
Jakob Pfender 21dcb75a 2011-05-17T17:21:00 delta-apply.c: Use GIT_ENOMEM instead of GIT_ERROR when allocating git__delta_apply used to return with a generic GIT_ERROR when allocating memory for the delta failed. Fix this to return GIT_ENOMEM.
Vicent Marti 5c36f6db 2011-05-23T20:43:19 config: Cleanup
Vicent Marti 4c7a5e9e 2011-05-23T20:36:06 commit: Reword errors
Jakob Pfender 726c6fd2 2011-05-17T17:00:37 commit.c: Move to new error handling mechanism
Vicent Marti adef9922 2011-05-23T20:33:20 blob: Reword errors
Jakob Pfender 91369100 2011-05-17T16:50:49 blob.c: Move to new error handling mechanism
Vicent Marti b0b527e0 2011-05-20T03:20:12 config: Cleanup & renaming of the external API "git_config_backend" have been renamed to "git_config_file", which implements a generic interface to access a configuration file -- be it either on disk, from a DB or whatever mumbojumbo. I think this makes more sense.
Vicent Marti 8adbf2ed 2011-05-20T02:58:33 Rewrite `git_config_open_global` We have a lot of utility methods that make path building trivial. Use them!
Vicent Martí 274f2c21 2011-05-19T14:18:57 Merge pull request #193 from carlosmn/config A couple of config improvements
Vicent Martí 44d16d6f 2011-05-19T11:21:22 Merge pull request #198 from sschuberth/fix-typos Fix a few minor typos in comments and error messages
Vicent Marti f4e2aca2 2011-05-19T20:38:17 index: Fix issues in the unmerged entries API
Sebastian Schuberth 8133afef 2011-05-19T09:26:01 Fix a few minor typos in comments and error messages Regarding "initialize" vs. "initialise", www.dict.cc says the first is American English whereas the latter in British English. For consistency, we should stick to American English.
Vicent Martí 7b134cfe 2011-05-18T17:04:12 Merge pull request #141 from jpfender/unmerged index: Add API for unmerged entries
Vicent Martí 7d6274ba 2011-05-18T17:00:20 Merge pull request #197 from schu/errors Move odb.c to the new error handling
schu 12de98c1 2011-05-18T18:00:34 Move odb.c to the new error handling Add missing free in git_odb_new(). Signed-off-by: schu <schu-github@schulog.org>
Sebastian Schuberth 765fdf4a 2011-05-18T17:19:38 Use "__inline" instead of "inline" with MSVC MSVC supports "inline" only in C++ code, not in C code.
Sebastian Schuberth 07234716 2011-05-18T16:46:56 Define str(n)casecmp for MSVC MSVC has _str(n)icmp instead.
Carlos Martín Nieto 6421c49a 2011-05-17T18:55:52 Fix variable name normalization When I changed it over to use different strings for the variable and the name, cvar_name_normalize was left behind. Fix this and rename to cvar_normalize_name to reflect the incompatible change. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Jakob Pfender 9d27fd3b 2011-05-17T16:51:37 index.c: Fix typo git__rethrow was missing an underscore.
Jakob Pfender c90bfec7 2011-05-17T16:18:56 Move index.c to new error handling mechanism
Jakob Pfender 050e8877 2011-05-17T15:31:05 Merge branch 'development' into unmerged
Carlos Martín Nieto 32234541 2011-05-17T14:18:42 Implement git_config_open_global Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti 0da2c700 2011-05-17T15:09:30 utils: Move git__str[n]tolower
Vicent Marti 128d3731 2011-05-17T15:05:41 config_file: Fix compilation
Vicent Marti 6adcb5f3 2011-05-17T15:04:18 utils: Implement git__strndup
Vicent Marti b3d94069 2011-05-17T14:51:42 repository: Properly free the index on close
Carlos Martín Nieto 29dca088 2011-05-17T13:38:19 Move config to the new error methods Take this opportunity to fix an instance of returning GIT_EOBJCORRUPTED when malloc failed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 94711cad 2011-05-17T12:12:59 Merge upstream/development
Vicent Marti 335d6c99 2011-05-17T01:46:07 cache: Drop cuckoo hashing Now we use a simple closed-addressing cache. Cuckoo hashing was creating too many issues with race conditions. Fuck that. Let's see what happens performance wise, we may have to roll back or come up with another way to implement an efficient multi-threaded cache.
Vicent Marti 3de79280 2011-05-17T00:51:52 cache: Fix deadlock Do not try to adquire the same node lock twice when the cuckoo hashing resolves to the same node.
Vicent Marti 5ca2f580 2011-05-15T23:48:05 Do not set error message on `GIT_EREVWALKOVER` This is not really an error, just a special return code to mark the end of an iteration.
Vicent Marti 7cadd1f6 2011-05-15T23:46:22 Check error code from `git_cache_init`
Vicent Marti 4edf3e09 2011-05-15T23:45:24 Return success code on `git_cache_init`
Vicent Martí 3fe2e770 2011-05-15T13:34:43 Merge pull request #184 from nulltoken/repo-error-handling Updated fileops.c and repository.c to new error handling mechanism
Shuhei Tanuma 71747bca 2011-05-15T20:07:54 fix git_otype typo when calling `git_odb_read_header`.
nulltoken 81201a4c 2011-05-15T06:57:34 Move cache.c to the new error handling
nulltoken 3abe3bba 2011-05-14T16:05:33 Move repository.c to the new error handling
nulltoken 77c3999c 2011-05-14T14:40:56 Move fileops.c to the new error handling
Vicent Martí f02f4b53 2011-05-13T15:25:19 Merge pull request #183 from schu/errors Replace errors
Vicent Marti 098173c5 2011-05-13T04:17:24 Check Redis replies for NULL
schu b51c9269 2011-05-11T14:44:44 Move revwalk.c to the new error handling Signed-off-by: schu <schu-github@schulog.org>
schu 86f5fa78 2011-05-11T14:00:38 Move vector.c to the new error handling Remove "redundant" check for v->_cmp in wrapper function git_vector_bsearch(). Signed-off-by: schu <schu-github@schulog.org>
schu d6de92b6 2011-05-11T12:40:04 Move tree.c to the new error handling Signed-off-by: schu <schu-github@schulog.org>
schu cbcaf0c0 2011-05-11T12:09:40 Move blob.c to the new error handling Signed-off-by: schu <schu-github@schulog.org>
Vicent Marti 6810bf28 2011-05-11T00:40:07 Move all error-related defines to `git2/errors.h`
Vicent Marti f4a936b5 2011-05-11T00:35:05 Bring back `git_strerror` We cannot totally deprecate this until the new error handling mechanisms are all in place.
Carlos Martín Nieto 44dc0d26 2011-05-10T18:56:44 Move tag.c to the new error handling Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 5de24ec7 2011-05-10T17:38:41 Move signature.c to the new error handling Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto c0335005 2011-05-06T12:42:47 Move config to a backend structure Configuration options can come from different sources. Currently, there is only support for reading them from a flat file, but it might make sense to read it from a database at some point. Move the parsing code into src/config_file.c and create an include file include/git2/config_backend.h to allow for other backends to be developed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Vicent Marti 5711ca93 2011-05-09T21:58:26 Merge branch 'error-handling' into development
Vicent Marti fa59f18d 2011-05-09T20:54:04 Change error handling mechanism once again 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");
Vicent Marti 5eb0fab8 2011-05-05T01:49:27 errors: Update external API with new `git_lasterror`
Vicent Marti 3f53c971 2011-05-05T01:20:27 errors: Set error messages on memory allocation
Vicent Marti 02f9e637 2011-05-05T01:12:17 errors: Add error handling function
Vicent Martí cd2cc2dc 2011-05-08T14:00:57 Merge pull request #170 from jasonrm/development Fix misspelling of git_index_append2 (was git_index_apppend2).
Vicent Martí 5f94b77c 2011-05-08T13:59:47 Merge pull request #174 from carlosmn/backend-static odb backend_sort_cmp should be static
kelly.leahy 16a5c304 2011-05-08T12:32:35 Fix bug in the way pthead_mutex_t was being destroyed in win32. Win32 critical section objects (CRITICAL_SECTION) are not kernel objects. Only kernel objects are destroyed by using CloseHandle. Critical sections are supposed to be deleted with the DeleteCriticalSection API (http://msdn.microsoft.com/en-us/library/ms682552(VS.85).aspx).
Carlos Martín Nieto d8e1d038 2011-05-06T12:47:21 Fix two warnings from Clang Both are about not reading the value stored in a variable. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto 39e1032c 2011-05-06T12:43:37 odb backend_sort_cmp should be static Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto ca8d2dfc 2011-05-05T16:22:06 Merge remote-tracking branch 'upstream/development' into config
Carlos Martín Nieto 094aaaae 2011-05-05T15:16:15 config: store the section name separately The section and variable names use different rules, so store them as two different variables internally. This will simplify the configuration-writing code as well later on, but even with parsing, the code is simpler. Take this opportunity to add a variable to the list directly when parsing instead of passing through config_set.
Jason R. McNeil 773bc20d 2011-05-03T22:22:42 Fix misspelling of git_index_append2 (was git_index_apppend2).