summaryrefslogtreecommitdiff
path: root/include/git2/config.h
Commit message (Collapse)AuthorAgeFilesLines
* Some cleanup suggested during reviewRussell Belfer2012-08-221-13/+2
| | | | | | | | | | This cleans up a number of items suggested during code review with @vmg, including: * renaming "outside repo" config API to `git_config_open_default` * killing the `git_config_open_global` API * removing the `git_` prefix from the static functions in fileops * removing some unnecessary functionality from the "cp" command
* Add template dir and set gid to repo initRussell Belfer2012-08-221-0/+12
| | | | | | | | | | | | | | | | | 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.
* Fix incorrect array size in example for git_config_get_mappedJosh Triplett2012-08-121-1/+1
| | | | | | In the documentation for git_config_get_mapped, the sample mapping array uses [3] but has 4 entries. Fix by dropping the size entirely and letting the compiler figure it out.
* Update iterators for consistency across libraryRussell Belfer2012-08-031-2/+2
| | | | | | | | | | | | | | | | | 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.
* Adding git_config_foreach_match() iteration fnRussell Belfer2012-07-101-1/+19
| | | | | | | | | | | | | | Adding a new config iteration function that let's you iterate over just the config entries that match a particular regular expression. The old foreach becomes a simple use of this with an empty pattern. This also fixes an apparent bug in the existing `git_config_foreach` where returning a non-zero value from the iteration callback was not correctly aborting the iteration and the returned value was not being propogated back to the caller of foreach. Added to tests to cover all these changes.
* errors: Rename the generic return codesVicent Martí2012-05-181-17/+17
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-12/+12
| | | | Consistency is good.
* config: Refactor & add `git_config_get_mapped`Vicent Martí2012-03-011-0/+50
| | | | Sane API for real-world usage.
* Document {get,set}_multivarCarlos Martín Nieto2012-02-171-2/+15
|
* Implement setting multivarsCarlos Martín Nieto2012-02-171-0/+7
|
* Support getting multivarsCarlos Martín Nieto2012-02-171-0/+7
|
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* config: Rename the `delete` callback nameVicent Martí2011-12-311-1/+1
| | | | `delete` is a reserved keyword in C++.
* config: really delete variablesCarlos Martín Nieto2011-12-161-0/+1
| | | | | | Instead of just setting the value to NULL, which gives unwanted results when asking for that variable after deleting it, delete the variable from the list and re-write the file.
* msvc: Remove superfluous includesVicent Marti2011-10-051-1/+0
|
* Include stdint.h in git2/config.hCarlos Martín Nieto2011-10-011-0/+1
| | | | | | | Otherwise MSVC doesn't know what we're talking about when we say int32_t or int64_t. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* config: Proper type declarations for 64 bit intsVicent Marti2011-09-301-4/+4
|
* Add git_config_find_systemCarlos Martín Nieto2011-09-271-0/+12
| | | | | | | This allows the library to guess where the system configuration file should be located. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* config: make git_config_[get|set]_long() able to properly deal with 8 bytes ↵nulltoken2011-09-221-2/+2
| | | | | | | | wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
* Cleanup legal dataVicent Marti2011-09-191-22/+4
| | | | | | | | | | 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.
* Standardized doxygen @return lines for int functions to say "GIT_SUCCESS or ↵David Boyce2011-09-131-13/+13
| | | | an error code".
* config: Rename `del` to `deleteVicent Marti2011-07-121-1/+1
|
* Add tests for deleting a config varCarlos Martín Nieto2011-07-051-1/+9
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Fix unmatched parameters in docsVicent Marti2011-06-301-1/+1
|
* config: `foreach` now returns variable values tooVicent Marti2011-06-291-7/+10
|
* config: Fix API docsVicent Marti2011-06-191-2/+2
|
* config: Bring back `git_config_open_global`Vicent Marti2011-06-181-1/+33
| | | | Scott commands, I obey.
* config: Cleanup external APIVicent Marti2011-06-181-15/+35
| | | | | Do not mess with environment variables anymore. The new external API has more helper methods, and everything is explicit.
* Update documentationVicent Marti2011-06-161-2/+2
| | | | Fix all the missmatched arguments in the docs
* config: explain the cfg and file relationship betterCarlos Martín Nieto2011-06-071-6/+16
| | | | | | | | It's not clear how git_config and git_config_file relate to one another. Be more explicit about their relationship in the function documentation. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: update the git_config_add_file documentationCarlos Martín Nieto2011-06-071-2/+2
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Cleanup & renaming of the external APIVicent Marti2011-05-201-2/+28
| | | | | | | | "git_config_backend" have been renamed to "git_config_file", which implements a generic interface to access a configuration file -- be it either on disk, from a DB or whatever mumbojumbo. I think this makes more sense.
* Add documentation for git_config_add_backendCarlos Martín Nieto2011-05-171-0/+7
|
* Implement git_config_open_globalCarlos Martín Nieto2011-05-171-0/+7
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Move config to a backend structureCarlos Martín Nieto2011-05-101-1/+11
| | | | | | | | | | | | 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>
* config: export git_config_[sg]et_longCarlos Martín Nieto2011-04-191-0/+20
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Determine variable type at runtimeCarlos Martín Nieto2011-03-301-48/+12
| | | | | | | | | | Config variables should be interpreted at run-time, as we don't know if a zero means false or zero, or if yes means true or "yes". As a variable has no intrinsic type, git_cvtype is gone and the public API takes care of enforcing a few rules. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Expose config API for setters, getters and foreachCarlos Martín Nieto2011-03-291-2/+126
| | | | | | | | | These functions can be used to query or modify the variables in a given configuration. No sanity checking is done on the variable names. This is mostly meant as an API preview. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Move the struct declaration outside config.cCarlos Martín Nieto2011-03-281-0/+53
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>