include/git2/attr.h


Log

Author Commit Date CI Message
Edward Thomson 258df9c1 2022-01-17T22:03:26 Merge pull request #6168 from punkymaniac/patch-documentation-2 Improve documentation
Edward Thomson d4232e7c 2022-01-17T21:21:54 Apply suggestions from code review
punkymaniac 68bc511a 2021-11-26T15:14:56 Add documentation about parameter and return value
Dimitris Apostolou 90df4302 2022-01-05T12:18:05 Fix typos
Peter Pettersson 38c34498 2021-10-03T00:12:52 Make enum in includes C90 compliant by removing trailing comma.
Edward Thomson 90656858 2021-09-21T11:28:39 filter: use a `git_oid` in filter options, not a pointer Using a `git_oid *` in filter options was a mistake; it is a deviation from our typical pattern, and callers in some languages that GC may need very special treatment in order to pass both an options structure and a pointer outside of it.
Edward Thomson 0bd547a8 2021-07-22T15:29:46 attr: introduce GIT_ATTR_CHECK_INCLUDE_COMMIT 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.
Edward Thomson 3779a047 2021-05-27T18:47:22 attr: introduce `git_attr_options` for extended queries 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.
Edward Thomson 9893d376 2020-01-18T15:41:20 git_attr_cache_flush: return an int Stop returning a void for functions, future-proofing them to allow them to fail.
Edward Thomson 4fd5748c 2019-07-21T14:11:03 attr: optionally read attributes from repository When `GIT_ATTR_CHECK_INCLUDE_HEAD` is specified, read `gitattribute` files that are checked into the repository at the HEAD revision.
Edward Thomson 91a300b7 2019-06-16T00:46:30 attr: rename constants and macros for consistency Our enumeration values are not generally suffixed with `T`. Further, our enumeration names are generally more descriptive.
Edward Thomson 22d2062d 2019-01-09T18:25:10 Introduce GIT_CALLBACK macro to enforce cdecl 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.
Etienne Samson 3ec35d9c 2018-03-26T20:23:59 attr: fix typo
Etienne Samson f46c360e 2018-03-22T23:27:24 docs: move callback-specific documentation to the callback
Carlos Martín Nieto 18eb6ec8 2014-07-08T09:56:16 Documentation fixes 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.
Russell Belfer 373cf6a9 2013-12-09T10:17:47 Update docs for new callback return value behavior
Andreas Linde e1967164 2013-06-24T15:33:41 Fixed most documentation header bugs 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
Linquize 0cb16fe9 2013-05-15T20:26:55 Unify whitespaces to tabs
Carlos Martín Nieto b4117e19 2013-04-24T20:09:42 docs: formatting fixes
Edward Thomson 359fc2d2 2013-01-08T17:07:25 update copyrights
Vicent Marti cfbe4be3 2012-11-17T19:54:47 More external API cleanup Conflicts: src/branch.c tests-clar/refs/branches/create.c
Josh Triplett 5389005d 2012-08-11T18:14:07 Export git_attr_value 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.
Vicent Marti 51e1d808 2012-08-06T12:41:08 Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
Russell Belfer 5dca2010 2012-08-03T17:08:01 Update iterators for consistency across library 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.
Vicent Marti 0c9eacf3 2012-08-02T01:15:24 attr: Do not export variables externally 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:
Vicent Marti 227f3131 2012-07-15T14:11:58 attr: Rename the `git_attr__` exports Pevents collisions with the original libgit, which also exports those exact symbols. Fixes #822
Bruce Mitchener d73c94b2 2012-05-19T20:24:55 Fix spelling errors.
Vicent Martí 29e948de 2012-05-10T10:38:10 global: Change parameter ordering in API Consistency is good.
Russell Belfer b709e951 2012-05-04T11:06:12 Fix memory leaks and use after free
Russell Belfer f917481e 2012-05-03T16:37:25 Support reading attributes from index 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.
Vicent Martí c63793ee 2012-03-02T03:51:45 attr: Change the attribute check macros 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.
schu 5e0de328 2012-02-13T17:10:24 Update Copyright header Signed-off-by: schu <schu-github@schulog.org>
Russell Belfer 73b51450 2011-12-28T23:28:50 Add support for macros and cache flush API. 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 ee1f0b1a 2011-12-16T10:56:43 Add APIs for git attributes 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.