summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
Commit message (Collapse)AuthorAgeFilesLines
* git_reference_create_matching: Treat all-zero OID as "must be absent"David Turner2021-04-201-0/+3
| | | | | | | | | | | This is pretty useful in avoiding races: I want to create a ref only if it doesn't already exist. I can't check first because of TOCTOU -- by the time I finish the check, someone else might have already created the ref. And I can't take a lock because then I can't do the create, since the create expects to take the lock. The semantics are inspired by git update-ref, which allows an all-zero old value to mean that the ref must not exist.
* include: fix typos in commentsTobias Nießen2021-02-221-3/+3
|
* refs: deprecate git_reference_is_valid_nameEdward Thomson2020-10-251-16/+0
|
* refs: introduce git_reference_name_is_validEdward Thomson2020-10-251-0/+17
| | | | | | | | Provide a function that can check reference name validity but can also signal when an error occurs. Use the name "name_is_valid", which is more suggestive of checking a given name, rather than "is_valid_name", which suggests that the function checks the validity of the current reference's name.
* doc: add missing documentation commentsEtienne Samson2019-06-151-0/+19
|
* deprecation: move deprecated bits to deprecated.hEdward Thomson2019-01-251-35/+0
|
* deprecation: use the enum type in declarationEdward Thomson2019-01-201-8/+8
| | | | | | | | | | | | | | The C standard does not specify whether an enum is a signed or unsigned type. Obviously, any enum that includes negative values _must_ be signed, but if all values are positive then the compiler is free to choose signed or unsigned. Thus, by changing the type signatures to `git_object_t` and declaring the old `GIT_OBJ_` values as a signed or unsigned int, we risk a mismatch between what the compiler has chosen for a `git_object_t`'s type and our type declaration. Thus, we declare the deprecated values as the enum instead of guessing.
* Merge pull request #4939 from libgit2/ethomson/git_refEdward Thomson2019-01-191-8/+42
|\ | | | | Move `git_ref_t` to `git_reference_t`
| * references: use full name in type namesEdward Thomson2019-01-171-8/+42
| | | | | | | | | | | | | | | | | | Update the reference type names from an abbreviation (`git_ref`) to use the fullname (`git_reference`). This ensures that we are consistent with our naming for reference types and functions throughout the library. The previous names are now marked as deprecated.
* | 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.
* refs: constify git_reference_peelCarlos Martín Nieto2018-12-141-1/+1
| | | | | | | We have no need to take a non-const reference. This does involve some other work to make sure we don't mix const and non-const variables, but by splitting what we want each variable to do we can also simplify the logic for when we do want to free a new reference we might have allocated.
* object_type: update public API to use git_object_tEdward Thomson2018-12-011-4/+4
| | | | | | 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).
* refs: document need to free refs in foreach-callbackPatrick Steinhardt2018-01-121-0/+3
| | | | | | | | | References passed to the callback function of `git_reference_foreach` are expected to be owned by the callback. As such, they are never being freed by `git_reference_foreach`, but will have to be freed by the caller. This small detail is never mentioned in the function's documentation, though, making it easy to get wrong. Document this to make it discoverable.
* Allow creating copies of `git_reference` objects.Arthur Schreiber2016-04-221-0/+11
|
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-29/+19
| | | | | | | | | | 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.
* 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
* Spelling fixesWill Stamper2014-12-041-1/+1
|
* Fixed miscellaneous documentation errors.Michael Anderson2014-05-231-3/+1
|
* refs: document _next_name()Carlos Martín Nieto2014-04-301-0/+11
| | | | | If it's not documented, it doesn't show up in the docs (and we really should document, anyway).
* Const correctness!Jacques Germishuys2014-04-031-5/+7
|
* branch: constness fixesCarlos Martín Nieto2014-03-171-1/+1
|
* refs: fix copy-paste doc errorCarlos Martín Nieto2014-03-131-1/+1
|
* refs: move current_id before the reflog parametersCarlos Martín Nieto2014-02-101-4/+4
| | | | | Keep the reflog parameters as the last two, as they're the optional parameters.
* refs: conditional wording fixupsCarlos Martín Nieto2014-02-101-8/+11
| | | | | This addresses arrbee's concerns about wording in the conditional reference udpate functions.
* refs: add an unconditional deleteCarlos Martín Nieto2014-02-051-0/+11
| | | | | Add it under the git_reference_remove() name, letting the user pass the repo and name, analogous to unconditional setting/creation.
* refs: check the ref's old value when deletingCarlos Martín Nieto2014-02-051-1/+4
| | | | Recognize when the reference has changed since we loaded it.
* refs: bring conditional symbolic updates to the frontendCarlos Martín Nieto2014-02-051-0/+40
| | | | Bring the race detection goodness to symbolic references as well.
* refs: return GIT_EMODIFIED if the ref target movedCarlos Martín Nieto2014-02-051-2/+4
| | | | | In case we loose the race to update the reference, return GIT_EMODIFIED to let the user distinguish it from other types of errors.
* refs: changes from feedbackCarlos Martín Nieto2014-02-051-1/+1
| | | | | | Change the name to _matching() intead of _if(), and force _set_target() to be a conditional update. If the user doesn't care about the old value, they should use git_reference_create().
* refs: conditional ref updatesCarlos Martín Nieto2014-02-051-5/+44
| | | | Allow updating references if the old value matches the given one.
* Add `git_reference_is_note`.Arthur Schreiber2014-02-021-0/+10
|
* Ensure renaming a reference updates the reflogBen Straub2014-01-301-1/+5
|
* Revert a wrong doc change.Arthur Schreiber2014-01-161-1/+1
|
* Fix some documentation issues.Arthur Schreiber2014-01-161-6/+6
|
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-128/+24
| | | | | | Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
* Merge pull request #1920 from libgit2/cmn/ref-with-logVicent Marti2013-12-181-3/+148
|\ | | | | Reference operations with log
| * refs: expose has_log() on the backendCarlos Martín Nieto2013-12-091-3/+3
| | | | | | | | | | | | The frontend used to look at the file directly, but that's obviously not the right thing to do. Expose it on the backend and use that function instead.
| * refs: expose a way to ensure a ref has a logCarlos Martín Nieto2013-12-091-0/+12
| | | | | | | | | | | | Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
| * refs: Introduce git_reference_symbolic_set_target_with_log()nulltoken2013-11-231-0/+25
| |
| * refs: Introduce git_reference_set_target_with_log()nulltoken2013-11-231-0/+23
| |
| * refs: Introduce git_reference_symbolic_create_with_log()nulltoken2013-11-231-0/+42
| |
| * refs: Introduce git_reference_create_with_log()nulltoken2013-11-231-0/+43
| |
* | Update docs for new callback return value behaviorRussell Belfer2013-12-111-2/+15
|/
* Make reference lookups apply precomposeunicodeRussell Belfer2013-10-081-4/+4
| | | | | | | | | | | | | | | | | | | | | Before these changes, looking up a reference would return the same precomposed or decomposed form of the reference name that was used to look it up, so on MacOS which ignores the difference between the two, a single reference could be looked up either way and git_reference_name would return the form of the name that was used to look it up! This change makes lookup always return the precomposed name if core.precomposeunicode is set regardless of which version was used to look it up. The reference iterator was already returning the precomposed form from earlier work. This also updates the CMakeLists.txt rules for enabling iconv usage because the clar tests for this code were actually not being activated properly with the old version. Finally, this moves git_repository_reset_filesystem from include/ git2/repository.h to include/git2/sys/repository.h since it is not really a function that normal library users should have to think about very often.
* refs: add git_reference_is_tagNikolai Vladimirov2013-08-261-0/+9
|
* Fix docs to use proper enum names that exist.Andrej Mitrovic2013-07-011-7/+7
|
* Fixed most documentation header bugsAndreas Linde2013-06-241-6/+6
| | | | | | | | | | | 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
* Merge pull request #1624 from libgit2/vmg/full-ref-iteratorVicent Martí2013-06-031-13/+21
|\ | | | | Breaking RefDB changes
| * ...Aaaand this worksVicent Marti2013-05-301-6/+1
| |
| * What are the chances, reallyVicent Marti2013-05-291-2/+10
| |