summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: don't use deprecated typesEdward Thomson2019-01-251-2/+2
|
* errors: remove giterr usage in examplesEdward Thomson2019-01-226-12/+12
|
* Merge pull request #4939 from libgit2/ethomson/git_refEdward Thomson2019-01-192-3/+3
|\ | | | | Move `git_ref_t` to `git_reference_t`
| * references: use new names in internal usageethomson/git_refEdward Thomson2019-01-172-3/+3
| | | | | | | | Update internal usage to use the `git_reference` names for constants.
* | object_type: convert final internal users to new namesethomson/git_objEdward Thomson2019-01-177-13/+13
|/ | | | | Update some missed types that were continuing to use the old `GIT_OBJ` names.
* Merge pull request #4374 from pks-t/pks/pack-file-verifyEdward Thomson2018-08-261-1/+1
|\ | | | | Pack file verification
| * indexer: introduce options struct to `git_indexer_new`Patrick Steinhardt2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | We strive to keep an options structure to many functions to be able to extend options in the future without breaking the API. `git_indexer_new` doesn't have one right now, but we want to be able to add an option for enabling strict packfile verification. Add a new `git_indexer_options` structure and adjust callers to use that.
* | Merge pull request #4692 from tiennou/examples/checkoutPatrick Steinhardt2018-07-204-23/+293
|\ \ | | | | | | Add a checkout example
| * | examples: add checkoutEtienne Samson2018-07-171-0/+235
| | |
| * | examples: add a helper for boolean-style optionsEtienne Samson2018-07-072-0/+28
| | |
| * | examples: make the refish resolution work with short OIDsEtienne Samson2018-07-071-3/+4
| | |
| * | examples: move refish resolution function in commonEtienne Samson2018-07-073-23/+29
| |/
* | cmake: enforce C90 standardPatrick Steinhardt2018-07-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | While the aim of libgit2 was to conform to C90 code, we never instructed the compiler to enforce C90 compliance. Thus, quite a few violations were able to get into our code base, which have been removed with the previous commits. As we are now able to build libgit2 with C90 enforced, we can set the C_STANDARD property for our own build targets. Note that we explicitly avoid setting the C standard for our third-party dependencies. At least the zlib target does not build with C90 enforced, and we do not want to fix them by deviating from upstream. Thus we simply enforce no standard for them.
* | cmake: distinguish internal and system include directoriesPatrick Steinhardt2018-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we want to enforce strict C90 mode, this may cause issues with system provided header files which are themselves not strictly conforming. E.g. if a system header has C++ style comments, a compiler in strict C90 mode would produce an error and abort the build. As the user most likely doesn't want to change the system header, this would completely break the build on such systems. One example of this is mbedtls, which provides such header files. The problem can be worked around by distinguishing between system-provided and project-provided include directories. When adding include directories via "-isystem" instead of "-I", the compiler will skip certain checks and print out less warnings. To use system includes, we can simply add the "SYSTEM" flag to CMake's `INCLUDE_DIRECTORIES` and `TARGET_INCLUDE_DIRECTORIES` functions. Note that we have to split the include directories into two variables because of this, as we definitely still want to check for all warnings produced by our own header files.
* | treewide: remove use of C++ style commentsPatrick Steinhardt2018-07-134-13/+17
|/ | | | | | | | | C++ style comment ("//") are not specified by the ISO C90 standard and thus do not conform to it. While libgit2 aims to conform to C90, we did not enforce it until now, which is why quite a lot of these non-conforming comments have snuck into our codebase. Do a tree-wide conversion of all C++ style comments to the supported C style comments to allow us enforcing strict C90 compliance in a later commit.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-103-3/+3
|
* Merge pull request #4642 from pks-t/pks/cmake-resolve-pkgconfigPatrick Steinhardt2018-05-091-1/+0
|\ | | | | cmake: resolve libraries found by pkg-config
| * cmake: remove now-useless LIBGIT2_LIBDIRS handlingPatrick Steinhardt2018-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | With the recent change of always resolving pkg-config libraries to their full path, we do not have to manage the LIBGIT2_LIBDIRS variable anymore. The only other remaining user of LIBGIT2_LIBDIRS is winhttp, which is a CMake-style library target and can thus be resolved by CMake automatically. Remove the variable to simplify our build system a bit.
* | tests: ls-files: use puts instead of printf and fix typosCarson Howard2018-05-021-4/+4
| |
* | examples: ls-files: print entry path only when entry is foundCarson Howard2018-03-271-5/+4
| |
* | examples: ls-files: update print_paths to print all casesCarson Howard2018-03-271-19/+17
| |
* | test: ls-files: remove dependency on git_arrayCarson Howard2018-03-271-11/+12
| |
* | examples: ls-files: fix build errorCarson Howard2018-03-271-1/+1
| |
* | examples: ls-files: address PR and styleCarson Howard2018-03-271-24/+14
| |
* | examples: ls-files: use git_array_t to handle filesCarson Howard2018-03-271-11/+11
| |
* | examples: ls-files: build file list with arrayCarson Howard2018-03-271-9/+9
| |
* | examples: ls-files: fix compile errorCarson Howard2018-03-271-3/+7
| |
* | examples: ls-files: fix style and refactorCarson Howard2018-03-271-70/+65
| |
* | examples: ls-files: handle --error-unmatchCarson Howard2018-03-271-15/+42
| |
* | examples: ls-files: show current files in indexCarson Howard2018-03-271-20/+109
| |
* | examples: ls-files: list filesCarson Howard2018-03-271-0/+37
|/
* examples: zero out our options memory before useEtienne Samson2018-01-251-0/+2
|
* examples: our/their can be NULLEtienne Samson2018-01-251-2/+4
|
* examples: fix remaining review commentsEtienne Samson2018-01-251-0/+2
|
* examples: move support code into static functionsEtienne Samson2018-01-251-81/+97
|
* examples: hoist the merge analysis back into mainEtienne Samson2018-01-251-58/+39
|
* examples: minor review fixupsEtienne Samson2018-01-251-10/+12
|
* examples: add mergeEtienne Samson2018-01-251-0/+391
|
* examples: Dead code & warningsEtienne Samson2018-01-251-7/+0
|
* examples: Move xrealloc to common example codeEtienne Samson2018-01-253-10/+15
|
* examples: Switch to the nifty argv helpers from commonEtienne Samson2018-01-252-19/+36
|
* 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
|