- 06 Dec, 2015 1 commit
-
-
The trees are sorted on-disk, so we don't have to go over them again. This cuts almost a fifth of time spent parsing trees.
Carlos Martín Nieto committed
-
- 02 Dec, 2015 1 commit
-
-
Instead of going out to strtol, which is made to parse generic numbers, copy a parse function from git which is specialised for file modes.
Carlos Martín Nieto committed
-
- 01 Dec, 2015 1 commit
-
-
When duplicating a `struct git_tree_entry` with `git_tree_entry_dup` the resulting structure is not allocated inside a memory pool. As we do a 1:1 copy of the original struct, though, we also copy the `pooled` field, which is set to `true` for pooled entries. This results in a huge memory leak as we never free tree entries that were duplicated from a pooled tree entry. Fix this by marking the newly duplicated entry as un-pooled.
Patrick Steinhardt committed
-
- 30 Nov, 2015 1 commit
-
-
Return an error in case the length is too big. Also take this opportunity to have a single allocating function for the size and overflow logic.
Carlos Martín Nieto committed
-
- 28 Nov, 2015 4 commits
-
-
This reduces the size of the struct from 32 to 26 bytes, and leaves a single padding byte at the end of the struct (which comes from the zero-length array).
Carlos Martín Nieto committed -
We already know the size due to the `memchr()` so use that information instead of calling `strlen()` on it.
Carlos Martín Nieto committed -
These are rather small allocations, so we end up spending a non-trivial amount of time asking the OS for memory. Since these entries are tied to the lifetime of their tree, we can give the tree a pool so we speed up the allocations.
Carlos Martín Nieto committed -
We've already looked at the filename with `memchr()` and then used `strlen()` to allocate the entry. We already know how much we have to advance to get to the object id, so add the filename length instead of looking at each byte again.
Carlos Martín Nieto committed
-
- 17 Mar, 2015 1 commit
-
-
Don't use the full path, as that's not what we are asserting does not exist, but just the subpath we were looking up.
Carlos Martín Nieto committed
-
- 15 Feb, 2015 1 commit
-
-
Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
Stefan Widgren committed
-
- 13 Feb, 2015 3 commits
-
-
Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
Edward Thomson committed -
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 27 Dec, 2014 1 commit
-
-
This function is a constructor, so let's name it like one and leave _create() for the reference functions, which do create/write the reference.
Carlos Martín Nieto committed
-
- 17 Dec, 2014 1 commit
-
-
Path validation may be influenced by `core.protectHFS` and `core.protectNTFS` configuration settings, thus treebuilders can take a repository to influence their configuration.
Edward Thomson committed
-
- 16 Dec, 2014 1 commit
-
-
Vicent Marti committed
-
- 10 Oct, 2014 2 commits
-
-
An obvious place to fill the tree cache is on write-tree, as we're guaranteed to be able to fill in the whole tree cache. The way this commit does this is not the most efficient, as we read the root tree from the odb instead of filling in the cache as we go along, but it fills the cache such that successive operations (and persisting the index to disk) will be able to take advantage of the cache, and it reuses the code we already have for filling the cache. Filling in the cache as we create the trees would require some reallocation of the children vector, which is currently not possible with out pool implementation. A different data structure would likely allow us to perform this operation at a later date.
Carlos Martín Nieto committed -
Keeping the cache around after read-tree is only one part of the optimisation opportunities. In order to share the cache between program instances, we need to write the TREE extension to the index. Do so, taking the opportunity to rename 'entries' to 'entry_count' to match the name given in the format description. The included test is rather trivial, but works as a sanity check.
Carlos Martín Nieto committed
-
- 25 Jun, 2014 1 commit
-
-
As reported by coverity, we would leak some memory in error conditions.
Carlos Martín Nieto committed
-
- 10 Jun, 2014 3 commits
-
-
We can simply ask the hasmap.
Carlos Martín Nieto committed -
If the user wants to keep a copy for themselves, they should make a copy. It adds unnecessary complexity to make sure the returned entries are valid until the builder is cleared.
Carlos Martín Nieto committed -
Finding a filename in a vector means we need to resort it every time we want to read from it, which includes every time we want to write to it as well, as we want to find duplicate keys. A hash-map fits what we want to do much more accurately, as we do not care about sorting, but just the particular filename. We still keep removed entries around, as the interface let you assume they were going to be around until the treebuilder is cleared or freed, but in this case that involves an append to a vector in the filter case, which can now fail. The only time we care about sorting is when we write out the tree, so let's make that the only time we do any sorting.
Carlos Martín Nieto committed
-
- 09 Jun, 2014 1 commit
-
-
By inserting in the right position, we can keep the vector sorted, making entry insertion almost twice as fast.
Carlos Martín Nieto committed
-
- 04 Feb, 2014 1 commit
-
-
This updates the git_pqueue to simply be a set of specialized init/insert/pop functions on a git_vector. To preserve the pqueue feature of having a fixed size heap, I converted the "sorted" field in git_vectors to a more general "flags" field so that pqueue could mix in it's own flag. This had a bunch of ramifications because a number of places were directly looking at the vector "sorted" field - I added a couple new git_vector helpers (is_sorted, set_sorted) so the specific representation of this information could be abstracted.
Russell Belfer committed
-
- 25 Jan, 2014 2 commits
-
-
Rename git_tree_entry_byoid() to _byid() as per the convention.
Carlos Martín Nieto committed -
This was not converted when we converted the rest, so do it now.
Carlos Martín Nieto committed
-
- 14 Jan, 2014 1 commit
-
-
Arthur Schreiber committed
-
- 11 Dec, 2013 3 commits
-
-
Russell Belfer committed
-
This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
Russell Belfer committed -
This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
Russell Belfer committed
-
- 08 Oct, 2013 1 commit
-
-
When a tool needs to recreate the tree object (for example an interface to another VCS), it needs to use the raw attributes, forgoing any normalization.
Carlos Martín Nieto committed
-
- 13 Sep, 2013 2 commits
- 05 Sep, 2013 2 commits
-
-
Russell Belfer committed
-
This adds some more macros for some standard operations on file modes, particularly related to permissions, and then updates a number of places around the code base to use the new macros.
Russell Belfer committed
-
- 10 Jun, 2013 1 commit
-
-
This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
Russell Belfer committed
-
- 16 May, 2013 1 commit
-
-
This adds an example implementation that emulates git cat-file. It is a convenient and relatively simple example of getting data out of a repository. Implementing this also revealed that there are a number of APIs that are still not using const pointers to objects that really ought to be. The main cause of this is that `git_vector_bsearch` may need to call `git_vector_sort` before doing the search, so a const pointer to the vector is not allowed. However, for tree objects, with a little care, we can ensure that the vector of tree entries is always sorted and allow lookups to take a const pointer. Also, the missing const in commit objects just looks like an oversight.
Russell Belfer committed
-
- 01 May, 2013 1 commit
-
-
Russell Belfer committed
-
- 30 Apr, 2013 2 commits
-
-
Vicent Marti committed
-
Removed useless prototype and renamed object typecast functions declaration macro.
Russell Belfer committed
-