summaryrefslogtreecommitdiff
path: root/include/git2/attr.h
Commit message (Collapse)AuthorAgeFilesLines
* attr: introduce GIT_ATTR_CHECK_INCLUDE_COMMITEdward Thomson2021-07-221-0/+10
| | | | | | | | Introduce `GIT_ATTR_CHECK_INCLUDE_COMMIT`, which like 4fd5748 allows attribute information to be read from files in the repository. 4fd5748 always reads the information from HEAD, while `GIT_ATTR_CHECK_INCLUDE_COMMIT` allows users to provide the commit to read the attributes from.
* attr: introduce `git_attr_options` for extended queriesEdward Thomson2021-07-221-0/+79
| | | | | | | Allow more advanced attribute queries using a `git_attr_options`, and extended functions to use it. Presently there is no additional configuration in a `git_attr_options` beyond the flags, but this is for future growth.
* git_attr_cache_flush: return an intEdward Thomson2020-01-241-1/+4
| | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
* attr: optionally read attributes from repositoryEdward Thomson2019-08-111-2/+9
| | | | | When `GIT_ATTR_CHECK_INCLUDE_HEAD` is specified, read `gitattribute` files that are checked into the repository at the HEAD revision.
* attr: rename constants and macros for consistencyethomson/attrEdward Thomson2019-06-161-10/+10
| | | | | Our enumeration values are not generally suffixed with `T`. Further, our enumeration names are generally more descriptive.
* Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-171-1/+1
| | | | | | | | | Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
* attr: fix typoEtienne Samson2018-05-071-1/+1
|
* docs: move callback-specific documentation to the callbackEtienne Samson2018-05-071-7/+18
|
* Documentation fixesCarlos Martín Nieto2014-07-081-13/+16
| | | | | | | | Fixup git_attr_value's comment to be recognised as documentation, and include the definitions needed for clang to parse reset.h such that it shows up in the documentation. This fixes #2430.
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-1/+2
|
* Fixed most documentation header bugsAndreas Linde2013-06-241-1/+1
| | | | | | | | | | | Fixed a few header @param and @return typos with the help of -Wdocumentation in Xcode. The following warnings have not been fixed: common.h:213 - Not sure how the documentation format is for '...' notes.h:102 - Correct @param name but empty text notes.h:111 - Correct @param name but empty text pack.h:140 - @return missing text pack.h:148 - @return missing text
* Unify whitespaces to tabsLinquize2013-05-151-1/+1
|
* docs: formatting fixesCarlos Martín Nieto2013-04-241-1/+1
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* More external API cleanupVicent Marti2012-11-271-1/+3
| | | | | | Conflicts: src/branch.c tests-clar/refs/branches/create.c
* Export git_attr_valueJosh Triplett2012-08-111-1/+1
| | | | | | | | Commit 0c9eacf3d2c83256736a5bb2a240e73afd13d55f introduced the function git_attr_value and switched the GIT_ATTR_* macros to use it, but attempting to use that function leads to a linker error (undefined reference to `git_attr_value'). Export git_attr_value so programs can actually call it.
* Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti2012-08-061-11/+10
|\ | | | | | | | | | | | | | | | | Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
| * Update iterators for consistency across libraryRussell Belfer2012-08-031-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* | attr: Do not export variables externallyattr-exportVicent Marti2012-08-021-9/+25
|/ | | | | | | | | | Fixes #824 Exporting variables in a dynamic library is a PITA. Let's keep these values internally and wrap them through a helper method. This doesn't break the external API. @arrbee, aren't you glad I turned the `GIT_ATTR_` macros into function macros? :sparkles:
* attr: Rename the `git_attr__` exportsVicent Marti2012-07-151-8/+8
| | | | | | | Pevents collisions with the original libgit, which also exports those exact symbols. Fixes #822
* Fix spelling errors.Bruce Mitchener2012-05-191-1/+1
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-16/+16
| | | | Consistency is good.
* Fix memory leaks and use after freeRussell Belfer2012-05-041-3/+3
|
* Support reading attributes from indexRussell Belfer2012-05-031-11/+155
| | | | | | | | | | | | | | 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.
* attr: Change the attribute check macrosVicent Martí2012-03-021-5/+5
| | | | | | | | | | | | | | | | | | | | | The point of having `GIT_ATTR_TRUE` and `GIT_ATTR_FALSE` macros is to be able to change the way that true and false values are stored inside of the returned gitattributes value pointer. However, if these macros are implemented as a simple rename for the `git_attr__true` pointer, they will always be used with the `==` operator, and hence we cannot really change the implementation to any other way that doesn't imply using special pointer values and comparing them! We need to do the same thing that core Git does, which is using a function macro. With `GIT_ATTR_TRUE(attr)`, we can change internally the way that these values are stored to anything we want. This commit does that, and rewrites a large chunk of the attributes test suite to remove duplicated code for expected attributes, and to properly test the function macro behavior instead of comparing pointers.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Add support for macros and cache flush API.Russell Belfer2011-12-291-0/+24
| | | | | | | | | | | | | | 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.
* Add APIs for git attributesRussell Belfer2011-12-201-0/+56
This adds APIs for querying git attributes. In addition to the new API in include/git2/attr.h, most of the action is in src/attr_file.[hc] which contains utilities for dealing with a single attributes file, and src/attr.[hc] which contains the implementation of the APIs that merge all applicable attributes files.