summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-024-74/+145
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * remote: don't free transport on disconnectMichael Schubert2012-05-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, git_remote_disconnect not only closes the connection but also frees the underlying transport object, making it impossible to write code like // fetch stuff git_remote_download() // close connection git_remote_disconnect() // call user provided callback for each ref git_remote_update_tips(remote, callback) because remote->refs points to references owned by the transport object. This means, we have an idling connection while running the callback for each reference. Instead, allow immediate disconnect and free the transport later in git_remote_free().
| * remote: run a callback when updating the branch tipsCarlos Martín Nieto2012-04-252-2/+21
| | | | | | | | | | | | | | | | This allows the caller to update an internal structure or update the user output with the tips that were updated. While in the area, only try to update the ref if the value is different from its old one.
| * examples: run fetch in a background threadCarlos Martín Nieto2012-04-251-13/+56
| | | | | | | | This allows us to give updates on how it's doing
| * examples: port 'fetch' to the new APICarlos Martín Nieto2012-04-251-71/+22
| |
| * examples: stream indexer exampleCarlos Martín Nieto2012-04-131-0/+55
| |
| * Use new error handling in the example network codeCarlos Martín Nieto2012-04-111-1/+1
| |
* | examples/diff: update example codeschu2012-03-131-2/+2
|/ | | | Signed-off-by: schu <schu-github@schulog.org>
* Update diff to use iteratorsRussell Belfer2012-03-021-10/+33
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Continue implementation of git-diffRussell Belfer2012-03-022-22/+100
| | | | | | | | * Implemented git_diff_index_to_tree * Reworked git_diff_options structure to handle more options * Made most of the options in git_diff_options actually work * Reorganized code a bit to remove some redundancy * Added option parsing to examples/diff.c to test most options
* Clean up diff implementation for reviewRussell Belfer2012-03-022-3/+138
| | | | | | | This fixes several bugs, updates tests and docs, eliminates the FILE* assumption in favor of printing callbacks for the diff patch formatter helpers, and adds a "diff" example function that can perform a diff from the command line.
* examples: use git_repository_odb instead of _databaseCarlos Martín Nieto2012-01-131-1/+1
|
* remote: Cleanup the remotes coderepo-ownershipVicent Marti2011-11-283-78/+11
| | | | | | - Hide the remaining transports code - Drop `git_headarray`, switch to using a callback to list refs. Makes the code cleaner.
* Rename all `_close` methodsVicent Marti2011-11-261-6/+6
| | | | | There's no difference between `_free` and `_close` semantics: keep everything with the same name to avoid confusions.
* examples/network/.gitignore: ignore 'git2'Brandon Casey2011-11-061-0/+1
|
* examples/network/git2.c: exit with proper status, and avoid segfaultBrandon Casey2011-11-061-1/+2
| | | | | | | | This function should exit after printing usage information if too few arguments were specified. Additionally, it should exit with a failure status if the first argument supplied is not one in the internal command list.
* examples/network/git2.c: add newline to usage messageBrandon Casey2011-11-061-1/+1
|
* examples/network/fetch.c: revert overzealous conversion of free to git__freeBrandon Casey2011-11-061-1/+1
| | | | | Since git__free is not exported (it's actually a macro), it should not be used in client programs. Change this call to 'git__free' back to 'free'.
* examples/general.c: update for recent API renaming of git_config_get_intBrandon Casey2011-11-051-2/+2
| | | | git_config_get_int --> git_config_get_int32
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-1/+1
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* examples: add ls-remote, fetch and index-pack examplesCarlos Martín Nieto2011-10-036-0/+372
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Fixed typo in example Makefile code and slimmed it down more.David Boyce2011-09-152-56/+42
| | | | | | | Reverted signature of git_signature_new. Removed error check wrappers (voted down). Made Makefile work out of the box on Linux and Solaris when standard cmake build instructions for the library are followed.
* Changes to allow examples/*.c to compile and link. This required onDavid Boyce2011-09-121-41/+57
| | | | | | | | | change to the signature of an API function (git_signature_new). Also, the examples/general.c had a lot of unchecked return values which were addresed with a couple of macros. The resulting example still does not work correctly but at least now it fails with an error message rather than not compiling or dumping core. Example runtime issues may be addressed in a later commit.
* Fixed to build examples with knowledge of include and lib locations.David Boyce2011-09-121-3/+8
|
* examples/general: fix misc warningsKirill A. Shutemov2011-07-051-2/+4
| | | | | | | | examples/general.c:393:25: warning: unused variable ‘reftarget’ [-Wunused-variable] examples/general.c:357:19: warning: unused variable ‘e’ [-Wunused-variable] examples/general.c:444:1: warning: control reaches end of non-void function [-Wreturn-type] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* examples/general: fix warnings on not handled reference type in switchKirill A. Shutemov2011-07-051-0/+3
| | | | | | | | | examples/general.c:402:5: warning: enumeration value ‘GIT_REF_INVALID’ not handled in switch [-Wswitch] examples/general.c:402:5: warning: enumeration value ‘GIT_REF_PACKED’ not handled in switch [-Wswitch] examples/general.c:402:5: warning: enumeration value ‘GIT_REF_HAS_PEEL’ not handled in switch [-Wswitch] examples/general.c:402:5: warning: enumeration value ‘GIT_REF_LISTALL’ not handled in switch [-Wswitch] Signe-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* examples/general: fix git_commit_create_v() arguments typeKirill A. Shutemov2011-07-051-3/+6
| | | | | | general.c:208: warning: passing argument 7 of 'git_commit_create_v' from incompatible pointer type Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-12/+12
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* config: Update examplesVicent Marti2011-06-181-1/+1
|
* oid: Rename methodsVicent Marti2011-06-161-8/+8
| | | | | Yeah. Finally. Fuck the old names, this ain't POSIX and they don't make any sense at all.
* update examples content to be compilable and up to dateScott Chacon2011-06-154-4/+39
|
* fix the example urlsScott Chacon2011-06-141-16/+14
|
* add examples for docsScott Chacon2011-06-142-0/+461