1. 30 Sep, 2011 1 commit
  2. 22 Sep, 2011 1 commit
  3. 19 Sep, 2011 1 commit
    • Tabify everything · 87d9869f
      There were quite a few places were spaces were being used instead of
      tabs. Try to catch them all. This should hopefully not break anything.
      Except for `git blame`. Oh well.
      Vicent Marti committed
  4. 18 Sep, 2011 1 commit
    • Cleanup legal data · bb742ede
      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.
      Vicent Marti committed
  5. 08 Sep, 2011 1 commit
  6. 18 Aug, 2011 1 commit
  7. 09 Aug, 2011 1 commit
  8. 09 Jul, 2011 1 commit
  9. 07 Jul, 2011 1 commit
    • vector: Timsort all of the things · de18f276
      Drop the GLibc implementation of Merge Sort and replace it with Timsort.
      
      The algorithm has been tuned to work on arrays of pointers (void **),
      so there's no longer a need to abstract the byte-width of each element
      in the array.
      
      All the comparison callbacks now take pointers-to-elements, not
      pointers-to-pointers, so there's now one less level of dereferencing.
      
      E.g.
      
      	 int index_cmp(const void *a, const void *b)
      	 {
      	-	const git_index_entry *entry_a = *(const git_index_entry **)(a);
      	+	const git_index_entry *entry_a = (const git_index_entry *)(a);
      
      The result is up to a 40% speed-up when sorting vectors. Memory usage
      remains lineal.
      
      A new `bsearch` implementation has been added, whose callback also
      supplies pointer-to-elements, to uniform the Vector API again.
      Vicent Marti committed
  10. 05 Jul, 2011 3 commits
    • util: introduce merge sort routine · c20ffa61
      In some cases it's important to preserve order of elements with equal
      keys (stable sort). qsort(3) doesn't define order of elements with
      equal keys.
      
      git__msort() implements merge sort which is stable sort.
      
      Implementation taken from git. Function renamed git_qsort() -> git__msort().
      
      Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
      Kirill A. Shutemov committed
    • fileops: Cleanup · f79026b4
      Cleaned up the structure of the whole OS-abstraction layer.
      
      fileops.c now contains a set of utility methods for file management used
      by the library. These are abstractions on top of the original POSIX
      calls.
      
      There's a new file called `posix.c` that contains
      emulations/reimplementations of all the POSIX calls the library uses.
      These are prefixed with `p_`. There's a specific posix file for each
      platform (win32 and unix).
      
      All the path-related methods have been moved from `utils.c` to `path.c`
      and have their own prefix.
      Vicent Marti committed
  11. 01 Jul, 2011 1 commit
  12. 26 Jun, 2011 1 commit
    • Add git.git's fnmatch, which is really GNU's and the git__fnmatch wrapper · 63f91e1c
      If the strings match, git__fnmatch returns GIT_SUCCESS and
      GIT_ENOMATCH on failure to match.
      
      MSVC fixes: Added a test for _MSC_VER and (in that case) defined
      HAVE_STRING_H to 1 so it doesn't try to include <strings.h> which
      doesn't exist in the MSVC world. Moved the function declarations to
      use the modern inline ones so MSVC doesn't have a fit. Added casts
      everywhere so MSVC doesn't crap its pants.
      
      Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
      Carlos Martín Nieto committed
  13. 16 Jun, 2011 1 commit
  14. 03 Jun, 2011 1 commit
  15. 24 May, 2011 1 commit
  16. 23 May, 2011 1 commit
  17. 17 May, 2011 1 commit
  18. 09 Apr, 2011 1 commit
  19. 22 Mar, 2011 1 commit
  20. 15 Mar, 2011 1 commit
  21. 05 Mar, 2011 2 commits
  22. 03 Mar, 2011 1 commit
  23. 09 Feb, 2011 1 commit
    • 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
  24. 05 Feb, 2011 3 commits
  25. 29 Dec, 2010 1 commit
    • Add generic hash function to util.c · e0646b38
      It's MurmurHash3 slightly edited to make it
      cross-platform. Fast and neat.
      
      Use this for hashing strings on hash tables instead
      of a full SHA1 hash. It's very fast and well distributed.
      
      Obviously not crypto-secure.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  26. 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
  27. 19 Nov, 2010 1 commit
  28. 12 Aug, 2010 1 commit
  29. 20 Jan, 2010 1 commit
  30. 05 Jun, 2009 1 commit
  31. 18 Mar, 2009 1 commit
    • Fix some (digital-mars) compiler warnings · a9984a4e
      In particular, conditional expressions which contain an
      assignment statement, where the expression type is not
      explicitly made to be boolean, elicits the following
      message:
          warning 2: possible unintended assignment
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  32. 28 Jan, 2009 1 commit
    • Add git__dirname and git__basename utility routines · ced645ea
      These routines are intended to extract the directory and
      base name from a path string. Note that these routines
      do not interact with any filesystem and work only on the
      text of the path.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  33. 01 Jan, 2009 1 commit
  34. 31 Dec, 2008 2 commits
    • Add string utility functions for prefix and suffix compares · 9eb79764
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Wrap malloc and friends and report out of memory as GIT_ENOMEM · 64a47c01
      We now forbid direct use of malloc, strdup or calloc within the
      library and instead use wrapper functions git__malloc, etc. to
      invoke the underlying library malloc and set git_errno to a no
      memory error code if the allocation fails.
      
      In the future once we have pack objects in memory we are likely
      to enhance these routines with garbage collection logic to purge
      cached pack data when allocations fail.  Because the size of the
      function will grow somewhat large, we don't want to mark them for
      inline as gcc tends to aggressively inline, creating larger than
      expected executables.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed