summaryrefslogtreecommitdiff
path: root/src/indexer.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce GITERR_INDEXERCarlos Martín Nieto2012-05-151-5/+5
|
* indexer: close the pack's fd before renaming itCarlos Martín Nieto2012-05-091-1/+2
| | | | Windows gets upset if we rename a file with an open descriptor.
* buf: deploy git_buf_len()nulltoken2012-04-301-2/+2
|
* Fix Win32 warningsRussell Belfer2012-04-261-1/+1
|
* transports: buffer the git requests before sending themCarlos Martín Nieto2012-04-251-1/+1
| | | | | | 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.
* 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-131-36/+310
| | | | | | 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.
* Convert indexer, notes, sha1_lookup, and signatureRussell Belfer2012-03-191-70/+64
| | | | More files moved to new error handling style.
* Continue error conversionRussell Belfer2012-03-141-4/+7
| | | | | | | This converts blob.c, fileops.c, and all of the win32 files. Also, various minor cleanups throughout the code. Plus, in testing the win32 build, I cleaned up a bunch (although not all) of the warnings with the 64-bit build.
* Migrate ODB files to new error handlingRussell Belfer2012-03-121-6/+6
| | | | | | | | | | | | | | This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
* error-handling: RepositoryVicent Martí2012-03-071-3/+6
| | | | | | | | This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
* zlib: Remove custom `git2/zlib.h` headerVicent Martí2012-02-151-1/+2
| | | | | | This is legacy compat stuff for when `deflateBound` is not defined, but we're not embedding zlib and that function is always available. Kill that with fire.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* odb: Add internal `git_odb__hashfd`Vicent Martí2012-02-101-1/+1
|
* indexer: save the pack index with the right nameCarlos Martín Nieto2012-01-191-1/+1
| | | | Truncate at the slash; otherwise we get ppack-*.idx filenames.
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-16/+34
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* Merge pull request #456 from brodie/perm-fixesVicent Martí2011-10-281-1/+1
|\ | | | | Create objects, indexes, and directories with the right file permissions
| * *: correct and codify various file permissionsBrodie Rao2011-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following files now have 0444 permissions: - loose objects - pack indexes - pack files - packs downloaded by fetch - packs downloaded by the HTTP transport And the following files now have 0666 permissions: - config files - repository indexes - reflogs - refs This brings libgit2 more in line with Git. Note that git_filebuf_commit() and git_filebuf_commit_at() have both gained a new mode parameter. The latter change fixes an important issue where filebufs created with GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3) usage). Now we chmod() the file before renaming it into place. Tests have been added to confirm that new commit, tag, and tree objects are created with the right permissions. I don't have access to Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
* | global: Properly use `git__` memory wrappersVicent Marti2011-10-281-5/+5
|/ | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* indexer: NUL-terminate the filenameCarlos Martín Nieto2011-10-051-2/+2
| | | | | | | As we no longer use the STRLEN macro, the NUL-terminator in the string was not copied over. Fix this. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* indexer: return immediately if passed a NULL valueCarlos Martín Nieto2011-10-011-0/+3
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* 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.
* Fix some random size_t vs. int conversion warningsSebastian Schuberth2011-09-081-2/+3
|
* Drop STRLEN() macrosKirill A. Shutemov2011-08-251-4/+4
| | | | | | | There is no need in STRLEN macros. Compilers can do this trivial optimization on its own. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* odb: Do not pass around a header when hashingVicent Marti2011-08-181-3/+2
|
* Assert a filename in indexer creationCarlos Martín Nieto2011-08-181-0/+2
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Implement cooperative cachingCarlos Martín Nieto2011-08-181-3/+35
| | | | | | | | | When indexing a file with ref deltas, a temporary cache for the offsets has to be built, as we don't have an index file yet. If the user takes the responsiblity for filling the cache, the packing code will look there first when it finds a ref delta. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Merge pull request #355 from jdavid/fix-buildVicent Martí2011-08-091-2/+2
|\ | | | | Fix "redefinition of typedef git_indexer" build error
| * Fix "redefinition of typedef git_indexer" build errorJ. David Ibáñez2011-08-051-2/+2
| | | | | | | | Signed-off-by: J. David Ibáñez <jdavid@itaapy.com>
* | Fix compilation in WindowsVicent Marti2011-08-081-3/+5
|/
* Move pack index writing to a public functionCarlos Martín Nieto2011-08-031-7/+1
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Implement the indexerCarlos Martín Nieto2011-08-031-42/+209
| | | | | | Only v2 index files are supported. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Modify the given offset in git_packfile_unpackCarlos Martín Nieto2011-08-021-91/+65
| | | | | | | | The callers immediately throw away the offset, so we don't need any logical changes in any of them. This will be useful for the indexer, as it does need to know where the compressed data ends. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move pack functions to their own fileCarlos Martín Nieto2011-08-021-4/+4
|
* Make packfile_unpack_header more genericCarlos Martín Nieto2011-08-021-20/+9
| | | | | | On the way, store the fd and the size in the mwindow file. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Rename stuff to git_indexer_Carlos Martín Nieto2011-08-021-9/+98
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Start the runnerCarlos Martín Nieto2011-08-021-0/+34
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Intial indexer codeCarlos Martín Nieto2011-08-021-0/+133