summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* indexer: avoid memory movescmn/indexer-vector-handlingCarlos Martín Nieto2014-05-081-8/+15
| | | | | | | | | | Our vector does a move of the rest of the array when we remove an item. Doing this repeatedly can be expensive, and we do this a lot in the indexer. Instead, set the value to NULL and skip those entries. perf reported around 30% of `index-pack` time was going into memmove. With this change, that goes away and we spent most of the time hashing and inflating data.
* Merge pull request #2329 from anuraggup/fix_git_shutdownRussell Belfer2014-05-062-4/+8
|\ | | | | Fix the issues in git_shutdown
| * Fix the issues in git_shutdownAnurag Gupta2014-05-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Call to git_shutdown results in setting git__n_shutdown_callbacks to -1. Next call to git__on_shutdown results in ABW (Array Bound Write) for array git__shutdown_callbacks. In the current Implementation, git_atomic_dec is called git__n_shutdown_callbacks + 1 times. I have modified it to a for loop so that it is more readable. It would not set git__n_shutdown_callbacks to a negative number and reset the elements of git__shutdown_callbacks to NULL. 2) In function git_sysdir_get, shutdown function is registered only if git_sysdir__dirs_shutdown_set is set to 0. However, after this variable is set to 1, it is never reset to 0. If git_sysdir_global_init is called again from synchronized_threads_init it does not register shutdown function for this subsystem.
| * Fix the issues in git__on_shutdownAnurag Gupta2014-05-062-5/+9
| |
* | Merge pull request #2324 from libgit2/cmn/file-in-objects-dirRussell Belfer2014-05-062-0/+28
|\ \ | | | | | | odb: ignore files in the objects dir
| * | odb: ignore files in the objects dircmn/file-in-objects-dirCarlos Martín Nieto2014-05-052-0/+28
| |/ | | | | | | | | | | | | | | We assume that everything under GIT_DIR/objects/ is a directory. This is not necessarily the case if some process left a stray file in there. Check beforehand if we do have a directory and ignore the entry otherwise.
* | object: fix a braceCarlos Martín Nieto2014-05-061-1/+1
|/ | | | | | The brace in the check for peel's return was surrounding the wrong thing, which made 'error' be set to 1 when there was an error instead of the error code.
* Doc fixesRussell Belfer2014-05-022-2/+7
|
* Merge pull request #2308 from libgit2/rb/diff-update-index-stat-cacheVicent Marti2014-05-0253-472/+655
|\ | | | | Reduce excessive OID calculation for diff and stat
| * Some further sandboxing cleanups to testsRussell Belfer2014-05-025-40/+13
| | | | | | | | | | Trying to find other issues where tests may not clean up quite properly when they are through...
| * Improve handling of fake home directoryRussell Belfer2014-05-027-42/+77
| | | | | | | | | | | | | | | | | | | | There are a few tests that set up a fake home directory and a fake GLOBAL search path so that we can test things in global ignore or attribute or config files. This cleans up that code to work more robustly even if there is a test failure. This also fixes some valgrind warnings where scanning search paths for separators could end up doing a little bit of sketchy data access when coming to the end of search list.
| * Fix remaining init_options inconsistenciesRussell Belfer2014-05-0219-131/+74
| | | | | | | | | | There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
| * Make init_options fns use unsigned ints and macroRussell Belfer2014-05-0214-137/+100
| | | | | | | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
| * Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-0216-251/+220
| |
| * Get rid of redundant git_diff_options_init fnRussell Belfer2014-05-024-33/+2
| | | | | | | | Since git_diff_init_options was introduced, remove this old fn.
| * Add payloads, bitmaps to trace APIRussell Belfer2014-05-0210-104/+122
| | | | | | | | | | | | | | | | | | This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
| * Don't use trace if GIT_TRACE not definedRussell Belfer2014-05-022-0/+14
| |
| * Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-05-0210-68/+171
| | | | | | | | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
| * Add diff option to update index stat cacheRussell Belfer2014-05-025-6/+128
| | | | | | | | | | | | | | | | | | | | When diff is scanning the working directory, if it finds a file where it is not sure if the index entry matches the working dir, it will recalculate the OID (which is pretty expensive). This adds a new flag to diff so that if the OID calculation finds that the file actually has not changed (i.e. just the modified time was altered or such), then it will refresh the stat cache in the index so that future calls to diff will not have to check the oid again.
| * Lay groundwork for updating stat cache in diffRussell Belfer2014-05-025-22/+37
| | | | | | | | | | | | | | | | | | | | | | This reorganized the diff OID calculation to make it easier to correctly update the stat cache during a diff once the flags to do so are enabled. This includes marking the path of a git_index_entry as const so we can make a "fake" git_index_entry with a "const char *" path and not get warnings. I was a little surprised at how unobtrusive this change was, but I think it's probably a good thing.
| * Skip diff oid calc when size definitely changedRussell Belfer2014-05-024-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
| * Add build option for diff internal statisticsRussell Belfer2014-05-0210-48/+96
| |
* | Merge pull request #2310 from libgit2/cmn/commit-create-safeRussell Belfer2014-05-024-23/+94
|\ \ | |/ |/| commit: safer commit creation with reference update
| * commit: safer commit creation with reference updatecmn/commit-create-safeCarlos Martín Nieto2014-04-304-23/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version of the commit creation and amend function are unsafe to use when passing the update_ref parameter, as they do not check that the reference at the moment of update points to what the user expects. Make sure that we're moving history forward when we ask the library to update the reference for us by checking that the first parent of the new commit is the current value of the reference. We also make sure that the ref we're updating hasn't moved between the read and the write. Similarly, when amending a commit, make sure that the current tip of the branch is the commit we're amending.
* | Temporary fix for Travis CI buildsVicent Marti2014-05-021-1/+1
| | | | | | | | | | See https://github.com/libgit2/libgit2/pull/2321#issuecomment-42039673 We may rollback once we found something more reliable
* | Merge pull request #2318 from linquize/sleepVicent Marti2014-05-021-0/+4
|\ \ | | | | | | Make examples/status.c compile on Windows
| * | Make examples/status.c compile on WindowsLinquize2014-05-011-0/+4
| | |
* | | Merge pull request #2320 from libgit2/rb/fix-starstar-againVicent Marti2014-05-022-0/+20
|\ \ \ | |/ / |/| | Make ** pattern eat trailing slash
| * | Make ** pattern eat trailing slashrb/fix-starstar-againRussell Belfer2014-05-012-0/+20
|/ / | | | | | | This allows "foo/**/*.html" to match "foo/file.html"
* | Merge pull request #2304 from jacquesg/solarisVicent Marti2014-05-014-4/+9
|\ \ | | | | | | Solaris!
| * | Check for NULL before passing it to vsnprintfJacques Germishuys2014-04-302-3/+3
| | |
| * | strcasecmp is in <strings.h>Jacques Germishuys2014-04-301-0/+1
| | |
| * | Build regex.c for Solaris. Added required defines for SolarisJacques Germishuys2014-04-301-1/+5
| | |
* | | Merge pull request #2314 from libgit2/cmn/known-libsVicent Marti2014-04-302-12/+12
|\ \ \ | | | | | | | | Assorted CMake fixups
| * | | Don't exclude libssh2 from MinGWcmn/known-libsCarlos Martín Nieto2014-04-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It reportedly works. It does not however work when cross-compiling on Travis, so let's disable it there. This fixes #2311.
| * | | Workaround missing .pc files on FreeBSDTing-Wei Lan2014-04-301-2/+6
| | | | | | | | | | | | | | | | This fixes #2118
| * | | Unquiet CMake outputCarlos Martín Nieto2014-04-301-8/+4
| | | | | | | | | | | | | | | | | | | | The point of this phase is to know what we have and not. Show the user a clear indication of what we have.
* | | | Merge pull request #2315 from jacquesg/qsort-cygwinVicent Marti2014-04-301-1/+1
|\ \ \ \ | | | | | | | | | | cygwin also doesn't have qsort_r
| * | | | cygwin also doesn't have qsort_rJacques Germishuys2014-04-301-1/+1
| | | | |
* | | | | ciscript: don't use an empty string as a numberCarlos Martín Nieto2014-04-301-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | An empty string is not a valid number, and some shells complain. Check instead if $COVERITY is non-empty, which is a common convention and what we're doing anyway.
* | | | refs: document _next_name()Carlos Martín Nieto2014-04-301-0/+11
|/ / / | | | | | | | | | | | | If it's not documented, it doesn't show up in the docs (and we really should document, anyway).
* | | Merge pull request #2309 from jacquesg/midnightbsdVicent Marti2014-04-291-1/+1
|\ \ \ | |_|/ |/| | MidnightBSD may also not have strnlen
| * | MidnightBSD may also not have strnlenJacques Germishuys2014-04-291-1/+1
|/ /
* | Merge pull request #2306 from odcinek/development_cmakeVicent Marti2014-04-281-1/+1
|\ \ | |/ |/| Make the build CMake 2.6 compatible
| * Make the build CMake 2.6 compatibleMarcin Sawicki2014-04-281-1/+1
|/
* Merge pull request #2301 from libgit2/cmn/pack-objects-memoryVicent Marti2014-04-272-1/+2
|\ | | | | Keep the deflate buffer from ballooning up
| * pack-objects: always write out the status in write_one()cmn/pack-objects-memoryCarlos Martín Nieto2014-04-261-0/+1
| | | | | | | | Make sure we set the output parameter to a value.
| * zstream: grow based on used memory rather than allocatedCarlos Martín Nieto2014-04-261-1/+1
|/ | | | | | | | | | | | | | | When deflating data, we might need to grow the buffer. Currently we add a guess on top of the currently-allocated buffer size. When we re-use the buffer, it already has some memory allocated; adding to that means that we always grow the buffer regardless of how much we need to use. Instead, increase on top of the currently-used size. This still leaves us with the allocated size of the largest object we compress, but it's a minor pain compared to unbounded growth. This fixes #2285.
* refdb: fix typo and wordingCarlos Martín Nieto2014-04-261-1/+1
|
* Merge pull request #2299 from mekishizufu/fix_leaksVicent Marti2014-04-252-8/+6
|\ | | | | Plug some leaks