1. 01 Feb, 2018 1 commit
  2. 21 Jan, 2018 1 commit
  3. 12 Sep, 2017 1 commit
    • features.h: allow building without CMake-generated feature header · 26f531d3
      In commit a390a846 (cmake: move defines into "features.h" header,
      2017-07-01), we have introduced a new "features.h" header. This file is
      being generated by the CMake build system based on how the libgit2 build
      has been configured, replacing the preexisting method of simply setting
      the defines inside of the CMake build system. This was done to help
      splitting up the build instructions into multiple separate
      subdirectories.
      
      An overlooked shortcoming of this approach is that some projects making
      use of libgit2 build the library with custom build systems, without
      making use of CMake. For those users, the introduction of the
      "features.h" file makes their life harder as they would have to also
      generate this file.
      
      Fix this issue by guarding all inclusions of the generated header file
      by the `LIBGIT2_NO_FEATURES_H` define. Like this, other build systems
      can skip the feature header and simply define all used features by
      specifying `-D` flags for the compiler again.
      Patrick Steinhardt committed
  4. 16 Aug, 2017 1 commit
    • cmake: move defines into "features.h" header · a390a846
      In a future commit, we will split out the build instructions for our
      library directory and move them into a subdirectory. One of the benefits
      is fixing scoping issues, where e.g. defines do not leak to build
      targets where they do not belong to. But unfortunately, this does also
      pose the problem of how to propagate some defines which are required by
      both the library and the test suite.
      
      One way would be to create another variable keeping track of all added
      defines and declare it inside of the parent scope. While this is the
      most obvious and simplest way of going ahead, it is kind of unfortunate.
      The main reason to not use this is that these defines become implicit
      dependencies between the build targets. By simply observing a define
      inside of the CMakeLists.txt file, one cannot reason whether this define
      is only required by the current target or whether it is required by
      different targets, as well.
      
      Another approach would be to use an internal header file keeping track
      of all defines shared between targets. While configuring the library, we
      will set various variables and let CMake configure the file, adding or
      removing defines based on what has been configured. Like this, one can
      easily keep track of the current environment by simply inspecting the
      header file. Furthermore, these dependencies are becoming clear inside
      the CMakeLists.txt, as instead of simply adding a define, we now call
      e.g. `SET(GIT_THREADSAFE 1)`.
      
      Having this header file though requires us to make sure it is always
      included before any "#ifdef"-preprocessor checks are executed. As we
      have already refactored code to always include the "common.h" header
      file before any statement inside of a file, this becomes easy: just make
      sure "common.h" includes the new "features.h" header file first.
      Patrick Steinhardt committed
  5. 30 Jun, 2017 1 commit
    • win32: fix circular include deps with w32_crtdbg · 459fb8fe
      The current order of declarations and includes between "common.h" and
      "w32_crtdbg_stacktrace.h" is rather complicated. Both header files make
      use of things defined in the other one and are thus circularly dependent
      on each other. This makes it currently impossible to compile the
      "w32_crtdbg_stacktrace.c" file when including "common.h" inside of
      "w32_crtdbg_stacktrace.h".
      
      We can disentangle the mess by moving declaration of the inline crtdbg
      functions into the "w32_crtdbg_stacktrace.h" file and adding additional
      includes inside of it, such that all required functions are available to
      it. This allows us to break the dependency cycle.
      Patrick Steinhardt committed
  6. 29 Dec, 2016 1 commit
  7. 14 Nov, 2016 1 commit
  8. 20 Jun, 2016 1 commit
    • win32: rename pthread.{c,h} to thread.{c,h} · 8aaa9fb6
      The old pthread-file did re-implement the pthreads API with exact symbol
      matching. As the thread-abstraction has now been split up between Unix- and
      Windows-specific files within the `git_` namespace to avoid symbol-clashes
      between libgit2 and pthreads, the rewritten wrappers have nothing to do with
      pthreads anymore.
      
      Rename the Windows-specific pthread-files to honor this change.
      Patrick Steinhardt committed
  9. 23 Feb, 2016 1 commit
    • common: introduce GITERR_CHECK_ALLOC_BUF · 859ed5dd
      We commonly have to check if a git_buf has been allocated
      correctly or if we ran out of memory. Introduce a new macro
      similar to `GITERR_CHECK_ALLOC` which checks if we ran OOM and if
      so returns an error. Provide a `#nodef` for Coverity to mark the
      error case as an abort path.
      Patrick Steinhardt committed
  10. 09 Feb, 2016 1 commit
  11. 05 Oct, 2015 1 commit
  12. 19 Sep, 2015 1 commit
  13. 03 Aug, 2015 1 commit
  14. 29 Jun, 2015 1 commit
  15. 11 May, 2015 1 commit
  16. 02 Mar, 2015 1 commit
  17. 13 Feb, 2015 5 commits
  18. 03 Feb, 2015 1 commit
  19. 05 Dec, 2014 1 commit
  20. 02 May, 2014 1 commit
  21. 30 Apr, 2014 1 commit
  22. 17 Apr, 2014 1 commit
    • Index locking and entry allocation changes · 8a2834d3
      This makes the lock management on the index a little bit broader,
      having a number of routines hold the lock across looking up the
      item to be modified and actually making the modification.  Still
      not true thread safety, but more pure index modifications are now
      safe which allows the simple cases (such as starting up a diff
      while index modifications are underway) safe enough to get the
      snapshot without hitting allocation problems.
      
      As part of this, I simplified the allocation of index entries to
      use a flex array and just put the path at the end of the index
      entry.  This makes every entry self-contained and makes it a
      little easier to feel sure that pointers to strings aren't
      being accidentally copied and freed while other references are
      still being held.
      Russell Belfer committed
  23. 20 Feb, 2014 1 commit
    • Address PR comments · 72556cc6
      * Make GIT_INLINE an internal definition so it cannot be used in
        public headers
      * Fix language in CONTRIBUTING
      * Make index caps API use signed instead of unsigned values
      Russell Belfer committed
  24. 11 Dec, 2013 4 commits
    • Fix C99 __func__ for MSVC · 60058018
      Russell Belfer committed
    • 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
    • Improve GIT_EUSER handling · 96869a4e
      This adds giterr_user_cancel to return GIT_EUSER and clear any
      error message that is sitting around.  As a result of using that
      in places, we need to be more thorough with capturing errors that
      happen inside a callback when used internally.  To help with that,
      this also adds giterr_capture and giterr_restore so that when we
      internally use a foreach-type function that clears errors and
      converts them to GIT_EUSER, it is easier to restore not just the
      return value, but the actual error message text.
      Russell Belfer committed
  25. 09 Dec, 2013 1 commit
  26. 01 Nov, 2013 1 commit
  27. 01 Apr, 2013 1 commit
  28. 15 Mar, 2013 1 commit
    • Implement global/system file search paths · 5540d947
      The goal of this work is to expose the search logic for "global",
      "system", and "xdg" files through the git_libgit2_opts() interface.
      
      Behind the scenes, I changed the logic for finding files to have a
      notion of a git_strarray that represents a search path and to store
      a separate search path for each of the three tiers of config file.
      For each tier, I implemented a function to initialize it to default
      values (generally based on environment variables), and then general
      interfaces to get it, set it, reset it, and prepend new directories
      to it.
      
      Next, I exposed these interfaces through the git_libgit2_opts
      interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
      for the user to control which search path they were modifying.
      There are alternative designs for the opts interface / argument
      ordering, so I'm putting this phase out for discussion.
      
      Additionally, I ended up doing a little bit of clean up regarding
      attr.h and attr_file.h, adding a new attrcache.h so the other two
      files wouldn't have to be included in so many places.
      Russell Belfer committed
  29. 28 Feb, 2013 2 commits
  30. 01 Feb, 2013 1 commit
  31. 08 Jan, 2013 1 commit
  32. 05 Dec, 2012 1 commit