1. 27 Aug, 2021 1 commit
  2. 22 Jul, 2021 2 commits
    • filter: add git_filter_options · d7e8b934
      Allow filter users to provide an options structure instead of simply
      flags.  This allows for future growth for filter options.
      Edward Thomson committed
    • filter: filter options are now "filter sessions" · 1db5b219
      Filters use a short-lived structure to keep state during an operation to
      allow for caching and avoid unnecessary reallocations.  This was
      previously called the "filter options", despite the fact that they
      contain no configurable options.  Rename them to a "filter session" in
      keeping with an "attribute session", which more accurately describes
      their use (and allows us to create "filter options" in the future).
      Edward Thomson committed
  3. 06 May, 2021 1 commit
    • filter: internal git_buf filter handling function · 31d9c24b
      Introduce `git_filter_list__convert_buf` which behaves like the old
      implementation of `git_filter_list__apply_data`, where it might move the
      input data buffer over into the output data buffer space for efficiency.
      
      This new implementation will do so in a more predictible way, always
      freeing the given input buffer (either moving it to the output buffer or
      filtering it into the output buffer first).
      
      Convert internal users to it.
      Edward Thomson committed
  4. 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
  5. 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
  6. 09 Feb, 2016 1 commit
  7. 19 Feb, 2015 3 commits
  8. 17 Feb, 2015 1 commit
  9. 03 Feb, 2015 1 commit
    • attrcache: don't re-read attrs during checkout · 9f779aac
      During checkout, assume that the .gitattributes files aren't
      modified during the checkout.  Instead, create an "attribute session"
      during checkout.  Assume that attribute data read in the same
      checkout "session" hasn't been modified since the checkout started.
      (But allow subsequent checkouts to invalidate the cache.)
      
      Further, cache nonexistent git_attr_file data even when .gitattributes
      files are not found to prevent re-scanning for nonexistent files.
      Edward Thomson committed
  10. 16 May, 2014 1 commit
  11. 17 Sep, 2013 4 commits
    • 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
    • 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
    • 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
  12. 25 Mar, 2013 1 commit
    • Move crlf conversion into buf_text · 3658e81e
      This adds crlf/lf conversion functions into buf_text with more
      efficient implementations that bypass the high level buffer
      functions.  They attempt to minimize the number of reallocations
      done and they directly write the buffer data as needed if they
      know that there is enough memory allocated to memcpy data.
      
      Tests are added for these new functions.  The crlf.c code is
      updated to use the new functions.
      
      Removed the include of buf_text.h from filter.h and just include
      it more narrowly in the places that need it.
      Russell Belfer committed
  13. 08 Jan, 2013 1 commit
  14. 28 Nov, 2012 1 commit
    • Consolidate text buffer functions · 7bf87ab6
      There are many scattered functions that look into the contents of
      buffers to do various text manipulations (such as escaping or
      unescaping data, calculating text stats, guessing if content is
      binary, etc).  This groups all those functions together into a
      new file and converts the code to use that.
      
      This has two enhancements to existing functionality.  The old
      text stats function is significantly rewritten and the BOM
      detection code was extended (although largely we can't deal with
      anything other than a UTF8 BOM).
      Russell Belfer committed
  15. 17 Sep, 2012 2 commits
  16. 16 Jul, 2012 1 commit
  17. 10 Jul, 2012 1 commit
  18. 17 May, 2012 1 commit
  19. 02 Mar, 2012 1 commit
  20. 01 Mar, 2012 2 commits
  21. 29 Feb, 2012 1 commit
  22. 28 Feb, 2012 1 commit
  23. 27 Feb, 2012 1 commit
    • filter: Apply filters before writing a file to the ODB · 44b1ff4c
      Initial implementation. The relevant code is in `blob.c`: the blob write
      function has been split into smaller functions.
      
      	- Directly write a file to the ODB in streaming mode
      
      	- Directly write a symlink to the ODB in direct mode
      
      	- Apply a filter, and write a file to the ODB in direct mode
      
      When trying to write a file, we first call `git_filter__load_for_file`,
      which populates a filters array with the required filters based on the
      filename.
      
      If no filters are resolved to the filename, we can write to the ODB in
      streaming mode straight from disk. Otherwise, we load the whole file in
      memory and use double-buffering to apply the filter chain. We finish
      by writing the file as a whole to the ODB.
      Vicent Martí committed