1. 23 Feb, 2022 1 commit
  2. 06 Jan, 2022 3 commits
    • remote: introduce `git_remote_connect_options` · 6fc6eeb6
      The existing mechanism for providing options to remote fetch/push calls,
      and subsequently to transports, is unsatisfactory.  It requires an
      options structure to avoid breaking the API and callback signatures.
      
      1. Introduce `git_remote_connect_options` to satisfy those needs.
      
      2. Add a new remote connection API, `git_remote_connect_ext` that will
         take this new options structure.  Existing `git_remote_connect` calls
         will proxy to that.  `git_remote_fetch` and `git_remote_push` will
         proxy their fetch/push options to that as well.
      
      3. Define the interaction between `git_remote_connect` and fetch/push.
         Connect _may_ be called before fetch/push, but _need not_ be.  The
         semantics of which options would be used for these operations was
         not specified if you specify options for both connect _and_ fetch.
         Now these are defined that the fetch or push options will be used
         _if_ they were specified.  Otherwise, the connect options will be
         used if they were specified.  Otherwise, the library's defaults will
         be used.
      
      4. Update the transports to understand `git_remote_connect_options`.
         This is a breaking change to the systems API.
      Edward Thomson committed
    • remote: improved error reporting · f99a0d69
      Several places in the remote code identify an error and then swallow it;
      return the error.
      Edward Thomson committed
    • push: don't try to connect in `finish` · f5373123
      Push starts by connecting, don't try to connect again, just rely on the
      existing connection existing.
      Edward Thomson committed
  3. 17 Oct, 2021 1 commit
    • str: introduce `git_str` for internal, `git_buf` is external · f0e693b1
      libgit2 has two distinct requirements that were previously solved by
      `git_buf`.  We require:
      
      1. A general purpose string class that provides a number of utility APIs
         for manipulating data (eg, concatenating, truncating, etc).
      2. A structure that we can use to return strings to callers that they
         can take ownership of.
      
      By using a single class (`git_buf`) for both of these purposes, we have
      confused the API to the point that refactorings are difficult and
      reasoning about correctness is also difficult.
      
      Move the utility class `git_buf` to be called `git_str`: this represents
      its general purpose, as an internal string buffer class.  The name also
      is an homage to Junio Hamano ("gitstr").
      
      The public API remains `git_buf`, and has a much smaller footprint.  It
      is generally only used as an "out" param with strict requirements that
      follow the documentation.  (Exceptions exist for some legacy APIs to
      avoid breaking callers unnecessarily.)
      
      Utility functions exist to convert a user-specified `git_buf` to a
      `git_str` so that we can call internal functions, then converting it
      back again.
      Edward Thomson committed
  4. 09 Jun, 2020 1 commit
    • tree-wide: do not compile deprecated functions with hard deprecation · c6184f0c
      When compiling libgit2 with -DDEPRECATE_HARD, we add a preprocessor
      definition `GIT_DEPRECATE_HARD` which causes the "git2/deprecated.h"
      header to be empty. As a result, no function declarations are made
      available to callers, but the implementations are still available to
      link against. This has the problem that function declarations also
      aren't visible to the implementations, meaning that the symbol's
      visibility will not be set up correctly. As a result, the resulting
      library may not expose those deprecated symbols at all on some platforms
      and thus cause linking errors.
      
      Fix the issue by conditionally compiling deprecated functions, only.
      While it becomes impossible to link against such a library in case one
      uses deprecated functions, distributors of libgit2 aren't expected to
      pass -DDEPRECATE_HARD anyway. Instead, users of libgit2 should manually
      define GIT_DEPRECATE_HARD to hide deprecated functions. Using "real"
      hard deprecation still makes sense in the context of CI to test we don't
      use deprecated symbols ourselves and in case a dependant uses libgit2 in
      a vendored way and knows it won't ever use any of the deprecated symbols
      anyway.
      Patrick Steinhardt committed
  5. 07 Feb, 2020 1 commit
    • push: check error code returned by `git_revwalk_hide` · 6eebfc06
      When queueing objects we want to push, we call `git_revwalk_hide` to
      hide all objects already known to the remote from our revwalk. We do not
      check its return value though, where the orginial intent was to ignore
      the case where the pushed OID is not a known committish. As
      `git_revwalk_hide` can fail due to other reasons like out-of-memory
      exceptions, we should still check its return value.
      
      Fix the issue by checking the function's return value, ignoring
      errors hinting that it's not a committish. As `git_revwalk__push_commit`
      currently clobbers these error codes, we need to adjust it as well in
      order to make it available downstream.
      Patrick Steinhardt committed
  6. 15 Jun, 2019 1 commit
  7. 14 Jun, 2019 1 commit
    • Rename opt init functions to `options_init` · 0b5ba0d7
      In libgit2 nomenclature, when we need to verb a direct object, we name
      a function `git_directobject_verb`.  Thus, if we need to init an options
      structure named `git_foo_options`, then the name of the function that
      does that should be `git_foo_options_init`.
      
      The previous names of `git_foo_init_options` is close - it _sounds_ as
      if it's initializing the options of a `foo`, but in fact
      `git_foo_options` is its own noun that should be respected.
      
      Deprecate the old names; they'll now call directly to the new ones.
      Edward Thomson committed
  8. 22 Jan, 2019 1 commit
  9. 01 Dec, 2018 1 commit
  10. 07 Sep, 2018 1 commit
  11. 29 Jun, 2018 1 commit
  12. 10 Jun, 2018 1 commit
  13. 11 Sep, 2017 1 commit
  14. 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
  15. 29 Dec, 2016 1 commit
  16. 20 Dec, 2016 1 commit
  17. 19 Apr, 2016 1 commit
  18. 20 Mar, 2016 1 commit
  19. 08 Sep, 2015 1 commit
  20. 14 May, 2015 1 commit
  21. 13 May, 2015 3 commits
  22. 18 Apr, 2015 1 commit
  23. 11 Mar, 2015 1 commit
  24. 03 Mar, 2015 2 commits
  25. 10 Dec, 2014 1 commit
  26. 17 Nov, 2014 1 commit
  27. 09 Nov, 2014 1 commit
    • push: use the common refspec parser · aad638f3
      There is one well-known and well-tested parser which we should use,
      instead of implementing parsing a second time.
      
      The common parser is also augmented to copy the LHS into the RHS if the
      latter is empty.
      
      The expressions test had to change a bit, as we now catch a bad RHS of a
      refspec locally.
      Carlos Martín Nieto committed
  28. 02 May, 2014 1 commit
  29. 21 Apr, 2014 2 commits
  30. 03 Apr, 2014 1 commit
  31. 06 Mar, 2014 1 commit
  32. 05 Feb, 2014 1 commit
  33. 27 Jan, 2014 1 commit
  34. 15 Jan, 2014 1 commit