1. 05 Mar, 2012 2 commits
  2. 02 Mar, 2012 7 commits
    • Revert GIT_STATUS constants to avoid issues · e1bcc191
      This reverts the changes to the GIT_STATUS constants and adds a
      new enumeration to describe the type of change in a git_diff_delta.
      I don't love this solution, but it should prevent strange errors
      from occurring for now.  Eventually, I would like to unify the
      various status constants, but it needs a larger plan and I just
      wanted to eliminate this breakage quickly.
      Russell Belfer committed
    • Update diff to use iterators · 74fa4bfa
      This is a major reorganization of the diff code.  This changes
      the diff functions to use the iterators for traversing the
      content.  This allowed a lot of code to be simplified.  Also,
      this moved the functions relating to outputting a diff into a
      new file (diff_output.c).
      
      This includes a number of other changes - adding utility
      functions, extending iterators, etc. plus more tests for the
      diff code.  This also takes the example diff.c program much
      further in terms of emulating git-diff command line options.
      Russell Belfer committed
    • Continue implementation of git-diff · a2e895be
      * Implemented git_diff_index_to_tree
      * Reworked git_diff_options structure to handle more options
      * Made most of the options in git_diff_options actually work
      * Reorganized code a bit to remove some redundancy
      * Added option parsing to examples/diff.c to test most options
      Russell Belfer committed
    • Clean up diff implementation for review · 3a437590
      This fixes several bugs, updates tests and docs, eliminates the
      FILE* assumption in favor of printing callbacks for the diff patch
      formatter helpers, and adds a "diff" example function that can
      perform a diff from the command line.
      Russell Belfer committed
    • Implement diff lists and formatters · 65b09b1d
      This reworks the diff API to separate the steps of producing
      a diff descriptions from formatting the diff.  This will allow
      us to share diff output code with the various diff creation
      scenarios and will allow us to implement rename detection as
      an optional pass that can be run on a diff list.
      Russell Belfer committed
    • Initial implementation of git_diff_blob · cd33323b
      This gets the basic plumbing in place for git_diff_blob.
      There is a known issue where additional parameters like
      the number of lines of context to display on the diff
      are not working correctly (which leads one of the new
      unit tests to fail).
      Russell Belfer committed
    • attr: Change the attribute check macros · c63793ee
      The point of having `GIT_ATTR_TRUE` and `GIT_ATTR_FALSE` macros is to be
      able to change the way that true and false values are stored inside of
      the returned gitattributes value pointer.
      
      However, if these macros are implemented as a simple rename for the
      `git_attr__true` pointer, they will always be used with the `==`
      operator, and hence we cannot really change the implementation to any
      other way that doesn't imply using special pointer values and comparing
      them!
      
      We need to do the same thing that core Git does, which is using a
      function macro. With `GIT_ATTR_TRUE(attr)`, we can change
      internally the way that these values are stored to anything we want.
      
      This commit does that, and rewrites a large chunk of the attributes test
      suite to remove duplicated code for expected attributes, and to
      properly test the function macro behavior instead of comparing
      pointers.
      Vicent Martí committed
  3. 29 Feb, 2012 1 commit
  4. 27 Feb, 2012 2 commits
  5. 26 Feb, 2012 1 commit
  6. 20 Feb, 2012 2 commits
  7. 17 Feb, 2012 3 commits
  8. 15 Feb, 2012 3 commits
  9. 13 Feb, 2012 1 commit
  10. 05 Feb, 2012 1 commit
    • libgit2 v0.16.0 "Dutch Fries" · 242a1cea
      This lovely and much delayed release of libgit2 ships from the cold city
      of Brussels, which is currently hosting FOSDEM 2012.
      
      There's been plenty of changes since the latest stable release, here's a
      full summary:
      
      - Git Attributes support (see git2/attr.h)
      	There is now support to efficiently parse and retrieve information
      	from `.gitattribute` files in a repository. Note that this
      	information is not yet used e.g. when checking out files.
      
      - .gitignore support
      	Likewise, all the operations that are affected by `.gitignore` files
      	now take into account the global, user and local ignores when
      	skipping the relevant files.
      
      - Cleanup of the object ownership semantics
      	The ownership semantics for all repository subparts (index, odb,
      	config files, etc) has been redesigned. All these objects are now
      	reference counted, and can be hot-swapped in the middle of
      	execution, allowing for instance to add a working directory and an
      	index to a repository that was previously opened as bare, or to
      	change the source of the ODB objects after initialization.
      
      	Consequently, the repository API has been simplified to remove all
      	the `_openX` calls that allowed setting these subparts *before*
      	initialization.
      
      - git_index_read_tree()
      	Git trees can now be read into the index.
      
      - More reflog functionality
      	The reference log has been optimized, and new API calls to rename
      	and delete the logs for a reference have been added.
      
      - Rewrite of the References code with explicit ownership semantics
      	The references code has been mostly rewritten to take into account
      	the cases where another Git application was modifying a repository's
      	references while the Library was running.
      
      	References are now explicitly loaded and free'd by the user, and
      	they may be reloaded in the middle of execution if the user suspects
      	that their values may have changed on disk. Despite the new
      	ownership semantics, the references API stays the same.
      
      - Simplified the Remotes API
      	Some of the more complex Remote calls have been refactored into
      	higher level ones, to facilitate the usual `fetch` workflow of a
      	repository.
      
      - Greatly improved thread-safety
      	The library no longer has race conditions when loading objects from
      	the same ODB and different threads at the same time. There's now
      	full TLS support, even for error codes. When the library is built
      	with `THREADSAFE=1`, the threading support must be globally
      	initialized before it can be used (see `git_threads_init()`)
      
      - Tree walking API
      	A new API can recursively traverse trees and subtrees issuing callbacks for
      	every single entry.
      
      - Tree diff API
      	There is basic support for diff'ing an index against two trees.
      
      - Improved windows support
      	The Library is now codepage aware under Windows32: new API calls
      	allow the user to set the default codepage for the OS in order to
      	avoid strange Unicode errors.
      Vicent Martí committed
  11. 16 Jan, 2012 1 commit
    • Patch cleanup for merge · cfbc880d
      After reviewing the gitignore support with Vicent, we came up
      with a list of minor cleanups to prepare for merge, including:
      
      * checking git_repository_config error returns
      * renaming git_ignore_is_ignored and moving to status.h
      * fixing next_line skipping to include \r skips
      * commenting on where ignores are and are not included
      Russell Belfer committed
  12. 11 Jan, 2012 1 commit
    • Initial implementation of gitignore support · df743c7d
      Adds support for .gitignore files to git_status_foreach() and
      git_status_file().  This includes refactoring the gitattributes
      code to share logic where possible.  The GIT_STATUS_IGNORED flag
      will now be passed in for files that are ignored (provided they
      are not already in the index or the head of repo).
      Russell Belfer committed
  13. 31 Dec, 2011 1 commit
  14. 30 Dec, 2011 1 commit
  15. 29 Dec, 2011 1 commit
    • Add support for macros and cache flush API. · 73b51450
      Add support for git attribute macro definitions.  Also, add
      support for cache flush API to clear the attribute file content
      cache when needed.
      
      Additionally, improved the handling of global and system files,
      making common utility functions in fileops and converting config
      and attr to both use the common functions.
      
      Adds a bunch more tests and fixed some memory leaks.  Note that
      adding macros required me to use refcounted attribute assignment
      definitions, which complicated, but probably improved memory usage.
      Russell Belfer committed
  16. 21 Dec, 2011 1 commit
    • Add APIs for git attributes · ee1f0b1a
      This adds APIs for querying git attributes.  In addition to
      the new API in include/git2/attr.h, most of the action is in
      src/attr_file.[hc] which contains utilities for dealing with
      a single attributes file, and src/attr.[hc] which contains
      the implementation of the APIs that merge all applicable
      attributes files.
      Russell Belfer committed
  17. 16 Dec, 2011 1 commit
  18. 03 Dec, 2011 2 commits
    • tree: recursive diff-index · e9238687
      Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      
      # Please enter the commit message for your changes. Lines starting
      # with '#' will be ignored, and an empty message aborts the commit.
      #
      # Author:    Carlos Martín Nieto <carlos@cmartin.tk>
      #
      # On branch development
      # Your branch is ahead of 'origin/development' by 11 commits.
      #
      # Changes to be committed:
      #   (use "git reset HEAD^1 <file>..." to unstage)
      #
      #	modified:   include/git2/tree.h
      #	modified:   src/tree.c
      #	modified:   tests-clay/clay_main.c
      #	modified:   tests-clay/object/tree/diff.c
      #
      # Untracked files:
      #   (use "git add <file>..." to include in what will be committed)
      #
      #	0001-remote-Cleanup-the-remotes-code.patch
      #	466.patch
      #	466.patch.1
      #	488.patch
      #	Makefile
      #	libgit2.0.15.0.dylib
      #	libgit2.0.dylib
      #	libgit2.dylib
      #	libgit2_clay
      #	libgit2_test
      #	tests-clay/object/tree/
      Vicent Marti committed
    • tree: implement tree diffing · a1fdea28
      For each difference in the trees, the callback gets called with the
      relevant information so the user can fill in their own data
      structures.
      
      Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
      Carlos Martín Nieto committed
  19. 28 Nov, 2011 1 commit
  20. 26 Nov, 2011 3 commits
    • Rename all `_close` methods · 45e79e37
      There's no difference between `_free` and `_close` semantics: keep
      everything with the same name to avoid confusions.
      Vicent Marti committed
    • repository: Change ownership semantics · 9462c471
      The ownership semantics have been changed all over the library to be
      consistent. There are no more "borrowed" or duplicated references.
      
      Main changes:
      
      	- `git_repository_open2` and `3` have been dropped.
      
      	- Added setters and getters to hotswap all the repository owned
      	objects:
      
      		`git_repository_index`
      		`git_repository_set_index`
      		`git_repository_odb`
      		`git_repository_set_odb`
      		`git_repository_config`
      		`git_repository_set_config`
      		`git_repository_workdir`
      		`git_repository_set_workdir`
      
      	Now working directories/index files/ODBs and so on can be
      	hot-swapped after creating a repository and between operations.
      
      	- All these objects now have proper ownership semantics with
      	refcounting: they all require freeing after they are no longer
      	needed (the repository always keeps its internal reference).
      
      	- Repository open and initialization has been updated to keep in
      	mind the configuration files. Bare repositories are now always
      	detected, and a default config file is created on init.
      
      	- All the tests affected by these changes have been dropped from the
      	old test suite and ported to the new one.
      Vicent Marti committed
  21. 22 Nov, 2011 3 commits
  22. 21 Nov, 2011 1 commit