summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
Commit message (Collapse)AuthorAgeFilesLines
* Make enum in includes C90 compliant by removing trailing comma.Peter Pettersson2021-11-151-4/+4
|
* repository: improve `hashfile` for absolute pathsEdward Thomson2021-09-251-5/+7
| | | | | | | | | | | | | When `git_repository_hashfile` is handed an absolute path, it determines whether the path is within the repository's working directory or not. This is necessary when there is no `as_path` specified. If the path is within the working directory, then the given path should be used for attribute lookups (it is the effective `as_path`). If it is not within the working directory, then it is _not_ eligible. Importantly, now we will _never_ pass an absolute path down to attribute lookup functions.
* Fix coding style for pointerpunkymaniac2021-09-091-5/+5
| | | | Make some syntax change to follow coding style.
* Fix documentation formating on repository.hpunkymaniac2021-02-221-52/+95
| | | | | | The enum 'git_repository_init_flag_t', 'git_repository_init_mode_t' and the structure 'git_repository_init_options' does not follow the format used by docurium.
* repository: improve commondir docsJosh Bleecher Snyder2020-03-071-4/+5
| | | | Fixes #5428
* repo: commondir resolution can sometimes fallback to the repodirEtienne Samson2019-06-261-1/+2
| | | | | | | | | | | | For example, https://git-scm.com/docs/gitrepository-layout says: info Additional information about the repository is recorded in this directory. This directory is ignored if $GIT_COMMON_DIR is set and "$GIT_COMMON_DIR/info" will be used instead. So when looking for `info/attributes`, we need to check the commondir first, or fallback to "our" `info/attributes`.
* doc: add missing documentation commentsEtienne Samson2019-06-151-0/+21
|
* Rename opt init functions to `options_init`Edward Thomson2019-06-141-1/+1
| | | | | | | | | | | | | In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
* repo: split git_repository_open_flag_t options documentation inlineEtienne Samson2019-01-281-28/+41
|
* Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-171-2/+2
| | | | | | | | | 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.
* object_type: update public API to use git_object_tEdward Thomson2018-12-011-2/+2
| | | | | | git_object_t is the future; update the public API to use it. This will also ensure that we can build our tests which make use of the old API without modification (and without compiler warnings).
* docs: standardize comment block for git_*_init_options functionsEtienne Samson2018-05-071-4/+6
|
* docs: fix some comment-marker typosEtienne Samson2018-05-071-1/+1
|
* repository: constify several repo parameters for gettersPatrick Steinhardt2017-10-091-6/+6
| | | | | | | Several functions to retrieve variables from a repository only return immutable values, which allows us to actually constify the passed-in repository parameter. Do so to help a later patch, which will only have access to a constant repository.
* repository_item_path: return ENOTFOUND when appropriateEdward Thomson2017-06-121-2/+2
| | | | | | | Disambiguate error values: return `GIT_ENOTFOUND` when the item cannot exist in the repository (perhaps because the repository is inmemory or otherwise not backed by a filesystem), return `-1` when there is a hard failure.
* worktree: implement functions reading HEADPatrick Steinhardt2017-02-131-0/+25
| | | | | | Implement `git_repository_head_for_worktree` and `git_repository_head_detached_for_worktree` for directly accessing a worktree's HEAD without opening it as a `git_repository` first.
* worktree: implement `git_repository_open_from_worktree`Patrick Steinhardt2017-02-131-0/+11
| | | | | Add function `git_repository_open_from_worktree`, which allows to open a `git_worktree` as repository.
* repository: introduce is_worktree variablePatrick Steinhardt2017-02-131-0/+8
|
* repository: add function to retrieve paths for repo itemsPatrick Steinhardt2017-02-131-0/+36
|
* repository: introduce commondir variablePatrick Steinhardt2017-02-131-0/+11
| | | | | | | | | The commondir variable stores the path to the common directory. The common directory is used to store objects and references shared across multiple repositories. A current use case is the newly introduced `git worktree` feature, which sets up a separate working copy, where the backing git object store and references are pointed to by the common directory.
* Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment varsJosh Triplett2016-06-241-1/+16
| | | | | | | | | | | | | | | | | | | | | git_repository_open_ext provides parameters for the start path, whether to search across filesystems, and what ceiling directories to stop at. git commands have standard environment variables and defaults for each of those, as well as various other parameters of the repository. To avoid duplicate environment variable handling in users of libgit2, add a GIT_REPOSITORY_OPEN_FROM_ENV flag, which makes git_repository_open_ext automatically handle the appropriate environment variables. Commands that intend to act just like those built into git itself can use this flag to get the expected default behavior. git_repository_open_ext with the GIT_REPOSITORY_OPEN_FROM_ENV flag respects $GIT_DIR, $GIT_DISCOVERY_ACROSS_FILESYSTEM, $GIT_CEILING_DIRECTORIES, $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and $GIT_ALTERNATE_OBJECT_DIRECTORIES. In the future, when libgit2 gets worktree support, git_repository_open_env will also respect $GIT_WORK_TREE and $GIT_COMMON_DIR; until then, git_repository_open_ext with this flag will error out if either $GIT_WORK_TREE or $GIT_COMMON_DIR is set.
* Add GIT_REPOSITORY_OPEN_NO_DOTGIT flag to avoid appending /.gitJosh Triplett2016-06-241-0/+4
| | | | | | | | | | GIT_REPOSITORY_OPEN_NO_SEARCH does not search up through parent directories, but still tries the specified path both directly and with /.git appended. GIT_REPOSITORY_OPEN_BARE avoids appending /.git, but opens the repository in bare mode even if it has a working directory. To support the semantics git uses when given $GIT_DIR in the environment, provide a new GIT_REPOSITORY_OPEN_NO_DOTGIT flag to not try appending /.git.
* repository: distinguish sequencer cherry-pick and revertcmn/repository-state-sequencerCarlos Martín Nieto2015-11-201-0/+2
| | | | These are not quite like their plain counterparts and require special handling.
* Fix @param names in doc commentsBen Chatelain2015-07-271-1/+1
|
* Add annotated commit versions of reflog-modifying functionsCarlos Martín Nieto2015-03-161-0/+16
| | | | | | | We do not always want to put the id directly into the reflog, but we want to speicfy what a user typed. For this use-case we provide annotated version of a few functions which let the caller specify what user-friendly name was used when asking for the operation.
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-9/+3
| | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-6/+25
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* Clarified git_repository_is_empty() documentationPierre-Olivier Latour2015-01-271-2/+2
|
* doc: add documentation to all the public structs and enumscmn/doc-allCarlos Martín Nieto2014-12-061-0/+6
| | | | | | | | | | This makes them show up in the reference, even if the text itself isn't the most descriptive. These have been found with grep -Przon '\n\ntypedef struct.*?\{' -- include grep -Przon '\n\ntypedef enum.*?\{' -- include
* Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-021-0/+3
| | | | | | | Teach git_repository_init_ext to use relative paths for the gitlink to the work directory. This is used when creating a sub repository where the sub repository resides in the parent repository's .git directory.
* git_cherry_pick -> git_cherrypickEdward Thomson2014-07-221-1/+1
|
* Fixed miscellaneous documentation errors.Michael Anderson2014-05-231-1/+1
|
* Minor fixes for warnings and error propagationRussell Belfer2014-05-121-1/+5
|
* Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-1/+13
|\ | | | | Configuration snapshotting
| * repository: introduce a convenience config snapshot methodcmn/config-snapshotCarlos Martín Nieto2014-05-071-1/+13
| | | | | | | | | | | | Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
* | Add filter options and ALLOW_UNSAFERussell Belfer2014-05-061-0/+5
| | | | | | | | | | | | | | | | | | Diff and status do not want core.safecrlf to actually raise an error regardless of the setting, so this extends the filter API with an additional options flags parameter and adds a flag so that filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating that unsafe filter application should be downgraded from a failure to a warning.
* | Make init_options fns use unsigned ints and macroRussell Belfer2014-05-021-5/+4
|/ | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+13
| | | | The basic structure of each function is courtesy of arrbee.
* Add reflog params to git_repository_detach_headBen Straub2014-02-041-1/+5
|
* Add reflog params to set-head callsBen Straub2014-01-301-2/+10
|
* repository: move to use a git_buf for outputting stringsCarlos Martín Nieto2014-01-271-19/+7
| | | | | Since we now export that type, we can avoid making the user guess a size.
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-6/+14
|
* clean up state metadata more consistentlyEdward Thomson2013-12-021-3/+3
|
* No such thing as an orphan branchCarlos Martín Nieto2013-09-171-6/+6
| | | | | | | | | | | Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
* Add BARE option to git_repository_open_extRussell Belfer2013-07-101-0/+4
| | | | | | | | | | | This adds a BARE option to git_repository_open_ext which allows a fast open path that still knows how to read gitlinks and to search for the actual .git directory from a subdirectory. `git_repository_open_bare` is still simpler and faster, but having a gitlink aware fast open is very useful for submodules where we want to quickly be able to peek at the HEAD and index data without doing any other meaningful repo operations.
* Fix small typo in docs for git_repository_message.Andrej Mitrovic2013-07-021-1/+1
|
* Fix docs to use proper enum names that exist.Andrej Mitrovic2013-07-011-2/+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
* Improve test failure outputBen Straub2013-05-231-0/+9
|
* Unify whitespaces to tabsLinquize2013-05-151-5/+5
|