1. 03 Mar, 2011 13 commits
  2. 02 Mar, 2011 1 commit
  3. 01 Mar, 2011 1 commit
  4. 24 Feb, 2011 4 commits
  5. 22 Feb, 2011 3 commits
  6. 21 Feb, 2011 2 commits
    • Add --without-sqlite option to waf configure · af774b01
      Disable sqlite support when ./waf configure is run with --without-sqlite
      Olivier Ramonat committed
    • Rewrite all file IO for more performance · 817c2820
      The new `git_filebuf` structure provides atomic high-performance writes
      to disk by using a write cache, and optionally a double-buffered scheme
      through a worker thread (not enabled yet).
      
      Writes can be done 3-layered, like in git.git (user code -> write cache
      -> disk), or 2-layered, by writing directly on the cache. This makes
      index writing considerably faster.
      
      The `git_filebuf` structure contains all the old functionality of
      `git_filelock` for atomic file writes and reads. The `git_filelock`
      structure has been removed.
      
      Additionally, the `git_filebuf` API allows to automatically hash (SHA1)
      all the data as it is written to disk (hashing is done smartly on big
      chunks to improve performance).
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  7. 18 Feb, 2011 3 commits
    • Fix repository initialization · 874c3b6f
      Fixed several issues with path joining and bare repos.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Fix segfault when iterating a revlist backwards · cb77ad0d
      The `prev` and `next` pointers were not being updated after popping one
      of the list elements.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Disable threaded index writing by default · e822508a
      The interlocking on the write threads was not being done properly (index
      entries were sometimes written out of order). With proper interlocking,
      the threaded write is only marginally faster on big index files, and
      slower on the smaller ones because of the overhead when creating
      threads.
      
      The threaded index writing has been temporarily disabled; after more
      accurate benchmarks, if might be possible to enable it again only when
      writing very large index files (> 1000 entries).
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  8. 17 Feb, 2011 3 commits
    • Fix refcounting initialization · 3ecc8b5e
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Fix type truncation in index entries · 084c1935
      64-bit types stored in memory have to be truncated into 32 bits when
      writing to disk. Was causing warnings in MSVC.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Improve the performance when writing Index files · 348c7335
      In response to issue #60 (git_index_write really slow), the write_index
      function has been rewritten to improve its performance -- it should now
      be in par with the performance of git.git.
      
      On top of that, if Posix Threads are available when compiling libgit2, a
      new threaded writing system will be used (3 separate threads take care
      of solving byte-endianness, hashing the contents of the index and
      writing to disk, respectively). For very long Index files, this method
      is up to 3x times faster than git.git.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  9. 14 Feb, 2011 1 commit
  10. 09 Feb, 2011 3 commits
    • Internal changes on the backend system · d4b5a4e2
      The priority value for different backends has been removed from the
      public `git_odb_backend` struct. We handle that internally. The priority
      value is specified on the `git_odb_add_alternate`.
      
      This is convenient because it allows us to poll a backend twice with
      different priorities without having to instantiate it twice.
      
      We also differentiate between main backends and alternates; alternates have
      lower priority and cannot be written to.
      
      These changes come with some unit tests to make sure that the backend
      sorting is consistent.
      
      The libgit2 version has been bumped to 0.4.0.
      
      This commit changes the external API:
      
      CHANGED:
      	struct git_odb_backend
      		No longer has a `priority` attribute; priority for the backend
      		in managed internally by the library.
      
      	git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int priority)
      		Now takes an additional priority parameter, the priority that
      		will be given to the backend.
      
      ADDED:
      	git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority)
      		Add a backend as an alternate. Alternate backends have always
      		lower priority than main backends, and writing is disabled on
      		them.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Honor alternate entries in the ODB · 5a800efc
      The alternates file is now parsed, and the alternate ODB folders are
      added as separate backends. This allows the library to efficiently query
      the alternate folders.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Use the new git__joinpath to build paths in methods · 995f9c34
      The `git__joinpath` function has been changed to use a statically
      allocated buffer; we assume the buffer to be 4096 bytes, because fuck
      you.
      
      The new method also supports an arbritrary number of paths to join,
      which may come in handy in the future.
      
      Some methods which were manually joining paths with `strcpy` now use the
      new function, namely those in `index.c` and `refs.c`.
      
      Based on Emeric Fermas' original patch, which was using the old
      `git__joinpath` because I'm stupid. Thanks!
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  11. 08 Feb, 2011 2 commits
  12. 07 Feb, 2011 4 commits
    • Fix SQLite support for CMake users. · 911fd457
      FindPkgConfig obviously uses pkg-config's output for setting convenient
      variables such as <PREFIX>_LIBRARIES or <PREFIX>_INCLUDE_DIRS. It also
      sets <PREFIX>_FOUND to 1 if <PREFIX> module exists.
      
      So why checking for SQLITE3_FOUND is better than (SQLITE3_LIBRARIES AND
      SQLITE3_INCLUDE_DIRS)? Apart from obvious readability factor, latter
      condition has strong assumption that both variables are filled with
      appropriate paths, which is unjustifiable unless you add another
      assumptions...
      
      pkg-config by default strips -I/usr/include from Cflags and -L/usr/lib
      from Libs if some environment variables are not set,
      PKG_CONFIG_ALLOW_SYSTEM_CFLAGS and PKG_CONFIG_ALLOW_SYSTEM_LIBS
      respectively. This behavior is sane, because it prevents polluting the
      compilation and linking commands with superfluous entries.
      
      In debian SQLITE3_INCLUDE_DIRS is empty for instance.
      
      Remark for developers:
      Always check commands invoked by CMake after changing CMakeLists.txt.
      
          VERBOSE=1 cmake --build .
      Przemyslaw Pawelczyk committed
    • Added tests exercising git_reference_write() to create a new symbolic reference… · 1b7124f8
      Added tests exercising git_reference_write() to create a new symbolic reference and a new object id reference.
      nulltoken committed
    • Git trees are now always lazily sorted · 122c3405
      Removed `git_tree_add_entry_unsorted`. Now the `git_tree_add_entry`
      method doesn't sort the entries array by default; entries are only
      sorted lazily when required. This is done automatically by the library
      (the `git_tree_sort_entries` call has been removed).
      
      This should improve performance. No point on sorting entries all the time, anyway.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Fix detection of working dir on repositories · 8212e2d7
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed