1. 27 Aug, 2021 1 commit
  2. 11 May, 2021 1 commit
  3. 22 Nov, 2019 1 commit
  4. 20 Jul, 2019 1 commit
  5. 18 Jul, 2019 1 commit
  6. 16 Jun, 2019 1 commit
  7. 22 Jan, 2019 1 commit
  8. 07 Jan, 2019 1 commit
  9. 04 Dec, 2018 1 commit
    • crlf: update to match git's logic · ef8f8ec6
      Examine the recent CRLF changes to git by Torsten Bögershausen and
      include similar changes to update our CRLF logic to match.
      
      Note: Torsten Bögershausen has previously agreed to allow his changes to
      be included in libgit2.
      Edward Thomson committed
  10. 17 Apr, 2018 2 commits
  11. 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
  12. 29 Dec, 2016 1 commit
  13. 24 Jul, 2016 1 commit
  14. 23 Feb, 2016 1 commit
    • crlf: do not ignore GIT_PASSTHROUGH error · 2129d6df
      When no payload is set for `crlf_apply` we try to compute the
      crlf attributes ourselves with `crlf_check`. When the function
      determines that the current file does not require any treatment
      we return the GIT_PASSTHROUGH error code without actually
      allocating the out-pointer, which indicates the file should not
      be passed through the filter.
      
      The `crlf_apply` function explicitly checks for the
      GIT_PASSTHROUGH return code and ignores it. This means we will
      try to apply the crlf-filter to the current file, leading us to
      dereference the unallocated payload-pointer.
      
      Fix this obviously incorrect behavior by not treating
      GIT_PASSTHROUGH in any special way. This is the correct thing to
      do anyway, as the code indicates that the file should not be
      passed through the filter.
      Patrick Steinhardt committed
  15. 22 Jun, 2015 2 commits
  16. 19 Feb, 2015 1 commit
  17. 30 Dec, 2014 1 commit
  18. 24 Jun, 2014 1 commit
  19. 19 May, 2014 2 commits
  20. 06 May, 2014 1 commit
    • Add filter options and ALLOW_UNSAFE · 5269008c
      Diff and status do not want core.safecrlf to actually raise an
      error regardless of the setting, so this extends the filter API
      with an additional options flags parameter and adds a flag so that
      filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating
      that unsafe filter application should be downgraded from a failure
      to a warning.
      Russell Belfer committed
  21. 08 Apr, 2014 2 commits
  22. 12 Feb, 2014 1 commit
  23. 09 Feb, 2014 1 commit
  24. 25 Jan, 2014 1 commit
  25. 24 Sep, 2013 1 commit
  26. 17 Sep, 2013 11 commits
    • Bug fixes and cleanups · eefc32d5
      This contains a few bug fixes and some header and API cleanups.
      
      The main API change is that filters should now use GIT_PASSTHROUGH
      to indicate that they wish to skip processing a file instead of
      GIT_ENOTFOUND.
      
      The bug fixes include a possible out-of-range buffer access in
      the ident filter, a filter ordering problem I introduced into the
      custom filter tests on Windows, and a filter buf NUL termination
      issue that was coming up on Linux.
      Russell Belfer committed
    • Move binary check to CRLF filter itself · 0e32635f
      Checkout should not reject binary files from filters, as a filter
      may actually wish to operate on binary files.  The CRLF filter should
      reject binary files itself if it wishes to.  Moreover, the CRLF
      filter requires this logic so that users can emulate the checkout
      data in their odb -> workdir filtering.
      
      Conflicts:
      	src/checkout.c
      	src/crlf.c
      Russell Belfer committed
    • Merge git_buf and git_buffer · a9f51e43
      This makes the git_buf struct that was used internally into an
      externally available structure and eliminates the git_buffer.
      
      As part of that, some of the special cases that arose with the
      externally used git_buffer were blended into the git_buf, such as
      being careful about git_buf objects that may have a NULL ptr and
      allowing for bufs with a valid ptr and size but zero asize as a
      way of referring to externally owned data.
      Russell Belfer committed
    • Add ident filter · 4b11f25a
      This adds the ident filter (that knows how to replace $Id$) and
      tweaks the filter APIs and code so that git_filter_source objects
      actually have the updated OID of the object being filtered when
      it is a known value.
      Russell Belfer committed
    • Add functions to manipulate filter lists · 40cb40fa
      Extend the git2/sys/filter API with functions to look up a filter
      and add it manually to a filter list.  This requires some trickery
      because the regular attribute lookups and checks are bypassed when
      this happens, but in the right hands, it will allow a user to have
      granular control over applying filters.
      Russell Belfer committed
    • Update filter registry code · 0646634e
      This updates the git filter registry to be a little cleaner and
      plugs some memory leaks.
      Russell Belfer committed
    • Extend public filter api with filter lists · 2a7d224f
      This moves the git_filter_list into the public API so that users
      can create, apply, and dispose of filter lists.  This allows more
      granular application of filters to user data outside of libgit2
      internals.
      
      This also converts all the internal usage of filters to the public
      APIs along with a few small tweaks to make it easier to use the
      public git_buffer stuff alongside the internal git_buf.
      Russell Belfer committed
    • Add attributes to filters and fix registry · 974774c7
      The filter registry as implemented was too primitive to actually
      work once multiple filters were coming into play.  This expands
      the implementation of the registry to handle multiple prioritized
      filters correctly.
      
      Additionally, this adds an "attributes" field to a filter that
      makes it really really easy to implement filters that are based
      on one or more attribute values.  The lookup and even simple value
      checking can all happen automatically without custom filter code.
      
      Lastly, with the registry improvements, this fills out the filter
      lifecycle callbacks, with initialize and shutdown callbacks that
      will be called before the filter is first used and after it is
      last invoked.  This allows for system-wide initialization and
      cleanup by the filter.
      Russell Belfer committed
    • Create public filter object and use it · 85d54812
      This creates include/sys/filter.h with a basic definition of a
      git_filter and then converts the internal code to use it.  There
      are related internal objects (git_filter_list) that we will want
      to publish at some point, but this is a first step.
      Russell Belfer committed
    • Start of filter API + git_blob_filtered_content · 0cf77103
      This begins the process of exposing git_filter objects to the
      public API.  This includes:
      
      * new public type and API for `git_buffer` through which an
        allocated buffer can be passed to the user
      * new API `git_blob_filtered_content`
      * make the git_filter type and GIT_FILTER_TO_... constants public
      Russell Belfer committed