1. 23 Feb, 2022 1 commit
  2. 17 Jan, 2022 1 commit
  3. 15 Nov, 2021 1 commit
  4. 09 Nov, 2021 1 commit
  5. 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
  6. 29 Aug, 2021 2 commits
  7. 27 Nov, 2020 1 commit
  8. 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
  9. 18 Jan, 2020 1 commit
  10. 02 Jul, 2019 2 commits
  11. 24 Jun, 2019 1 commit
  12. 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
  13. 21 Apr, 2019 1 commit
  14. 21 Feb, 2019 1 commit
  15. 20 Feb, 2019 1 commit
  16. 24 Jan, 2019 3 commits
    • fixup: More generic signing_cb for future flexibility · 0d06bf48
      In the case that we want to build merge + commit, cherrypick + commit, or even just build a commit with signing callback, `git_rebase_commit_signature_cb` particular callback should be made more generic. We also renamed `signature_cb` to `signing_cb` to improve clarity on the purpose of the callback (build a difference between a git_signature and the act of signing).
      
      So we've ended up with `git_commit_signing_cb`.
      Tyler Wanek committed
    • Single callback for commit signing in rebase w/ git_buf · 578cc029
      Reduces the number of callbacks for signing a commit during a rebase operation to just one callback. That callback has 2 out git_buf parameters for signature and signature field. We use git_buf here, because we cannot make any assumptions about the heap allocator a user of the library might be using.
      Tyler Wanek committed
    • Add signing callbacks for git_rebase_commit in git_rebase_options · 546e40c9
      2 callbacks have been added to git_rebase_options, git_rebase_commit_signature_cb and git_rebase_commit_signature_field_cb. When git_rebase_commit_signature_cb is present in git_rebase_options, it will be called whenever git_rebase_commit is performed, giving an opportunity to sign the commit. The signing procedure can be skipped if the callback specifies passthrough as the error. The git_rebase_commit_signature_field_cb will only be called if the other callback is present or did not passthrough, and it provides means to specify which field a signature is for.
      Git_rebase_options was chosen as the home for these callbacks as it keeps backwards compatibility with the current rebase api.
      Tyler Wanek committed
  17. 22 Jan, 2019 1 commit
  18. 01 Dec, 2018 1 commit
  19. 18 Oct, 2018 1 commit
  20. 10 Jun, 2018 1 commit
  21. 26 Mar, 2018 1 commit
  22. 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
  23. 03 Mar, 2017 1 commit
    • rebase: ignore untracked files in submodules · 2270ca9f
      An untracked file in a submodule should not prevent a rebase from
      starting.  Even if the submodule's SHA is changed, and that file would
      conflict with a new tracked file, it's still OK to start the rebase
      and discover the conflict later.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      David Turner committed
  24. 28 Feb, 2017 1 commit
  25. 13 Feb, 2017 1 commit
    • repository: rename `path_repository` and `path_gitlink` · 84f56cb0
      The `path_repository` variable is actually confusing to think
      about, as it is not always clear what the repository actually is.
      It may either be the path to the folder containing worktree and
      .git directory, the path to .git itself, a worktree or something
      entirely different. Actually, the intent of the variable is to
      hold the path to the gitdir, which is either the .git directory
      or the bare repository.
      
      Rename the variable to `gitdir` to avoid confusion. While at it,
      also rename `path_gitlink` to `gitlink` to improve consistency.
      Patrick Steinhardt committed
  26. 29 Dec, 2016 2 commits
  27. 02 Dec, 2016 1 commit
  28. 06 Oct, 2016 1 commit
  29. 01 Jun, 2016 1 commit
    • rebase: change assertion to avoid · 4505a42a
      It looks like we're getting the operation and not doing anything
      with it, when in fact we are asserting that it's not null.  Simply
      assert that we are within the operation boundary instead of using
      the `git_array_get` macro to do this for us.
      Edward Thomson committed
  30. 03 May, 2016 1 commit
  31. 21 Apr, 2016 2 commits
  32. 23 Feb, 2016 1 commit
  33. 15 Feb, 2016 1 commit
  34. 11 Feb, 2016 1 commit