1. 23 Feb, 2022 1 commit
  2. 09 Nov, 2021 1 commit
  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. 18 Oct, 2019 2 commits
    • refdb_fs: properly parse corrupted reflogs · 7968e90f
      In previous versions, libgit2 could be coerced into writing reflog
      messages with embedded newlines into the reflog by using
      `git_stash_save` with a message containing newlines. While the root
      cause is fixed now, it was noticed that upstream git is in fact able to
      read such corrupted reflog messages just fine.
      
      Make the reflog parser more lenient in order to just skip over
      malformatted reflog lines to bring us in line with git. This requires us
      to change an existing test that verified that we do indeed _fail_ to
      parse such logs.
      Patrick Steinhardt committed
    • reflog: allow adding entries with newlines in their message · d8233feb
      Currently, the reflog disallows any entries that have a message with
      newlines, as that would effectively break the reflog format, which may
      contain a single line per entry, only. Upstream git behaves a bit
      differently, though, especially when considering stashes: instead of
      rejecting any reflog entry with newlines, git will simply replace
      newlines with spaces. E.g. executing 'git stash push -m "foo\nbar"' will
      create a reflog entry with "foo bar" as entry message.
      
      This commit adjusts our own logic to stop rejecting commit messages with
      newlines. Previously, this logic was part of `git_reflog_append`, only.
      There is a second place though where we add reflog entries, which is the
      serialization code in the filesystem refdb. As it didn't contain any
      sanity checks whatsoever, the refdb would have been perfectly happy to
      write malformatted reflog entries to the disk. This is being fixed with
      the same logic as for the reflog itself.
      Patrick Steinhardt committed
  5. 20 Jul, 2019 1 commit
  6. 22 Jan, 2019 1 commit
  7. 18 Nov, 2018 1 commit
  8. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  9. 10 Jun, 2018 1 commit
  10. 14 Nov, 2017 1 commit
  11. 28 Feb, 2017 1 commit
  12. 29 Dec, 2016 1 commit
  13. 12 Nov, 2015 1 commit
  14. 03 Nov, 2015 1 commit
  15. 29 Oct, 2015 1 commit
  16. 03 Mar, 2015 1 commit
    • Remove the signature from ref-modifying functions · 659cf202
      The signature for the reflog is not something which changes
      dynamically. Almost all uses will be NULL, since we want for the
      repository's default identity to be used, making it noise.
      
      In order to allow for changing the identity, we instead provide
      git_repository_set_ident() and git_repository_ident() which allow a user
      to override the choice of signature.
      Carlos Martín Nieto committed
  17. 20 Mar, 2014 1 commit
  18. 19 Mar, 2014 1 commit
  19. 17 Mar, 2014 1 commit
  20. 30 Jan, 2014 1 commit
  21. 15 Jan, 2014 1 commit
  22. 09 Dec, 2013 3 commits
  23. 23 Nov, 2013 2 commits
    • reflog: remove git_reflog_append_to() · 13c9e44a
      This was a convenience method for the refs front-end to do the reflog
      writing. This is now done in the backend and it has no more reason for
      being.
      Carlos Martín Nieto committed
    • reflog: integrate into the ref writing · a57dd3b7
      Whenever a reference is created or updated, we need to write to the
      reflog regardless of whether the user gave us a message, so we shouldn't
      leave that to the ref frontend, but integrate it into the backend.
      
      This also eliminates the race between ref update and writing to the
      reflog, as we protect the reflog with the ref lock.
      
      As an additional benefit, this reflog append on the backend happens by
      appending to the file instead of parsing and rewriting it.
      Carlos Martín Nieto committed
  24. 14 Nov, 2013 1 commit
  25. 02 Oct, 2013 2 commits
  26. 10 Jun, 2013 1 commit
    • Reorganize diff and add basic diff driver · 114f5a6c
      This is a significant reorganization of the diff code to break it
      into a set of more clearly distinct files and to document the new
      organization.  Hopefully this will make the diff code easier to
      understand and to extend.
      
      This adds a new `git_diff_driver` object that looks of diff driver
      information from the attributes and the config so that things like
      function content in diff headers can be provided.  The full driver
      spec is not implemented in the commit - this is focused on the
      reorganization of the code and putting the driver hooks in place.
      
      This also removes a few #includes from src/repository.h that were
      overbroad, but as a result required extra #includes in a variety
      of places since including src/repository.h no longer results in
      pulling in the whole world.
      Russell Belfer committed
  27. 07 Mar, 2013 1 commit
  28. 01 Dec, 2012 1 commit
  29. 27 Nov, 2012 2 commits
  30. 18 Nov, 2012 1 commit
  31. 25 Jul, 2012 4 commits