1. 21 Oct, 2015 1 commit
  2. 12 Aug, 2015 1 commit
  3. 22 Jun, 2015 1 commit
  4. 03 Mar, 2015 1 commit
    • config: borrow refcounted references · 9a97f49e
      This changes the get_entry() method to return a refcounted version of
      the config entry, which you have to free when you're done.
      
      This allows us to avoid freeing the memory in which the entry is stored
      on a refresh, which may happen at any time for a live config.
      
      For this reason, get_string() has been forbidden on live configs and a
      new function get_string_buf() has been added, which stores the string in
      a git_buf which the user then owns.
      
      The functions which parse the string value takea advantage of the
      borrowing to parse safely and then release the entry.
      Carlos Martín Nieto committed
  5. 13 May, 2014 1 commit
  6. 01 Apr, 2014 1 commit
    • Fix git_submodule_sync and add new config helper · 8286300a
      This fixes `git_submodule_sync` to correctly update the remote URL
      of the default branch of the submodule along with the URL in the
      parent repository config (i.e. match core Git's behavior).
      
      Also move some useful helper logic from the submodule code into
      a shared config API `git_config__update_entry` that can either set
      or delete an entry with constraints like not overwriting or not
      creating a new entry.  I used that helper to update a couple other
      places in the code.
      Russell Belfer committed
  7. 27 Jan, 2014 1 commit
  8. 11 Dec, 2013 1 commit
    • 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
  9. 04 Oct, 2013 1 commit
    • Add git_repository_reset_filesystem and fix tests · 5173ea92
      When a repository is transferred from one file system to another,
      many of the config settings that represent the properties of the
      file system may be wrong.  This adds a new public API that will
      refresh the config settings of the repository to account for the
      change of file system.  This doesn't do a full "reinitialize" and
      operates on a existing git_repository object refreshing the config
      when done.
      
      This commit then makes use of the new API in clar as each test
      repository is set up.
      
      This commit also has a number of other clar test fixes where we
      were making assumptions about the type of filesystem, either based
      on outdated config data or based on the OS instead of the FS.
      Russell Belfer committed
  10. 13 Aug, 2013 1 commit
  11. 08 Aug, 2013 3 commits
  12. 07 May, 2013 1 commit
    • repo: unconditionally create a global config backend · a4b75dcf
      When a repository is initialised, we need to probe to see if there is
      a global config to load. If this is not the case, the user isn't able
      to write to the global config without creating the backend and adding
      it themselves, which is inconvenient and overly complex.
      
      Unconditionally create and add a backend for the global config file
      regardless of whether it exists as a convenience for users.
      
      To enable this, we allow creating backends to files that do not exist
      yet, changing the semantics somewhat, and making some tests invalid.
      Carlos Martín Nieto committed
  13. 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
  14. 08 Jan, 2013 1 commit
  15. 27 Nov, 2012 1 commit
  16. 17 Nov, 2012 1 commit
  17. 25 Oct, 2012 1 commit
  18. 23 Oct, 2012 1 commit
    • Add config level support in the config API · a1abe66a
      Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found.
      Added `git_config_open_level`: build a single-level focused config object from a multi-level one.
      
      We are now storing `git_config_entry`s in the khash of the config_file
      yorah committed
  19. 02 Oct, 2012 1 commit
  20. 29 Sep, 2012 1 commit
  21. 24 Aug, 2012 1 commit
  22. 30 Mar, 2012 1 commit
  23. 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
  24. 13 Feb, 2012 1 commit
  25. 29 Dec, 2011 1 commit
    • Add support for macros and cache flush API. · 73b51450
      Add support for git attribute macro definitions.  Also, add
      support for cache flush API to clear the attribute file content
      cache when needed.
      
      Additionally, improved the handling of global and system files,
      making common utility functions in fileops and converting config
      and attr to both use the common functions.
      
      Adds a bunch more tests and fixed some memory leaks.  Note that
      adding macros required me to use refcounted attribute assignment
      definitions, which complicated, but probably improved memory usage.
      Russell Belfer committed
  26. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      This converts virtually all of the places that allocate GIT_PATH_MAX
      buffers on the stack for manipulating paths to use git_buf objects
      instead.  The patch is pretty careful not to touch the public API
      for libgit2, so there are a few places that still use GIT_PATH_MAX.
      
      This extends and changes some details of the git_buf implementation
      to add a couple of extra functions and to make error handling easier.
      
      This includes serious alterations to all the path.c functions, and
      several of the fileops.c ones, too.  Also, there are a number of new
      functions that parallel existing ones except that use a git_buf
      instead of a stack-based buffer (such as git_config_find_global_r
      that exists alongsize git_config_find_global).
      
      This also modifies the win32 version of p_realpath to allocate whatever
      buffer size is needed to accommodate the realpath instead of hardcoding
      a GIT_PATH_MAX limit, but that change needs to be tested still.
      Russell Belfer committed
  27. 26 Nov, 2011 1 commit
    • repository: Change ownership semantics · 9462c471
      The ownership semantics have been changed all over the library to be
      consistent. There are no more "borrowed" or duplicated references.
      
      Main changes:
      
      	- `git_repository_open2` and `3` have been dropped.
      
      	- Added setters and getters to hotswap all the repository owned
      	objects:
      
      		`git_repository_index`
      		`git_repository_set_index`
      		`git_repository_odb`
      		`git_repository_set_odb`
      		`git_repository_config`
      		`git_repository_set_config`
      		`git_repository_workdir`
      		`git_repository_set_workdir`
      
      	Now working directories/index files/ODBs and so on can be
      	hot-swapped after creating a repository and between operations.
      
      	- All these objects now have proper ownership semantics with
      	refcounting: they all require freeing after they are no longer
      	needed (the repository always keeps its internal reference).
      
      	- Repository open and initialization has been updated to keep in
      	mind the configuration files. Bare repositories are now always
      	detected, and a default config file is created on init.
      
      	- All the tests affected by these changes have been dropped from the
      	old test suite and ported to the new one.
      Vicent Marti committed
  28. 14 Oct, 2011 1 commit
    • *: correct and codify various file permissions · 01ad7b3a
      The following files now have 0444 permissions:
      
      - loose objects
      - pack indexes
      - pack files
      - packs downloaded by fetch
      - packs downloaded by the HTTP transport
      
      And the following files now have 0666 permissions:
      
      - config files
      - repository indexes
      - reflogs
      - refs
      
      This brings libgit2 more in line with Git.
      
      Note that git_filebuf_commit() and git_filebuf_commit_at() have both
      gained a new mode parameter.
      
      The latter change fixes an important issue where filebufs created with
      GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3)
      usage). Now we chmod() the file before renaming it into place.
      
      Tests have been added to confirm that new commit, tag, and tree
      objects are created with the right permissions. I don't have access to
      Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
      Brodie Rao committed
  29. 18 Sep, 2011 1 commit
    • Cleanup legal data · bb742ede
      1. The license header is technically not valid if it doesn't have a
      copyright signature.
      
      2. The COPYING file has been updated with the different licenses used in
      the project.
      
      3. The full GPLv2 header in each file annoys me.
      Vicent Marti committed
  30. 18 Aug, 2011 1 commit
  31. 17 Jun, 2011 1 commit
  32. 20 May, 2011 1 commit
  33. 19 May, 2011 1 commit
  34. 17 May, 2011 1 commit
  35. 10 May, 2011 1 commit
    • Move config to a backend structure · c0335005
      Configuration options can come from different sources. Currently,
      there is only support for reading them from a flat file, but it might
      make sense to read it from a database at some point.
      
      Move the parsing code into src/config_file.c and create an include
      file include/git2/config_backend.h to allow for other backends to be
      developed.
      
      Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
      Carlos Martín Nieto committed
  36. 05 May, 2011 1 commit
    • config: store the section name separately · 094aaaae
      The section and variable names use different rules, so store them as
      two different variables internally.
      
      This will simplify the configuration-writing code as well later on,
      but even with parsing, the code is simpler.
      
      Take this opportunity to add a variable to the list directly when
      parsing instead of passing through config_set.
      Carlos Martín Nieto committed
  37. 07 Apr, 2011 1 commit
  38. 06 Apr, 2011 1 commit