1. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  2. 02 Feb, 2017 1 commit
  3. 06 Oct, 2016 1 commit
  4. 26 May, 2016 3 commits
  5. 16 Dec, 2015 1 commit
  6. 13 Feb, 2015 3 commits
  7. 17 Apr, 2014 2 commits
  8. 06 Apr, 2014 1 commit
  9. 01 Apr, 2014 1 commit
    • Minor submodule cache locking improvements · aa78c9ba
      This improvement the management of the lock around submodule cache
      updates slightly, using the lock to make sure that foreach can
      safely make a snapshot of all existing submodules and making sure
      that git_submodule_add_setup also grabs a lock before inserting
      the new submodule.  Cache initialization / refresh should already
      have been holding the lock correctly as it adds submodules.
      Russell Belfer committed
  10. 04 Feb, 2014 1 commit
    • Convert pqueue to just be a git_vector · 882c7742
      This updates the git_pqueue to simply be a set of specialized
      init/insert/pop functions on a git_vector.
      
      To preserve the pqueue feature of having a fixed size heap, I
      converted the "sorted" field in git_vectors to a more general
      "flags" field so that pqueue could mix in it's own flag.  This
      had a bunch of ramifications because a number of places were
      directly looking at the vector "sorted" field - I added a couple
      new git_vector helpers (is_sorted, set_sorted) so the specific
      representation of this information could be abstracted.
      Russell Belfer committed
  11. 15 Jan, 2014 1 commit
  12. 12 Dec, 2013 1 commit
    • Cleanups, renames, and leak fixes · 9cfce273
      This renames git_vector_free_all to the better git_vector_free_deep
      and also contains a couple of memory leak fixes based on valgrind
      checks.  The fixes are specifically: failure to free global dir
      path variables when not compiled with threading on and failure to
      free filters from the filter registry that had not be initialized
      fully.
      Russell Belfer committed
  13. 11 Dec, 2013 2 commits
    • Remove converting user error to GIT_EUSER · 25e0b157
      This changes the behavior of callbacks so that the callback error
      code is not converted into GIT_EUSER and instead we propagate the
      return value through to the caller.  Instead of using the
      giterr_capture and giterr_restore functions, we now rely on all
      functions to pass back the return value from a callback.
      
      To avoid having a return value with no error message, the user
      can call the public giterr_set_str or some such function to set
      an error message.  There is a new helper 'giterr_set_callback'
      that functions can invoke after making a callback which ensures
      that some error message was set in case the callback did not set
      one.
      
      In places where the sign of the callback return value is
      meaningful (e.g. positive to skip, negative to abort), only the
      negative values are returned back to the caller, obviously, since
      the other values allow for continuing the loop.
      
      The hardest parts of this were in the checkout code where positive
      return values were overloaded as meaningful values for checkout.
      I fixed this by adding an output parameter to many of the internal
      checkout functions and removing the overload.  This added some
      code, but it is probably a better implementation.
      
      There is some funkiness in the network code where user provided
      callbacks could be returning a positive or a negative value and
      we want to rely on that to cancel the loop.  There are still a
      couple places where an user error might get turned into GIT_EUSER
      there, I think, though none exercised by the tests.
      Russell Belfer committed
    • Add git_vector_free_all · fcd324c6
      There are a lot of places that we call git__free on each item in
      a vector and then call git_vector_free on the vector itself.  This
      just wraps that up into one convenient helper function.
      Russell Belfer committed
  14. 27 Aug, 2013 1 commit
  15. 30 Apr, 2013 1 commit
    • Update diff handling of untracked directories · e26b14c0
      When diff encounters an untracked directory, there was a shortcut
      that it took which is not compatible with core git.  This makes
      the default behavior no longer take that shortcut and instead look
      inside the untracked directory to see if there are any untracked
      files within it.  If there are not, then the directory is treated
      as an ignore directory instead of an untracked directory.  This
      has implications for the git_status APIs.
      Russell Belfer committed
  16. 29 Jan, 2013 1 commit
  17. 27 Jan, 2013 1 commit
  18. 08 Jan, 2013 1 commit
  19. 27 Nov, 2012 2 commits
  20. 30 Oct, 2012 2 commits
    • Move rename detection into new file · db106d01
      This improves the naming for the rename related functionality
      moving it to be called `git_diff_find_similar()` and renaming
      all the associated constants, etc. to make more sense.
      
      I also moved the new code (plus the existing `git_diff_merge`)
      into a new file `diff_tform.c` where I can put new functions
      related to manipulating git diff lists.
      
      This also updates the implementation significantly from the
      last revision fixing some ordering issues (where break-rewrite
      needs to be handled prior to copy and rename detection) and
      improving config option handling.
      Russell Belfer committed
    • index refactoring · f45ec1a0
      Edward Thomson committed
  21. 17 Sep, 2012 1 commit
  22. 24 Jul, 2012 1 commit
  23. 17 May, 2012 2 commits
  24. 15 May, 2012 1 commit
    • Ranged iterators and rewritten git_status_file · 41a82592
      The goal of this work is to rewrite git_status_file to use the
      same underlying code as git_status_foreach.
      
      This is done in 3 phases:
      
      1. Extend iterators to allow ranged iteration with start and
         end prefixes for the range of file names to be covered.
      2. Improve diff so that when there is a pathspec and there is
         a common non-wildcard prefix of the pathspec, it will use
         ranged iterators to minimize excess iteration.
      3. Rewrite git_status_file to call git_status_foreach_ext
         with a pathspec that covers just the one file being checked.
      
      Since ranged iterators underlie the status & diff implementation,
      this is actually fairly efficient.  The workdir iterator does
      end up loading the contents of all the directories down to the
      single file, which should ideally be avoided, but it is pretty
      good.
      Russell Belfer committed
  25. 17 Apr, 2012 1 commit
  26. 07 Mar, 2012 1 commit
  27. 02 Mar, 2012 1 commit
    • 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
  28. 22 Feb, 2012 1 commit
    • Fix iterators based on pull request feedback · 0534641d
      This update addresses all of the feedback in pull request #570.
      
      The biggest change was to create actual linked list stacks for
      storing the tree and workdir iterator state.  This cleaned up
      the code a ton.  Additionally, all of the static functions had
      their 'git_' prefix removed, and a lot of other unnecessary
      changes were removed from the original patch.
      Russell Belfer committed
  29. 21 Feb, 2012 1 commit
    • Uniform iterators for trees, index, and workdir · b6c93aef
      This create a new git_iterator type of object that provides a
      uniform interface for iterating over the index, an arbitrary
      tree, or the working directory of a repository.
      
      As part of this, git ignore support was extended to support
      push and pop of directory-based ignore files as the working
      directory is being traversed (so the array of ignores does
      not have to be recreated at each directory during traveral).
      
      There are a number of other small utility functions in buffer,
      path, vector, and fileops that are included in this patch
      that made the iterator implementation cleaner.
      Russell Belfer committed
  30. 13 Feb, 2012 1 commit
  31. 30 Dec, 2011 1 commit
    • Improved gitattributes macro implementation · bd370b14
      This updates to implementation of gitattribute macros to be much more
      similar to core git (albeit not 100%) and to handle expansion of
      macros within macros, etc.  It also cleans up the refcounting usage
      with macros to be much cleaner.
      
      Also, this adds a new vector function `git_vector_insert_sorted()`
      which allows you to maintain a sorted list as you go.  In order to
      write that function, this changes the function `git__bsearch()` to
      take a somewhat different set of parameters, although the core
      functionality is still the same.
      Russell Belfer committed