summaryrefslogtreecommitdiff
path: root/src/notes.c
Commit message (Collapse)AuthorAgeFilesLines
* index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-251-1/+1
| | | | This was not converted when we converted the rest, so do it now.
* note: rename the id getter to git_note_id()Carlos Martín Nieto2014-01-241-3/+3
| | | | This was left over when we did the general switch.
* One more rename/cleanup for callback err functionsRussell Belfer2013-12-111-1/+1
|
* Further callback error check style fixesRussell Belfer2013-12-111-4/+6
| | | | | Okay, I've decided I like the readability of this style much better so I used it everywhere.
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Further EUSER and error propagation fixesRussell Belfer2013-12-111-1/+1
| | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* Add config read fns with controlled error behaviorRussell Belfer2013-12-111-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | This adds `git_config__lookup_entry` which will look up a key in a config and return either the entry or NULL if the key was not present. Optionally, it can either suppress all errors or can return them (although not finding the key is not an error for this function). Unlike other accessors, this does not normalize the config key string, so it must only be used when the key is known to be in normalized form (i.e. all lower-case before the first dot and after the last dot, with no invalid characters). This also adds three high-level helper functions to look up config values with no errors and a fallback value. The three functions are for string, bool, and int values, and will resort to the fallback value for any error that arises. They are: * `git_config__get_string_force` * `git_config__get_bool_force` * `git_config__get_int_force` None of them normalize the config `key` either, so they can only be used for internal cases where the key is known to be in normal format.
* Make iterators use GIT_ITEROVER & smart advanceRussell Belfer2013-05-311-10/+4
| | | | | | | | | | | | | | | 1. internal iterators now return GIT_ITEROVER when you go past the last item in the iteration. 2. git_iterator_advance will "advance" to the first item in the iteration if it is called immediately after creating the iterator, which allows a simpler idiom for basic iteration. 3. if git_iterator_advance encounters an error reading data (e.g. a missing tree or an unreadable file), it returns the error but also attempts to advance past the invalid data to prevent an infinite loop. Updated all tests and internal usage of iterators to account for these new behaviors.
* Unify whitespaces to tabsLinquize2013-05-151-19/+19
|
* Report errors finding notesRussell Belfer2013-05-011-19/+22
|
* Make iterator APIs consistent with standardsRussell Belfer2013-03-061-3/+3
| | | | | | | | | | | | The iterator APIs are not currently consistent with the parameter ordering of the rest of the codebase. This rearranges the order of parameters, simplifies the naming of a number of functions, and makes somewhat better use of macros internally to clean up the iterator code. This also expands the test coverage of iterator functionality, making sure that case sensitive range-limited iteration works correctly.
* added missing free for git_note in clar testsNico von Geyso2013-03-061-1/+1
|
* fixed minor issues with new note iteratorNico von Geyso2013-03-061-49/+37
| | | | | * fixed style issues * use new iterator functions for git_note_foreach()
* use git_note_iterator type instead of non-public git_iterator oneNico von Geyso2013-03-061-4/+13
|
* basic note iterator implementationNico von Geyso2013-03-061-9/+59
| | | | | * git_note_iterator_new() - create a new note iterator * git_note_next() - retrieves the next item of the iterator
* Clear up warnings from cppcheckRussell Belfer2013-02-151-1/+1
| | | | | | | | | | | | The cppcheck static analyzer generates warnings for a bunch of places in the libgit2 code base. All the ones fixed in this commit are actually false positives, but I've reorganized the code to hopefully make it easier for static analysis tools to correctly understand the structure. I wouldn't do this if I felt like it was making the code harder to read or worse for humans, but in this case, these fixes don't seem too bad and will hopefully make it easier for better analysis tools to get at any real issues.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* add option to allow git note overwriteNikolai Vladimirov2013-01-031-4/+7
|
* notes.c - whitespace fixNikolai Vladimirov2013-01-031-6/+6
|
* Clean up iterator APIsRussell Belfer2012-12-101-1/+1
| | | | | | | | This removes the need to explicitly pass the repo into iterators where the repo is implied by the other parameters. This moves the repo to be owned by the parent struct. Also, this has some iterator related updates to the internal diff API to lay the groundwork for checkout improvements.
* Remove GIT_SIGNATURE_VERSION and friendsBen Straub2012-12-031-6/+0
|
* Deploy GITERR_CHECK_VERSIONBen Straub2012-11-301-6/+4
|
* Deploy GIT_SIGNATURE_INITBen Straub2012-11-301-0/+9
|
* Remove git_note_data structureRussell Belfer2012-11-271-6/+3
|
* API updates for notes.h/c.Ben Straub2012-11-271-15/+18
|
* API review / update for tree.hRussell Belfer2012-11-271-5/+5
|
* Rename ref and reflog apis for consistencyBen Straub2012-11-271-1/+1
|
* tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()nulltoken2012-08-211-1/+1
|
* filemode: deploy enum usagenulltoken2012-08-211-2/+8
|
* Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti2012-08-061-25/+18
|\ | | | | | | | | | | | | | | | | 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-26/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | portability: Improve x86/amd64 compatibilitynulltoken2012-07-241-1/+2
|/
* tree: Bring back `entry_bypath`Vicent Marti2012-06-291-1/+1
| | | | Smaller, simpler, faster.
* notes: fix memory leaksMichael Schubert2012-06-211-12/+8
|
* Merge remote-tracking branch 'yorah/fix/notes-creation' into developmentVicent Marti2012-06-191-241/+307
|\ | | | | | | | | Conflicts: src/notes.c
| * notes: simplify the handling of fanoutsyorah2012-06-081-239/+222
| | | | | | | | | | | | | | - Do not create new levels of fanout when creating notes from libgit2 - Insert a note in an existing matching fanout - Remove a note from an existing fanout - Cleanup git_note_read, git_note_remove, git_note_foreach, git_note_create methods in order use tree structures instead of tree_oids
* | misc: Fix warnings from PVS Studio trialVicent Martí2012-06-071-2/+2
|/
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-5/+5
|
* errors: Rename the generic return codesVicent Martí2012-05-181-5/+5
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-1/+1
| | | | Consistency is good.
* notes: make git_note_foreach() callback signature easier to cope with from a ↵nulltoken2012-05-161-7/+9
| | | | binding perspective
* Fix notes to use new fixed iterator signatureRussell Belfer2012-05-151-1/+1
|
* Fix compilation warningsnulltoken2012-05-141-4/+1
|
* notes: add git_notes_foreach()nulltoken2012-05-141-23/+135
|
* notes: Cleanup error handlingVicent Martí2012-05-051-19/+11
|
* notes: add git_note_default_ref()Michael Schubert2012-05-031-0/+6
| | | | | Add git_note_default_ref to allow easy retrieval of the currently set default notes reference.
* notes: honor core.notesRefMichael Schubert2012-05-031-6/+35
| | | | | Setting core.notesRef allows to change the default notes reference used by Git. Check if set before using GIT_NOTES_DEFAULT_REF. Fixes #649.
* Convert indexer, notes, sha1_lookup, and signatureRussell Belfer2012-03-191-104/+75
| | | | More files moved to new error handling style.
* notes: fix assertschu2012-02-161-3/+3
| | | | | | Hopefully fix issue "Don't sleep and code" - #558. Signed-off-by: schu <schu-github@schulog.org>
* Add git notes APIschu2012-02-151-0/+439
This commit adds basic git notes support to libgit2, namely: * git_note_read * git_note_message * git_note_oid * git_note_create * git_note_remove In the long run, we probably want to provide some convenience callback mechanism for merging and moving (filter-branch) notes. Signed-off-by: schu <schu-github@schulog.org>