1. 03 Mar, 2011 1 commit
  2. 22 Feb, 2011 2 commits
  3. 17 Feb, 2011 1 commit
    • 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
  4. 09 Feb, 2011 2 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
    • 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
  5. 07 Feb, 2011 1 commit
  6. 06 Feb, 2011 1 commit
  7. 05 Feb, 2011 7 commits
  8. 02 Feb, 2011 2 commits
  9. 30 Jan, 2011 1 commit
    • Refactor reference parsing code · 2f8a8ab2
      Several changes have been committed to allow the user to create
      in-memory references and write back to disk. Peeling of symbolic
      references has been made explicit. Added getter and setter methods for
      all attributes on a reference. Added corresponding documentation.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  10. 29 Jan, 2011 5 commits
    • Merge nulltoken's reference parsing code · 9282e921
      All the commits have been squashed into a single one before refactoring
      the final code, to keep everything tidy.
      
      Individual commit messages are as follows:
      
      Added repository reference looking up functionality placeholder.
      
      Added basic reference database definition and caching infrastructure.
      
      Removed useless constant.
      
      Added GIT_EINVALIDREFNAME error and description. Added missing description for GIT_EBAREINDEX.
      
      Added GIT_EREFCORRUPTED error and description.
      
      Added GIT_ETOONESTEDSYMREF error and description.
      
      Added resolving of direct and symbolic references.
      
      Prepared the packed-refs parsing.
      
      Added parsing of the packed-refs file content.
      
      When no loose reference has been found, the full content of the packed-refs file is parsed. All of the new (i.e. not previously parsed as a loose reference) references are eagerly stored in the cached references storage.
      
      The method packed_reference_file__parse() is in deer need of some refactoring. :-)
      
      Extracted to a method the parsing of the peeled target of a tag.
      
      Extracted to a method the parsing of a standard packed ref.
      
      Fixed leaky removal of the cached references.
      
      Ensured that a previously parsed packed reference isn't returned if a more up-to-date loose reference exists.
      
      Enhanced documentation of git_repository_reference_lookup().
      
      Moved some refs related constants from repository.c to refs.h.
      
      Made parsing of a packed tag reference more robust.
      
      Updated git_repository_reference_lookup() documentation.
      
      Added some references to the test repository.
      
      Added some tests covering tag references looking up.
      
      Added some tests covering symbolic and head references looking up.
      
      Added some tests covering packed references looking up.
      nulltoken committed
    • Return the created entry in git_tree_add_entry() · b29e8f19
      Yes, we are breaking the API. Alpha software, deal with it.
      
      We need a way of getting a pointer to each newly added entry to the
      index, because manually looking up the entry after creation is
      outrageously expensive.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  11. 20 Jan, 2011 2 commits
  12. 11 Jan, 2011 1 commit
    • Added git_prettify_dir_path(). · 170d3f2f
      Clean up a provided absolute or relative directory path.
      
      This prettification relies on basic operations such as coalescing multiple forward slashes into a single slash, removing '.' and './' current directory segments, and removing parent directory whenever '..' is encountered. If not empty, the returned path ends with a forward slash.
      
      For instance, this will turn "d1/s1///s2/..//../s3" into "d1/s3/".
      
      This only performs a string based analysis of the path. No checks are done to make sure the path actually makes sense from the file system perspective.
      nulltoken committed
  13. 08 Jan, 2011 1 commit
  14. 22 Dec, 2010 1 commit
    • Remove git_errno · 9f54fe48
      It was not being used by any methods (only by malloc and calloc), and
      since it needs to be TLS, it cannot be exported on DLLs on Windows.
      
      Burn it with fire. The API always returns error codes!
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  15. 18 Dec, 2010 1 commit
  16. 11 Dec, 2010 4 commits
  17. 10 Dec, 2010 2 commits
  18. 06 Dec, 2010 2 commits
  19. 05 Dec, 2010 2 commits
  20. 02 Dec, 2010 1 commit