1. 05 Apr, 2017 1 commit
  2. 02 Mar, 2017 1 commit
  3. 13 Feb, 2017 4 commits
  4. 20 Jan, 2017 1 commit
    • Allow for caching of submodules. · 4d99c4cf
      Added `git_repository_submodule_cache_all` to initialze a cache of
      submodules on the repository so that operations looking up N
      submodules are O(N) and not O(N^2).  Added a
      `git_repository_submodule_cache_clear` function to remove the cache.
      
      Also optimized the function that loads all submodules as it was itself
      O(N^2) w.r.t the number of submodules, having to loop through the
      `.gitmodules` file once per submodule.  I changed it to process the
      `.gitmodules` file once, into a map.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      Brock Peabody committed
  5. 29 Dec, 2016 1 commit
  6. 22 Jun, 2015 1 commit
    • submodule: remove the per-repo cache · dfda2f68
      Having this cache and giving them out goes against our multithreading
      guarantees and it makes it impossible to use submodules in a
      multi-threaded environment, as any thread can ask for a refresh which
      may reallocate some string in the submodule struct which we've accessed
      in a different one via a getter.
      
      This makes the submodules behave more like remotes, where each object is
      created upon request and not shared except explicitly by the user. This
      means that some tests won't pass yet, as they assume they can affect the
      submodule objects in the cache and that will affect later operations.
      Carlos Martín Nieto committed
  7. 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
  8. 27 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. 17 Dec, 2014 1 commit
  11. 16 Dec, 2014 1 commit
    • checkout: disallow bad paths on win32 · a64119e3
      Disallow:
       1. paths with trailing dot
       2. paths with trailing space
       3. paths with trailing colon
       4. paths that are 8.3 short names of .git folders ("GIT~1")
       5. paths that are reserved path names (COM1, LPT1, etc).
       6. paths with reserved DOS characters (colons, asterisks, etc)
      
      These paths would (without \\?\ syntax) be elided to other paths - for
      example, ".git." would be written as ".git".  As a result, writing these
      paths literally (using \\?\ syntax) makes them hard to operate with from
      the shell, Windows Explorer or other tools.  Disallow these.
      Edward Thomson committed
  12. 05 Dec, 2014 1 commit
  13. 27 Oct, 2014 1 commit
  14. 13 May, 2014 1 commit
  15. 17 Apr, 2014 1 commit
  16. 08 Apr, 2014 1 commit
  17. 01 Apr, 2014 1 commit
  18. 02 Dec, 2013 1 commit
  19. 03 Oct, 2013 1 commit
  20. 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
  21. 30 Apr, 2013 1 commit
  22. 23 Apr, 2013 1 commit
    • Add configs to repo config cache · ab01cbd4
      This adds a bunch of additional config values to the repository
      config value cache and makes it easier to add a simple boolean
      config without creating enum values for each possible setting.
      
      Also, this fixes a bug in git_config_refresh where the config
      cache was not being cleared which could lead to potential
      incorrect values.
      
      The work to start using the new cached configs will come in the
      next couple of commits...
      Russell Belfer committed
  23. 22 Apr, 2013 2 commits
    • Add git__compare_and_swap and use it · e976b56d
      This removes the lock from the repository object and changes the
      internals to use the new atomic git__compare_and_swap to update
      the _odb, _config, _index, and _refdb variables in a threadsafe
      manner.
      Russell Belfer committed
    • Further threading fixes · 53607868
      This builds on the earlier thread safety work to make it so that
      setting the odb, index, refdb, or config for a repository is done
      in a threadsafe manner with minimized locking time.  This is done
      by adding a lock to the repository object and using it to guard
      the assignment of the above listed pointers.  The lock is only
      held to assign the pointer value.
      
      This also contains some minor fixes to the other work with pack
      files to reduce the time that locks are being held to and fix an
      apparently memory leak.
      Russell Belfer committed
  24. 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
  25. 07 Mar, 2013 1 commit
  26. 08 Jan, 2013 1 commit
  27. 10 Sep, 2012 1 commit
    • Reorg internal odb read header and object lookup · c6ac28fd
      Often `git_odb_read_header` will "fail" and have to read the
      entire object into memory instead of just the header.  When this
      happens, the object is loaded and then disposed of immediately,
      which makes it difficult to efficiently use the header information
      to decide if the object should be loaded (since attempting to do
      so will often result in loading the object twice).
      
      This commit takes the existing code and reorganizes it to have
      two new functions:
      
      - `git_odb__read_header_or_object` which acts just like the old
        read header function except that it returns the object, too, if
        it was forced to load the whole thing.  It then becomes the
        callers responsibility to free the `git_odb_object`.
      - `git_object__from_odb_object` which was extracted from the old
        `git_object_lookup` and creates a subclass of `git_object` from
        an existing `git_odb_object` (separating the ODB lookup from the
        `git_object` creation).  This allows you to use the first header
        reading function efficiently without instantiating the
        `git_odb_object` twice.
      
      There is no net change to the behavior of any of the existing
      functions, but this allows internal code to tap into the ODB
      lookup and object creation to be more efficient.
      Russell Belfer committed
  28. 06 Sep, 2012 1 commit
  29. 22 Aug, 2012 2 commits
    • Add template dir and set gid to repo init · ca1b6e54
      This extends git_repository_init_ext further with support for
      initializing the repository from an external template directory
      and with support for the "create shared" type flags that make a
      set GID repository directory.
      
      This also adds tests for much of the new functionality to the
      existing `repo/init.c` test suite.
      
      Also, this adds a bunch of new utility functions including a
      very general purpose `git_futils_mkdir` (with the ability to
      make paths and to chmod the paths post-creation) and a file
      tree copying function `git_futils_cp_r`.  Also, this includes
      some new path functions that were useful to keep the code
      simple.
      Russell Belfer committed
    • Add git_repository_init_ext for power initters · 662880ca
      The extended version of repository init adds support for many
      of the things that you can do with `git init` and sets up
      structures that will make it easier to extend further in the
      future.
      Russell Belfer committed
  30. 17 Jul, 2012 1 commit
  31. 03 May, 2012 1 commit
    • Support reading attributes from index · f917481e
      Depending on the operation, we need to consider gitattributes
      in both the work dir and the index.  This adds a parameter to
      all of the gitattributes related functions that allows user
      control of attribute reading behavior (i.e. prefer workdir,
      prefer index, only use index).
      
      This fix also covers allowing us to check attributes (and
      hence do diff and status) on bare repositories.
      
      This was a somewhat larger change that I hoped because it had
      to change the cache key used for gitattributes files.
      Russell Belfer committed
  32. 25 Apr, 2012 2 commits
    • Rename git_khash_str to git_strmap, etc. · c2b67043
      This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
      `git_oidmap`, and deletes `git_hashtable` from the tree, plus
      adds unit tests for `git_strmap`.
      Russell Belfer committed
    • Convert hashtable usage over to khash · 01fed0a8
      This updates khash.h with some extra features (like error checking
      on allocations, ability to use wrapped malloc, foreach calls, etc),
      creates two high-level wrappers around khash: `git_khash_str` and
      `git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
      then converts all of the old usage of `git_hashtable` over to use
      these new hashtables.
      
      For `git_khash_str`, I've tried to create a set of macros that
      yield an API not too unlike the old `git_hashtable` API.  Since
      the oid hashtable is only used in one file, I haven't bother to
      set up all those macros and just use the khash APIs directly for
      now.
      Russell Belfer committed
  33. 30 Mar, 2012 1 commit
  34. 28 Mar, 2012 1 commit
    • Added submodule API and use in status · bfc9ca59
      When processing status for a newly checked out repo, it is
      possible that there will be submodules that have not yet been
      initialized.  The only way to distinguish these from untracked
      directories is to have some knowledge of submodules.  This
      commit adds a new submodule API which, given a name or path,
      can determine if it appears to be a submodule and can give
      information about the submodule.
      Russell Belfer committed