summaryrefslogtreecommitdiff
path: root/src/attr.h
Commit message (Collapse)AuthorAgeFilesLines
* Attribute file cache refactorRussell Belfer2014-04-171-33/+1
| | | | | | | This is a big refactoring of the attribute file cache to be a bit simpler which in turn makes it easier to enforce a lock around any updates to the cache so that it can be used in a threaded env. Tons of changes to the attributes and ignores code.
* Implement global/system file search pathsRussell Belfer2013-03-151-17/+3
| | | | | | | | | | | | | | | | | | | | | | | 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.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Support for core.ignorecasePhilip Kelley2012-09-171-1/+2
|
* Support new config locationsRussell Belfer2012-08-241-0/+1
| | | | | As of git v1.7.12, $HOME/.config/git/ is supported as a new location for "config", "attributes", and "ignore" files.
* Add public API for internal ignoresRussell Belfer2012-08-211-0/+1
| | | | | | | This creates a public API for adding to the internal ignores list, which already existing but was not accessible. This adds the new default value for core.excludesfile also.
* Support reading attributes from indexRussell Belfer2012-05-031-10/+16
| | | | | | | | | | | | | | 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.
* Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-251-3/+3
| | | | | | 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`.
* Convert hashtable usage over to khashRussell Belfer2012-04-251-2/+6
| | | | | | | | | | | | | | | 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.
* Convert attrs and diffs to use string poolsRussell Belfer2012-04-251-0/+1
| | | | | | | This converts the git attr related code (including ignores) and the git diff related code (and implicitly the status code) to use `git_pools` for storing strings. This reduces the number of small blocks allocated dramatically.
* Improve config handling for diff,submodules,attrsRussell Belfer2012-03-301-0/+5
| | | | | | | | This adds support for a bunch of core.* settings that affect diff and status, plus fixes up some incorrect implementations of those settings from before. Also, this cleans up the handling of config settings in the new submodules code and in the old attrs/ignore code.
* Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-2/+2
| | | | | Also cleaned up some previously converted code that still had little things to polish.
* Uniform iterators for trees, index, and workdirRussell Belfer2012-02-211-0/+7
| | | | | | | | | | | | | | | This create a new git_iterator type of object that provides a uniform interface for iterating over the index, an arbitrary tree, or the working directory of a repository. As part of this, git ignore support was extended to support push and pop of directory-based ignore files as the working directory is being traversed (so the array of ignores does not have to be recreated at each directory during traveral). There are a number of other small utility functions in buffer, path, vector, and fileops that are included in this patch that made the iterator implementation cleaner.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Add unit tests for recent bug fixesRussell Belfer2012-02-011-0/+3
| | | | | | Add unit tests to confirm ignore directory pattern matches and to confirm that ignore and attribute files are loaded properly into the attribute file cache.
* Fix handling of relative paths for attrsRussell Belfer2012-01-161-1/+1
| | | | | | | | | | | | Per issue #533, the handling of relative paths in attribute and ignore files was not right. Fixed this by pre-joining the relative path of the attribute/ignore file onto the match string when a full path match is required. Unfortunately, fixing this required a bit more code than I would have liked because I had to juggle things around so that the fnmatch parser would have sufficient information to prepend the relative path when it was needed.
* Initial implementation of gitignore supportRussell Belfer2012-01-111-0/+30
Adds support for .gitignore files to git_status_foreach() and git_status_file(). This includes refactoring the gitattributes code to share logic where possible. The GIT_STATUS_IGNORED flag will now be passed in for files that are ignored (provided they are not already in the index or the head of repo).