1. 17 Feb, 2017 2 commits
  2. 13 Feb, 2017 1 commit
    • repository: use `git_repository_item_path` · c5f3da96
      The recent introduction of the commondir variable of a repository
      requires callers to distinguish whether their files are part of
      the dot-git directory or the common directory shared between
      multpile worktrees. In order to take the burden from callers and
      unify knowledge on which files reside where, the
      `git_repository_item_path` function has been introduced which
      encapsulate this knowledge.
      
      Modify most existing callers of `git_repository_path` to use
      `git_repository_item_path` instead, thus making them implicitly
      aware of the common directory.
      Patrick Steinhardt committed
  3. 12 May, 2015 1 commit
  4. 28 Apr, 2015 1 commit
  5. 19 Feb, 2015 1 commit
  6. 15 Feb, 2015 1 commit
  7. 04 Feb, 2015 2 commits
  8. 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
  9. 17 Sep, 2014 3 commits
  10. 16 Sep, 2014 2 commits
    • Fix attribute lookup in index for bare repos · 1fbeb2f0
      When using a bare repo with an index, libgit2 attempts to read
      files from the index.  It caches those files based on the path
      to the file, specifically the path to the directory that contains
      the file.
      
      If there is no working directory, we use `git_path_dirname_r` to
      get the path to the containing directory.  However, for the
      `.gitattributes` file in the root of the repository, this ends up
      normalizing the containing path to `"."` instead of the empty
      string and the lookup the `.gitattributes` data fails.
      
      This adds a test of attribute lookups on bare repos and also
      fixes the problem by simply rewriting `"."` to be `""`.
      Russell Belfer committed
  11. 18 Apr, 2014 2 commits
    • Minor fixes · ac16bd0a
      Only apply LEADING_DIR pattern munging to patterns in ignore and
      attribute files, not to pathspecs used to select files to operate
      on.  Also, allow internal macro definitions to be evaluated before
      loading all external ones (important so that external ones can
      make use of internal `binary` definition).
      Russell Belfer committed
    • Preload attribute files that may contain macros · e3a2a04c
      There was a latent bug where files that use macro definitions
      could be parsed before the macro definitions were loaded.  Because
      of attribute file caching, preloading files that are going to be
      used doesn't add a significant amount of overhead, so let's always
      preload any files that could contain macros before we assemble the
      actual vector of files to scan for attributes.
      Russell Belfer committed
  12. 17 Apr, 2014 4 commits
  13. 25 Feb, 2014 1 commit
  14. 30 Jan, 2014 1 commit
  15. 25 Jan, 2014 1 commit
  16. 11 Dec, 2013 6 commits
    • Some callback error check style cleanups · c7b3e1b3
      I find this easier to read...
      Russell Belfer committed
    • Remove converting user error to GIT_EUSER · 25e0b157
      This changes the behavior of callbacks so that the callback error
      code is not converted into GIT_EUSER and instead we propagate the
      return value through to the caller.  Instead of using the
      giterr_capture and giterr_restore functions, we now rely on all
      functions to pass back the return value from a callback.
      
      To avoid having a return value with no error message, the user
      can call the public giterr_set_str or some such function to set
      an error message.  There is a new helper 'giterr_set_callback'
      that functions can invoke after making a callback which ensures
      that some error message was set in case the callback did not set
      one.
      
      In places where the sign of the callback return value is
      meaningful (e.g. positive to skip, negative to abort), only the
      negative values are returned back to the caller, obviously, since
      the other values allow for continuing the loop.
      
      The hardest parts of this were in the checkout code where positive
      return values were overloaded as meaningful values for checkout.
      I fixed this by adding an output parameter to many of the internal
      checkout functions and removing the overload.  This added some
      code, but it is probably a better implementation.
      
      There is some funkiness in the network code where user provided
      callbacks could be returning a positive or a negative value and
      we want to rely on that to cancel the loop.  There are still a
      couple places where an user error might get turned into GIT_EUSER
      there, I think, though none exercised by the tests.
      Russell Belfer committed
    • Further EUSER and error propagation fixes · dab89f9b
      This continues auditing all the places where GIT_EUSER is being
      returned and making sure to clear any existing error using the
      new giterr_user_cancel helper.  As a result, places that relied
      on intercepting GIT_EUSER but having the old error preserved also
      needed to be cleaned up to correctly stash and then retrieve the
      actual error.
      
      Additionally, as I encountered places where error codes were not
      being propagated correctly, I tried to fix them up.  A number of
      those fixes are included in the this commit as well.
      Russell Belfer committed
    • Improve GIT_EUSER handling · 96869a4e
      This adds giterr_user_cancel to return GIT_EUSER and clear any
      error message that is sitting around.  As a result of using that
      in places, we need to be more thorough with capturing errors that
      happen inside a callback when used internally.  To help with that,
      this also adds giterr_capture and giterr_restore so that when we
      internally use a foreach-type function that clears errors and
      converts them to GIT_EUSER, it is easier to restore not just the
      return value, but the actual error message text.
      Russell Belfer committed
    • Add config read fns with controlled error behavior · 9f77b3f6
      This adds `git_config__lookup_entry` which will look up a key in
      a config and return either the entry or NULL if the key was not
      present.  Optionally, it can either suppress all errors or can
      return them (although not finding the key is not an error for this
      function).  Unlike other accessors, this does not normalize the
      config key string, so it must only be used when the key is known
      to be in normalized form (i.e. all lower-case before the first dot
      and after the last dot, with no invalid characters).
      
      This also adds three high-level helper functions to look up config
      values with no errors and a fallback value.  The three functions
      are for string, bool, and int values, and will resort to the
      fallback value for any error that arises.  They are:
      
      * `git_config__get_string_force`
      * `git_config__get_bool_force`
      * `git_config__get_int_force`
      
      None of them normalize the config `key` either, so they can only
      be used for internal cases where the key is known to be in normal
      format.
      Russell Belfer committed
  17. 28 Oct, 2013 1 commit
    • The "common.h" should be included before "config.h". · 157cef10
      When building libgit2 for ia32 architecture on a x64 machine, including
      "config.h" without a "common.h" would result the following error:
      C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2288): error C2373: 'InterlockedIncrement' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj]
      C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2295): error C2373: 'InterlockedDecrement' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj]
      C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2303): error C2373: 'InterlockedExchange' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj]
      C:\Program Files\Microsoft SDKs\Windows\v7.1\include\winbase.h(2314): error C2373: 'InterlockedExchangeAdd' : redefinition; different type modifiers [C:\cygwin\home\zcbenz\codes\git-utils\build\libgit2.vcxproj]
      Cheng Zhao committed
  18. 17 Sep, 2013 1 commit
    • 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
  19. 24 May, 2013 1 commit
    • Add ~ expansion to global attributes and excludes · 7a5ee3dc
      This adds ~/ prefix expansion for the value of core.attributesfile
      and core.excludesfile, plus it fixes the fact that the attributes
      cache was holding on to the string data from the config for a long
      time (instead of making its own strdup) which could have caused a
      problem if the config was refreshed.  Adds a test for the new
      expansion capability.
      Russell Belfer committed
  20. 15 May, 2013 1 commit
  21. 29 Apr, 2013 1 commit
  22. 15 Mar, 2013 1 commit
    • Implement global/system file search paths · 5540d947
      The goal of this work is to expose the search logic for "global",
      "system", and "xdg" files through the git_libgit2_opts() interface.
      
      Behind the scenes, I changed the logic for finding files to have a
      notion of a git_strarray that represents a search path and to store
      a separate search path for each of the three tiers of config file.
      For each tier, I implemented a function to initialize it to default
      values (generally based on environment variables), and then general
      interfaces to get it, set it, reset it, and prepend new directories
      to it.
      
      Next, I exposed these interfaces through the git_libgit2_opts
      interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
      for the user to control which search path they were modifying.
      There are alternative designs for the opts interface / argument
      ordering, so I'm putting this phase out for discussion.
      
      Additionally, I ended up doing a little bit of clean up regarding
      attr.h and attr_file.h, adding a new attrcache.h so the other two
      files wouldn't have to be included in so many places.
      Russell Belfer committed
  23. 22 Feb, 2013 1 commit
  24. 27 Jan, 2013 1 commit
  25. 04 Jan, 2013 1 commit
  26. 27 Nov, 2012 1 commit