examples/common.h


Log

Author Commit Date CI Message
Patrick Steinhardt 56e7aaf0 2019-08-01T12:40:51 Merge pull request #5125 from albfan/wip/albfan/diff_buffers Compare buffers in diff example
Patrick Steinhardt 8ee3d39a 2019-06-27T09:18:19 examples: implement config example Implement a new example that resembles git-config(1). Right now, this example can both read and set configuration keys, only.
Patrick Steinhardt 960d2a07 2019-07-05T14:30:48 examples: consolidate includes into "common.h" Consolidate all standard includes and defines into "common.h". This lets us avoid having to handle platform-specific things in multiple places.
Alberto Fanjul 3be09b6c 2019-06-18T08:31:31 Compare buffers in diff example
Patrick Steinhardt b106620d 2019-04-16T10:56:18 examples: move MSVC compatibility macros into common header We currently have two locations in our examples where we define the same compatibility wrappers for MSVC. Move them into "common.h" to avoid duplication and make them available to other examples.
Patrick Steinhardt ead10785 2019-01-24T11:31:49 examples: create common lg2 executable Inside of our networking example code, we have a git2 executable that acts as an entry point to all the different network examples. As such, it is kind of the same like the normal git(1) executable in that it simply arbitrates to the respective subcommands. Let's extend this approach and merge all examples into a single standalone lg2 executable. Instead of building an executable for all the existing examples we have, we now bundle them all inside of the lg2 one and let them be callable via subcommands. In the process, we can get rid of duplicated library initialization, deinitialization and repository discovery code. Instead of having each subcommand handle these on its own, we simply do it inside of the single main function now.
Patrick Steinhardt 7562422a 2019-01-24T10:30:58 examples: merge common network code Right now, we have two sets of "common" code, one containing general common code and one containing network common code. As we intend to get rid of the network subdirectory and instead merge all examples into a single standalone executable, this distinction doesn't make a lot of sense now. Furthermore, the common network code is not that big. Let's get rid of the common network code by merging it into the general common code.
Etienne Samson 5b7ba786 2018-06-23T15:45:04 examples: add a helper for boolean-style options
Etienne Samson 8a629afe 2018-01-31T00:02:00 examples: move refish resolution function in common
Etienne Samson 3fa5e577 2018-01-17T02:25:36 examples: Move xrealloc to common example code
Patrick Steinhardt 5c2a8361 2016-08-16T11:01:09 examples: diff: parse correct types for line-diffopts
Linquize d6bbcefc 2014-10-12T15:52:53 describe: add example
Ben Straub 6cb831bd 2013-11-02T05:33:26 Replace copyright topmatter in example files
Russell Belfer 66902d47 2013-10-29T18:30:49 Extract common example helpers and reorg examples This reorganizes a few of the examples so that the main function comes first with the argument parsing extracted into a helper that can come at the end of the file (so the example focuses more on the use of libgit2 instead of command line support). This also creates a shared examples/common.[ch] so that useful helper funcs can be shared across examples instead of repeated.