summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: network: fix Win32 linking errors due to getlinePatrick Steinhardt2017-11-061-2/+39
| | | | | | | | | | | | The getline(3) function call is not part of ISO C and, most importantly, it is not implemented on Microsoft Windows platforms. As our networking example code makes use of getline, this breaks builds on MSVC and MinGW. As this code wasn't built prior to the previous commit, this was never noticed. Fix the error by instead implementing a `readline` function, which simply reads the password from stdin until it reads a newline character.
* Merge pull request #4373 from cjhoward92/examples/log-show-log-sizeCarlos Martín Nieto2017-10-291-3/+10
|\ | | | | example-log: add support for --log-size
| * examples: log: pass options pointer to print_commitCarson Howard2017-10-131-7/+7
| | | | | | Cleaned up the PR to address styling issues.
| * example-log: add support for --log-sizeCarson Howard2017-10-111-4/+11
| |
* | examples: remove MakefilePatrick Steinhardt2017-10-202-32/+0
|/ | | | | | | | | | Back in the days when libgit2 was still young, libgit2 was using plain Makefiles as build infrastructure. We later changed that to instead use the CMake build system to make cross-platform development easier. In the process, we forgot to remove the Makefile from our examples directory, which is fixed by this commit here. Furthermore, remove the accompanying .gitignore file, which ignores build outputs. As we do out-of-tree builds only nowadays, no output is generated in that directory anymore.
* Fix Issue #4047 Check return codes and free objectsexample_generalDouglas Swanson2017-10-071-3/+28
|
* cmake: keep track of libraries and includes via listsPatrick Steinhardt2017-08-161-0/+3
| | | | | | | | | | | | | | Later on, we will move detection of required libraries, library directories as well as include directories into a separate CMakeLists.txt file inside of the source directory. Obviously, we want to avoid duplication here regarding these parameters. To prepare for the split, put the parameters into three variables LIBGIT2_LIBS, LIBGIT2_LIBDIRS and LIBGIT2_INCLUDES, tracking the required libraries, linking directory as well as include directories. These variables can later be exported into the parent scope from inside of the source build instructions, making them readily available for the other subdirectories.
* examples: network: refactor credentials callbackPatrick Steinhardt2017-05-151-5/+19
| | | | | | | | The credentials callback reads the username and password via scanf into fixed-length arrays. While these are simply examples and as such not as interesting, the unchecked return value of scanf causes GCC to emit warnings. So while we're busy to shut up GCC, we also fix the possible overflow of scanf by using getline instead.
* examples: general: fix memory leaksPatrick Steinhardt2017-01-121-1/+30
|
* examples: general: display config only if it was foundPatrick Steinhardt2017-01-121-3/+3
|
* examples: general: narrow down scope of loop variablesPatrick Steinhardt2017-01-121-4/+6
|
* examples: general: clean up committer/author variablesPatrick Steinhardt2017-01-121-4/+4
|
* fix examples/network/clone.c: heap-buffer-overflowForce.Charlie-I2017-01-091-1/+1
| | | Format of a length of string to the correct format is:%.*s
* Fix issue #4046 Seg fault in config_files()Douglas Swanson2016-12-291-4/+6
|
* examples: add: fix type casting warningPatrick Steinhardt2016-10-101-5/+4
|
* examples: diff: parse correct types for line-diffoptsPatrick Steinhardt2016-10-103-3/+31
|
* examples: fix warnings in network/fetch.cPatrick Steinhardt2016-10-101-7/+7
|
* examples: general: fix remaining warningsPatrick Steinhardt2016-10-101-9/+14
|
* examples: general: convert C99 comments to C90 commentsPatrick Steinhardt2016-10-101-42/+54
|
* examples: general: extract function demonstrating OID parsingPatrick Steinhardt2016-10-101-26/+44
|
* examples: general: extract function demonstrating ODBPatrick Steinhardt2016-10-101-51/+77
|
* examples: general: extract function demonstrating commit writingPatrick Steinhardt2016-10-101-36/+51
|
* examples: general: extract functions demonstrating object parsingPatrick Steinhardt2016-10-101-131/+194
|
* examples: general: extract function demonstrating revwalkingPatrick Steinhardt2016-10-101-39/+53
|
* examples: general: extract function demonstrating index walkingPatrick Steinhardt2016-10-101-24/+33
|
* examples: general: extract function demonstrating reference listingsPatrick Steinhardt2016-10-101-22/+36
|
* examples: general: extract function demonstrating config filesPatrick Steinhardt2016-10-101-14/+23
|
* examples: general: use tabs instead of spacesPatrick Steinhardt2016-10-101-457/+457
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-191-1/+1
|
* Update link to Pro Git's Git internals chapter.Patrick McKenna2016-03-071-3/+2
|
* fix returnEun2015-10-071-0/+1
|
* Update another call to git_remote_connectMatt Burke2015-09-081-1/+1
|
* Merge pull request #3306 from libgit2/cmn/fetch-ex-fetchCarlos Martín Nieto2015-07-131-74/+27
|\ | | | | examples: modernise the fetch example
| * examples: modernise the fetch examplecmn/fetch-ex-fetchCarlos Martín Nieto2015-07-121-74/+27
| | | | | | | | | | Under normal conditions, git_remote_fetch() should be the only function used to perform a fetch. Don't let the example lead people astray.
* | Fix #3094 - improve use of portable size_t/ssize_t format specifiers.Matthew Plough2015-07-121-2/+2
|/ | | | The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
* examples: clean up some warningsEdward Thomson2015-06-292-2/+4
|
* Rename FALLBACK to UNSPECIFIEDcmn/rename-unspecifiedCarlos Martín Nieto2015-06-251-1/+1
| | | | | Fallback describes the mechanism, while unspecified explains what the user is thinking.
* examples: adjust to submodule status API changeCarlos Martín Nieto2015-06-221-16/+10
|
* print_usage functions is defined but not usedAriel O. Barria2015-06-031-0/+2
| | | | | | Use the previously created function to display a message when the arguments are not valid. ticket 3095
* remote: remove fetch parameter from create_anonymousCarlos Martín Nieto2015-05-282-2/+2
| | | | | | An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
* examples: show the sideband progress on cloneCarlos Martín Nieto2015-05-131-0/+8
| | | | | This lets us see what the server (or libgit2 locally) is doing, rather than having to stare at a non-moving screen.
* examples: adjust to the new remote APICarlos Martín Nieto2015-05-134-24/+16
|
* Restructured to be nicer exampleTomas Paladin Volf2015-05-021-9/+14
| | | | | Code restructured to better represent best practice when using libgit2.
* Added call to git_libgit2_shutdown()Tomas Paladin Volf2015-04-301-2/+4
| | | Added forgotten call to git_libgit2_shutdown() to the /examples/network/git2.c.
* describe example: enable building by default.Patrick Steinhardt2015-04-072-0/+2
|
* examples: add remote example.Patrick Steinhardt2015-03-193-1/+279
|
* Merge pull request #2808 from libgit2/cmn/repo-identEdward Thomson2015-03-031-1/+1
|\ | | | | Remove the signature from ref-modifying functions
| * Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #2885 from JIghtuse/masterCarlos Martín Nieto2015-03-031-6/+24
|\ \ | |/ |/| describe example: function to add commits to opts
| * describe example: function to add commits to optsBoris Egorov2015-02-061-6/+24
| | | | | | | | | | | | | | Add safe function to (a,rea)llocate memory which terminate example on memory allocation failure. Move code to allocate commits to its own function.