1. 12 Aug, 2010 1 commit
  2. 06 Aug, 2010 2 commits
    • Refactor parsing methods · 364788e1
      The 'parse_oid' and 'parse_person' methods which were used by the commit
      parser are now global so they can be used when parsing other objects.
      
      The 'git_commit_person' struct has been changed to a generic
      'git_person'.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Add packfile reading · 7e4f56a5
      Packed objects inside packfiles are now properly unpacked when calling
      the git_odb__read_packed() method; delta'ed objects are also properly
      generated when needed.
      
      A new unit test 0204-readpack tries to read a couple hundred packed
      objects from a standard packed repository.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  3. 15 Jul, 2010 6 commits
    • Add parsing of tree file contents. · d8603ed9
      The basic information (pointed trees and blobs) of each tree object in a
      revision pool can now be parsed and queried.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Changed test files to use tabs instead of spaces · 3e590fb2
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Add external API to access detailed commit attributes · 52f2390b
      The following new external methods have been added:
      
      GIT_EXTERN(const char *) git_commit_message_short(git_commit *commit);
      GIT_EXTERN(const char *) git_commit_message(git_commit *commit);
      GIT_EXTERN(time_t) git_commit_time(git_commit *commit);
      GIT_EXTERN(const git_commit_person *) git_commit_committer(git_commit *commit);
      GIT_EXTERN(const git_commit_person *) git_commit_author(git_commit *commit);
      GIT_EXTERN(const git_tree *) git_commit_tree(git_commit *commit);
      
      A new structure, git_commit_person has been added to represent a
      commit's author or committer.
      
      The parsing of a commit has been split in two phases.
      When adding a commit to the revision pool:
      	- the commit's ODB object is opened
      	- its raw contents are parsed for commit TIME, PARENTS and TREE
      		(the minimal amount of data required to traverse the pool)
      	- the commit's ODB object is closed
      
      When querying for extended information on a commit:
      	- the commit's ODB object is reopened
      	- its raw contents are parsed for the requested information
      	- the commit's ODB object remains open to handle additional queries
      
      New unit tests have been added for the new functionality:
      
      	In t0401-parse: parse_person_test
      	In t0402-details: query_details_test
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Add support for tree objects in revision pools · 225fe215
      Commits now store pointers to their tree objects.
      Tree objects now work as separate git_revpool_object
      entities.
      Tree objects can be loaded and parsed inedependently
      from commits.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Changed revpool's object table to support arbitrary objects · 40721f6b
      git_revpool_object now has a type identifier for each object
      type in a revpool (commits, trees, blobs, etc).
      
      Trees can now be stored in the revision pool.
      
      git_revpool_tableit now supports filtering objects by their
      type when iterating through the object table.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
    • Add new tests: t0502-table, t0503-tableit · b231ef3a
      "t0502-table" tests for basic functionality of the objects
      table:
      	table_create	(creating a new object table)
      	table_populate	(fill & lookup on the object table)
      	table_resize	(dynamically resize the table)
      
      "t0503-tableit" tests the iterator for object tables:
      	table_iterator (make sure the iterator reaches all objects)
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  4. 10 Jul, 2010 3 commits
  5. 07 Jun, 2010 7 commits
  6. 02 Jun, 2010 21 commits
    • Style: Do not use (C99) // comments · f2924934
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Style: Fix brace placement and spacing · b2bc567f
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix a memory leak shown by valgrind · 702bd705
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix inconsistent definition of off_t on Linux · 28f98329
      In order to avoid inconsistent definitions of type off_t, all
      compilation units should include the "common.h" header file
      before certain system headers (those which directly or indirectly
      lead to the definition of off_t). The "common.h" header contains
      the definition of _FILE_OFFSET_BITS to select 64-bit file offsets.
      
      The symptom of this inconsistency, while compiling with -Wextra, is
      the following warning:
      
          In file included from src/common.h:50,
                           from src/commit.c:28:
          src/util.h: In function git__is_sizet:
          src/util.h:41: warning: comparison between signed and unsigned
      
      In order to fix the problem, we simply remove the #include <time.h>
      statement at the head of src/commit.c.  Note that src/commit.h also
      includes <time.h>.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix a "dereference of type-punned pointer" compiler warning · c1b62b2e
      gcc (4.4.0) issues the following warning:
      
          src/revobject.c:33: warning: dereferencing type-punned pointer \
              will break strict-aliasing rules
      
      We suppress the warning by copying the first 4 bytes from the oid
      structure into an 'unsigned int' using memcpy(). This will also
      fix any potential alignment issues on certain platforms.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix a doxygen warning · 6e0fa05b
      In particular, doxygen issues the following warning:
      
          .../src/git/revwalk.h:86: Warning: The following parameters of \
              gitrp_sorting(git_revpool *pool, unsigned int sort_mode) are \
              not documented:
                parameter 'pool'
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix sparse warnings: "symbol not declared. Should it be static?" · 84b9cec7
      In particular, sparse issues the following warnings:
      
          src/revobject.c:29:14: warning: symbol 'max_load_factor' was \
              not declared. Should it be static?
          src/revobject.c:31:14: warning: symbol 'git_revpool_table__hash' was \
              not declared. Should it be static?
      
      In order to suppress these warnings, we simply declare them as
      static, since they are not (currently) referenced outside of this
      file.
      
      In the case of max_load_factor, this is probably correct. However,
      this may not be appropriate for git_revpool_table__hash(), given
      how it is named. So, this should either be re-named to reflect it's
      non-external status, or a declaration needs to be added to the
      revobject.h header file.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix sparse warnings: "Using plain integer as NULL pointer" · ee1765e5
      In order to suppress this warning, we could simply replace the
      constant 0 with NULL. However, in this case, replacing the
      comparison with 0 by !buffer is more idiomatic.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • msvc: tests/t0403-lists.c: Fix a compiler warning · 468b12ad
      For more recent versions of msvc, the time_t type, as returned by
      the time() function, is a 64-bit type. The srand() function, however,
      expects an 'unsigned int' input parameter, leading to the warning.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • msvc: Fix an "conversion, loss of data" compiler warning · 4e0d6d86
      In particular, the compiler issues the following warning:
      
          src/revwalk.c(61) : warning C4244: '=' : conversion from \
              'unsigned int' to 'unsigned char', possible loss of data
      
      In order to suppress the warning, we change the type of the
      sorting "enum" field of the git_revpool structure to be consistent
      with the sort_mode parameter of the gitrp_sorting() function.
      
      Note that if the size of the git_revpool structure is an issue,
      then we could change the type of the sort_mode parameter instead.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • msvc: Fix some compiler warnings · 5440906f
      In particular, the compiler issues the following warnings:
      
          src/revobject.c(29) : warning C4305: 'initializing' : truncation \
              from 'double' to 'const float'
          src/revobject.c(56) : warning C4244: '=' : conversion from \
              'const float' to 'unsigned int', possible loss of data
          src/revobject.c(149) : warning C4244: '=' : conversion from \
              'const float' to 'unsigned int', possible loss of data
      
      In order to suppress the warnings we change the type of max_load_factor
      to double, rather than change the initialiser to 0.65f, and cast the
      result type of the expressions to 'unsigned int' as expected by the
      assignment operators. Note that double should be able to represent all
      unsigned int values without loss.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix some "signed/unsigned comparison" compilation warnings · 8a7d625f
      These warnings are issued by both gcc (-Wextra) and msvc (-W3).
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Fix a memory corruption runtime error · 5b7487be
      On the msvc build, the tests t0401-parse and t0501-walk both
      crash with a runtime error (ACCESS_VIOLATION). This is caused
      by writing to un-allocated memory due to an under-allocation
      of a git_revpool_table data structure.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • msvc: Fix a "declaration after statement" compilation error · 331578fb
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Ramsay Jones committed
    • Improved error handling on auxilirary functions. · de141d4b
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Use the first 4 bytes of an OID as hash, instead of full hashing. · c2550609
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Added new error codes. Improved error handling. · 6bb7aa13
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Removed trailing whitespace. · 0daa6cdc
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Fixed brace placement and converted spaces to tabs. · 9b3577ed
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Added t0501-walk (simple test for all revision pool walking modes) · 0cf02ff9
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed
    • Fixed topological commit sorting (no longerd reversed) and commit time · 1d1be8ee
      sorting ('prev' pointers in the linked list are no longer lost).
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Vicent Marti committed