summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | refs: fix unused-but-set warningMichael Schubert2012-04-271-0/+1
| | |
| * | Fix Win32 warningsRussell Belfer2012-04-266-18/+20
| | |
| * | Fix leading slash behavior in attrs/ignoresRussell Belfer2012-04-264-31/+69
| |/ | | | | | | | | | | We were not following the git behavior for leading slashes in path names when matching git ignores and git attribute file patterns. This should fix issue #638.
| * diff: fix generation of the header of a removal patchnulltoken2012-04-253-8/+18
| |
| * Merge pull request #642 from arrbee/mem-poolsRussell Belfer2012-04-2532-733/+1546
| |\ | | | | | | Memory pools and khash hashtables
| | * Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-2515-603/+171
| | | | | | | | | | | | | | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
| | * Convert hashtable usage over to khashRussell Belfer2012-04-2513-202/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates khash.h with some extra features (like error checking on allocations, ability to use wrapped malloc, foreach calls, etc), creates two high-level wrappers around khash: `git_khash_str` and `git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables, then converts all of the old usage of `git_hashtable` over to use these new hashtables. For `git_khash_str`, I've tried to create a set of macros that yield an API not too unlike the old `git_hashtable` API. Since the oid hashtable is only used in one file, I haven't bother to set up all those macros and just use the khash APIs directly for now.
| | * Import khash.h from attractivechaos/klibRussell Belfer2012-04-251-0/+548
| | |
| | * Adding stash to hashtable implementationRussell Belfer2012-04-252-44/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a small stash of nodes with key conflicts has been demonstrated to greatly increase the efficiency of a cuckoo hashtable. See: http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf for more details.
| | * Moving power-of-two bit utilities into util.hRussell Belfer2012-04-252-9/+19
| | |
| | * Convert revwalk to use git_poolRussell Belfer2012-04-253-58/+27
| | | | | | | | | | | | | | | This removes the custom paged allocator from revwalk and replaces it with a `git_pool`.
| | * Convert attrs and diffs to use string poolsRussell Belfer2012-04-259-135/+197
| | | | | | | | | | | | | | | | | | | | | This converts the git attr related code (including ignores) and the git diff related code (and implicitly the status code) to use `git_pools` for storing strings. This reduces the number of small blocks allocated dramatically.
| | * Implement git_pool paged memory allocatorRussell Belfer2012-04-2512-17/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a `git_pool` object that can do simple paged memory allocation with free for the entire pool at once. Using this, you can replace many small allocations with large blocks that can then cheaply be doled out in small pieces. This is best used when you plan to free the small blocks all at once - for example, if they represent the parsed state from a file or data stream that are either all kept or all discarded. There are two real patterns of usage for `git_pools`: either for "string" allocation, where the item size is a single byte and you end up just packing the allocations in together, or for "fixed size" allocation where you are allocating a large object (e.g. a `git_oid`) and you generally just allocation single objects that can be tightly packed. Of course, you can use it for other things, but those two cases are the easiest.
| * | Merge pull request #641 from carlosmn/networkingVicent Martí2012-04-2510-255/+163
| |\ \ | | |/ | |/| More Networking updates
| | * remote: run a callback when updating the branch tipsCarlos Martín Nieto2012-04-251-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | This allows the caller to update an internal structure or update the user output with the tips that were updated. While in the area, only try to update the ref if the value is different from its old one.
| | * revwalk: return GIT_EREVWALKER earlier if no references were pushedCarlos Martín Nieto2012-04-251-0/+7
| | | | | | | | | | | | | | | In the case that walk->one is NULL, we know that we have no positive references, so we already know that the revwalk is over.
| | * transports: buffer the git requests before sending themCarlos Martín Nieto2012-04-258-167/+69
| | | | | | | | | | | | | | | | | | Trying to send every single line immediately won't give us any speed improvement and duplicates the code we need for other transports. Make the git transport use the same buffer functions as HTTP.
| | * fetch: use the streaming indexer when downloading a packCarlos Martín Nieto2012-04-256-86/+65
| | | | | | | | | | | | | | | | | | | | | | | | This changes the git_remote_download() API, but the existing one is silly, so you don't get to complain. The new API allows to know how much data has been downloaded, how many objects we expect in total and how many we've processed.
| * | config: also allow escaping outside of a quoted stringCarlos Martín Nieto2012-04-251-6/+0
| |/ | | | | | | This limitation was a misparsing of the documentation.
| * Merge pull request #632 from arrbee/win64-cleanupVicent Martí2012-04-2334-707/+390
| |\ | | | | | | Code clean up, including fixing warnings on Windows 64-bit build
| | * Rename to git_reference_name_to_oidRussell Belfer2012-04-234-4/+4
| | |
| | * Fix warnings on 64-bit windows buildsRussell Belfer2012-04-1731-219/+258
| | | | | | | | | | | | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
| | * Add git_reference_lookup_oid and lookup_resolvedRussell Belfer2012-04-176-121/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new public reference function `git_reference_lookup_oid` that directly resolved a reference name to an OID without returning the intermediate `git_reference` object (hence, no free needed). Internally, this adds a `git_reference_lookup_resolved` function that combines looking up and resolving a reference. This allows us to be more efficient with memory reallocation. The existing `git_reference_lookup` and `git_reference_resolve` are reimplmented on top of the new utility and a few places in the code are changed to use one of the two new functions.
| | * Remove old status implementationRussell Belfer2012-04-171-367/+1
| | | | | | | | | | | | This removes the code for the old status implementation.
| * | Merge pull request #637 from nulltoken/issue/odb-refcountVicent Martí2012-04-231-0/+1
| |\ \ | | | | | | | | Fix git_repository_set_odb() refcount issue
| | * | Fix git_repository_set_odb() refcount issuenulltoken2012-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | git_repository_free() calls git_odb_free() if the owned odb is not null. According to the doc, when setting a new odb through git_repository_set_odb() the caller has to take care of releasing the odb by himself.
| * | | tree-cache: don't error out on a childless invalidated entryCarlos Martín Nieto2012-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used to assume that there had to be data after the newline in a tree cache extension entry. This isn't true for a childless invalidated entry if it's the last one, as there won't be any children nor a hash to take up space. Adapt the off-by-one comparison to also work in this case. Fixes #633.
| * | | Merge remote-tracking branch 'carlosmn/indexer-stream' into new-error-handlingVicent Martí2012-04-196-52/+567
| |\ \ \
| | * | | indexer: add git_indexer_stream_free() and _hash()Carlos Martín Nieto2012-04-131-0/+29
| | | | |
| | * | | indexer: Add git_indexer_stream_finalize()Carlos Martín Nieto2012-04-131-71/+235
| | | | | | | | | | | | | | | | | | | | | | | | | Resolve any lingering deltas, write out the index file and rename the packfile.
| | * | | indexer: start writing the stream indexerCarlos Martín Nieto2012-04-132-37/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to index a packfile as soon as we receive it from the network as well as storing it with its final name so we don't need to pass temporary file names around.
| | * | | Add packfile_unpack_compressed() to the internal headerCarlos Martín Nieto2012-04-131-0/+7
| | | | |
| | * | | pack: signal a short buffer when neededCarlos Martín Nieto2012-04-131-11/+38
| | | | |
| | * | | filebuf: add option not to buffer the contents at allCarlos Martín Nieto2012-04-132-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The new indexer needs to be able to bypass any kind of buffering, as it's trying to map data that it has just written to disk.
| * | | | Merge pull request #629 from nulltoken/issue/index-refcountVicent Martí2012-04-181-0/+1
| |\ \ \ \ | | | |/ / | | |/| / | | |_|/ | |/| | Index refcount issue
| | * | Fix git_repository_set_index() refcount issuenulltoken2012-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_repository_free() calls git_index_free() if the owned index is not null. According to the doc, when setting a new index through git_repository_set_index() the caller has still to take care of releasing the index by itself. In order to cope with this, this fix makes sure the index refcount is incremented when a new repository is being plugged a new index.
| * | | config: parse quoted valuesCarlos Martín Nieto2012-04-161-21/+85
| | | | | | | | | | | | | | | | | | | | Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
| * | | repo: plug a couple of leaksCarlos Martín Nieto2012-04-141-0/+3
| |/ /
| * | Add support for pathspec to diff and statusRussell Belfer2012-04-136-5/+128
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Merge remote-tracking branch 'carlosmn/revwalk-merge-base' into ↵Vicent Martí2012-04-131-118/+318
| |\ \ | | | | | | | | | | | | new-error-handling
| | * | error-handling: revwalkCarlos Martín Nieto2012-04-121-100/+104
| | | |
| | * | Move git_merge_base() to is own header and document itCarlos Martín Nieto2012-04-121-0/+1
| | | |
| | * | revwalk: use a priority queue for calculating merge basesCarlos Martín Nieto2012-04-121-37/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As parents are older than their children, we're appending to the commit list most of the time, which makes an ordered linked list quite inefficient. While we're there, don't sort the results list in the main loop, as we're sorting them afterwards and it creates extra work.
| | * | revwalk: use merge bases to speed up processingCarlos Martín Nieto2012-04-121-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need walk down the parents of a merge base to mark them as uninteresting because we'll never see them. Calculate the merge bases in prepare_walk() so mark_uninteresting() can stop at a merge base instead of walking all the way to the root.
| | * | Implement git_merge_base()Carlos Martín Nieto2012-04-121-9/+167
| | | | | | | | | | | | | | | | | | | | | | | | It's implemented in revwalk.c so it has access to the revision walker's commit cache and related functions. The algorithm is the one used by git, modified so it fits better with the library's functions.
| | * | revwalk: allow pushing/hiding a reference by nameCarlos Martín Nieto2012-04-121-38/+33
| | | | | | | | | | | | | | | | | | | | | | | | The code was already there, so factor it out and let users push an OID by giving it a reference name. Only refs to commits are supported. Annotated tags will throw an error.
| | * | revwalk: don't assume malloc succeedsCarlos Martín Nieto2012-04-121-3/+9
| | | |
| * | | Merge pull request #623 from arrbee/refactor-openVicent Martí2012-04-136-323/+301
| |\ \ \ | | |_|/ | |/| | Update git_repository_open
| | * | Refactor git_repository_open with new optionsRussell Belfer2012-04-116-323/+301
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new command `git_repository_open_ext` with extended options that control how searching for a repository will be done. The existing `git_repository_open` and `git_repository_discover` are reimplemented on top of it. We may want to change the default behavior of `git_repository_open` but this commit does not do that. Improve support for "gitdir" files where the work dir is separate from the repo and support for the "separate-git-dir" config. Also, add support for opening repos created with `git-new-workdir` script (although I have only confirmed that they can be opened, not that all functions work correctly). There are also a few minor changes that came up: - Fix `git_path_prettify` to allow in-place prettifying. - Fix `git_path_root` to support backslashes on Win32. This fix should help many repo open/discover scenarios - it is the one function called when opening before prettifying the path. - Tweak `git_config_get_string` to set the "out" pointer to NULL if the config value is not found. Allows some other cleanup. - Fix a couple places that should have been calling `git_repository_config__weakptr` and were not. - Fix `cl_git_sandbox_init` clar helper to support bare repos.
| * | branch: simplify error handling for git_branch_move()Carlos Martín Nieto2012-04-121-18/+10
| | | | | | | | | | | | | | | The cleanup needs to happen anyway, so set the error code and jump there instead of copying the code.