Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: experimental

Oct 26, 2010

  1. Benjamin C Meyer

    Change /* to /** at the start of comment blocks in public api so doxygen

    will generate documenation and not hide them.
    
    Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
    authored October 25, 2010

Oct 25, 2010

  1. Benjamin C Meyer

    Fix spelling mistakes in the documentation.

    Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
    authored October 25, 2010
  2. Benjamin C Meyer

    Remove whitespace from the end of the line in documentation.

    Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
    authored October 25, 2010

Oct 08, 2010

  1. Vicent Marti

    Fix issue 3 (memory corruption resize_tree_array)

    The tree array wasn't being initialized when instantiating a tree object
    in memory instead of loading it from disk.
    
    New unit tests added to check for the problem.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored October 08, 2010

Oct 06, 2010

  1. Vicent Marti

    Add unit tests for object write-back

    Basic write-back & in-memory editing for objects is now tested in t0403
    (commits), t0802 (tags) and t0902 (trees).
    
    Add new helper functions in test_helpers.c to remove the loose objects
    created when doing write-back tests.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored October 07, 2010
  2. Vicent Marti

    Add write-back support for Tag files

    Tag files can now be created and modified in-memory (all the setter
    methods have been implemented), and written back to disk using the
    generic git_object_write() method.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored October 07, 2010
  3. Vicent Marti

    Fix possible segfaults in src/tree.c (issue 1)

    git_tree_entry_byname was dereferencing a NULL pointer when the searched
    file couldn't be found on the tree.
    
    New test cases have been added to check for entry access methods.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored October 07, 2010

Sep 21, 2010

  1. Vicent Marti

    Add write-back support for git_tree

    All the setter methods for git_tree have been added, including the
    setters for attributes on each git_tree_entry and methods to add/remove
    entries of the tree.
    
    Modified trees and trees created in-memory from scratch can be written
    back to the repository using git_object_write().
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 21, 2010

Sep 20, 2010

  1. Vicent Marti

    Add support for in-memory objects

    All repository objects can now be created from scratch in memory using
    either the git_object_new() method, or the corresponding git_XXX_new()
    for each object.
    
    So far, only git_commits can be written back to disk once created in
    memory.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 20, 2010

Sep 19, 2010

  1. Vicent Marti

    Add setter methods & write support for git_commit

    All the required git_commit_set_XXX methods have been implemented; all
    the attributes of a commit object can now be modified in-memory.
    
    The new method git_object_write() automatically writes back the
    in-memory changes of any object to the repository. So far it only
    supports git_commit objects.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 20, 2010
  2. Vicent Marti

    Implement internal methods to write on sources

    The new 'git__source_printf' does an overflow-safe printf on a source
    bfufer.
    
    The new 'git__source_write' does an overflow-safe byte write on a source
    buffer.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 19, 2010
  3. Vicent Marti

    Give object structures more descriptive names

    The 'git_obj' structure is now called 'git_rawobj', since
    it represents a raw object read from the ODB.
    
    The 'git_repository_object' structure is now called 'git_object',
    since it's the base object class for all objects.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 19, 2010

Sep 18, 2010

  1. Vicent Marti

    Add generic methods for object writeback

    git_repository_object has now several internal methods to write back the
    object information in the repository.
    
    - git_repository__dbo_prepare_write()
    	Prepares the DBO object to be modified
    
    - git_repository__dbo_write()
    	Writes new bytes to the DBO object
    
    - git_repository__dbo_writeback()
    	Writes back the changes to the repository
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 18, 2010

Sep 12, 2010

  1. Vicent Marti

    Add methods to access internal attributes in git_repo

    Added several methods to access:
    
    	- The ODB behind a repo
    	- The SHA1 id behind a generic repo object
    	- The type of a generic repo object
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored September 12, 2010

Sep 08, 2010

  1. Vicent Marti

    Fix: do not export custom types in the extern API

    Some compilers give linking problems when exporting 'uint32_t' as a
    return type in the external API. Use generic types instead.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 14, 2010

Aug 12, 2010

  1. Vicent Marti

    Add support for manually freeing repo objects

    A new method 'git_repository_object_free' allows to manually force the
    freeing of a repository object, even though they are still automatically
    managed by the repository and don't need to be freed by the user.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 12, 2010
  2. Vicent Marti

    Fix object handling in git_repository

    All loaded objects through git_repository_lookup are properly parsed &
    free'd on failure.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 12, 2010
  3. Vicent Marti

    Add auxiliary method git__hexdump

    New function in util.c to do a dump of a buffer's contents in
    hexadecimal to stdout.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 12, 2010
  4. Vicent Marti

    Finish the tree object API

    The interface for loading and parsing tree objects from a repository has
    been completed with all the required accesor methods for attributes,
    support for manipulating individual tree entries and a new unit test
    t0901-readtree which tries to load and parse a tree object from a
    repository.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 12, 2010
  5. Vicent Marti

    Add unit tests for index manipulation

    Three new unit tests, t06XX files have been added.
    
    	t0601-read: tests for loading index files from disk,
    				for creating in-memory indexes and for accessing
    				index entries.
    	t0602-write: tests for writing index files back to disk
    	t0603-sort: tests for properly sorting the entries array of an index
    
    Two test indexes have been added in 'tests/resources/':
    
    	test/resources/index: a sample index from a libgit2 repository
    
    	test/resources/gitgit.index: a sample index from a git.git
    		repository (includes TREE extension data)
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 19, 2010
  6. Vicent Marti

    Move test resources to a common directory

    All the external resources used by the tests are now placed inside the
    common 'tests/resources' directory.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 20, 2010
  7. Vicent Marti

    Add support for git index files

    The new 'git_index' structure is an in-memory representation
    of a git index on disk; the 'git_index_entry' structures represent
    each one of the file entries on the index.
    
    The following calls for index instantiation have been added:
    
    	git_index_alloc(): instantiate a new index structure
    	git_index_free(): free an existing index
    	git_index_clear(): clear all the entires in an existing file
    
    The following calls for index reading and writing have been added:
    
    	git_index_read(): update the contents of the index structure from
    					  its file on disk.
    
    		Internally implemented through:
    			git_index__parse()
    
    	Index files are stored on disk in network byte order; all integer fields
    	inside them are properly converted to the machine's byte order when
    	loading them in memory. The parsing engine also distinguishes
    	between normal index entries and extended entries with 2 extra bytes
    	of flags.
    
    	The 'TREE' extension for index entries is also loaded into memory:
    	Tree caches stored in Index files are loaded into the
    	'git_index_tree' structure pointed by the 'tree' pointer inside
    	'git_index'.
    
    	'index->tree' points to the root node of the tree cache; the full tree
    	can be traversed through each of the node's 'tree->children'.
    
    	Index files can be written back to disk through:
    
    	git_index_write(): atomic writing of existing index objects
    		backed by internal method git_index__write()
    
    The following calls for entry manipulation have been added:
    
    	git_index_add(): insert an empty entry to the index
    
    	git_index_find(): search an entry by its path name
    
    	git_index__append(): appends a new index entry to the end of the
    						 list, resizing the entries array if required
    
    	New index entries are always inserted at the end of the array; since the
    	index entries must be sorted for it to be internally consistent, the
    	index object is only sorted once, and if required, before accessing the
    	whole entriea array (e.g. before writing to disk, before traversing,
    	etc).
    
    	git_index__remove_pos(): remove an index entry in a specific position
    
    	git_index__sort(): sort the entries in the array by path name
    
    	The entries array is sorted stably and in place using an
    	insertion sort, which ought to be the most efficient approach
    	since the entries array is always mostly-sorted.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 09, 2010
  8. Vicent Marti

    Add support for atomic file locking

    The struct 'git_filelock' represents an atomically-locked
    file, git-style.
    
    Locked files can be modified atomically through the new file lock
    interface:
    
    int git_filelock_init(git_filelock *lock, const char *path);
    int git_filelock_lock(git_filelock *lock, int append);
    void git_filelock_unlock(git_filelock *lock);
    int git_filelock_commit(git_filelock *lock);
    int git_filelock_write(git_filelock *lock, const char *buffer, size_t length);
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 09, 2010
  9. Vicent Marti

    Redesigned the walking/object lookup interface

    The old 'git_revpool' object has been removed and
    split into two distinct objects with separate
    functionality, in order to have separate methods for
    object management and object walking.
    
    *	A new object 'git_repository' does the high-level
    	management of a repository's objects (commits, trees,
    	tags, etc) on top of a 'git_odb'.
    
    	Eventually, it will also manage other repository
    	attributes (e.g. tag resolution, references, etc).
    
    	See: src/git/repository.h
    
    *	A new external method
    		'git_repository_lookup(repo, oid, type)'
    	has been added to the 'git_repository' API.
    
    	All object lookups (git_XXX_lookup()) are now
    	wrappers to this method, and duplicated code
    	has been removed. The method does automatic type
    	checking and returns a generic 'git_revpool_object'
    	that can be cast to any specific object.
    
    	See: src/git/repository.h
    
    *	The external methods for object parsing of repository
    	objects (git_XXX_parse()) have been removed.
    
    	Loading objects from the repository is now managed
    	through the 'lookup' functions. These objects are
    	loaded with minimal information, and the relevant
    	parsing is done automatically when the user requests
    	any of the parsed attributes through accessor methods.
    
    	An attribute has been added to 'git_repository' in
    	order to force the parsing of all the repository objects
    	immediately after lookup.
    
    	See: src/git/commit.h
    	See: src/git/tag.h
    	See: src/git/tree.h
    
    *	The previous walking functionality of the revpool
    	is now found in 'git_revwalk', which does the actual
    	revision walking on a repository; the attributes
    	when walking through commits in a database have been
    	decoupled from the actual commit objects.
    	This increases performance when accessing commits
    	during the walk and allows to have several
    	'git_revwalk' instances working at the same time on
    	top of the same repository, without having to load
    	commits in memory several times.
    
    	See: src/git/revwalk.h
    
    *	The old 'git_revpool_table' has been renamed to
    	'git_hashtable' and now works as a generic hashtable
    	with support for any kind of object and custom hash
    	functions.
    
    	See: src/hashtable.h
    
    *	All the relevant unit tests have been updated, renamed
    	and grouped accordingly.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 08, 2010
  10. Vicent Marti

    Add loading and parsing of tag objects

    Tag objects are now properly loaded from the revision pool.
    New test t0801 checks for loading a parsing a series of tags, including
    the tag of a tag.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored August 07, 2010

Aug 06, 2010

  1. Vicent Marti

    Refactor parsing methods

    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>
    authored August 07, 2010
  2. Vicent Marti

    Add packfile reading

    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>
    authored August 06, 2010

Jul 15, 2010

  1. Vicent Marti

    Add parsing of tree file contents.

    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>
    authored July 10, 2010
  2. Vicent Marti

    Changed test files to use tabs instead of spaces

    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 07, 2010
  3. Vicent Marti

    Add external API to access detailed commit attributes

    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>
    authored July 07, 2010
  4. Vicent Marti

    Add support for tree objects in revision pools

    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>
    authored June 18, 2010
  5. Vicent Marti

    Changed revpool's object table to support arbitrary objects

    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>
    authored July 10, 2010
  6. Vicent Marti

    Add new tests: t0502-table, t0503-tableit

    "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>
    authored June 12, 2010

Jul 10, 2010

  1. Vicent Marti

    Fixed memory leaks in test suite

    Created commit objects in t0401-parse weren't being freed properly.
    Updated the API documentation to note that commit objects are owned
    by the revision pool and should not be freed manually.
    
    The parents list of each commit was being freed twice after each test.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored June 09, 2010
  2. Vicent Marti

    Actually free all commits when freeing a commit pool

    Previously the objects table was being freed, but not
    the actuall commits. All git_commit objects are freed
    and hence invalidated when freeing the git_rp object
    they belong to.
    
    Signed-off-by: Vicent Marti <tanoku@gmail.com>
    authored July 10, 2010
Something went wrong with that request. Please try again.