|
635ec366
|
2019-04-16T10:51:43
|
|
examples: honor allowed credential types when prompting user
Credential callback are being passed a bitset that indicates
which credential types are allowed in the current context. In our
examples code, we completely ignore that field and always return
username/password credentials, which doesn't necessarily make
sense e.g. when only SSH keys are allowed.
Refactor the code and only return username/password credentials
in the case where `USERPASS_PLAINTEXT` credentials are allowed.
Otherwise, return a positive error code to indicate that no
credentials could be acquired.
|
|
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.
|
|
a1ef995d
|
2019-02-21T10:33:30
|
|
indexer: use git_indexer_progress throughout
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
|
|
6cf47726
|
2019-01-15T13:54:18
|
|
examples/add: add explanatory comments and reformat
|
|
106998fc
|
2019-01-24T11:48:44
|
|
examples: print available commands if no args are given
|
|
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.
|
|
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.
|
|
c4271314
|
2019-01-24T10:27:07
|
|
examples: remove unused Makefile
This Makefile isn't used anymore and probably won't work anyway.
Remove it in favor of the existing CMake build instructions.
|
|
a540e6bb
|
2019-01-24T10:07:31
|
|
examples: remove test script
In commit 2e2332857 (examples: a test, for rev-list, 2013-03-20),
a script was introduced with the intention of testing our
rev-list example code. Nobody uses that script, and in fact it
doesn't even properly work due to the not-so-recent addition
out-of-source builds.
Remove the script.
|
|
24ac9e0c
|
2019-02-13T23:26:54
|
|
deprecation: ensure we GIT_EXTERN deprecated funcs
Although the error functions were deprecated, we did not properly mark
them as deprecated. We need to include the `deprecated.h` file in order
to ensure that the functions get their export attributes.
Similarly, do not define `GIT_DEPRECATE_HARD` within the library, or
those functions will also not get their export attributes. Define that
only on the tests and examples.
|
|
cc5da0a6
|
2019-01-23T09:36:52
|
|
examples: don't use deprecated types
|
|
fcc7dcb1
|
2019-01-10T22:39:56
|
|
errors: remove giterr usage in examples
|
|
1758636b
|
2019-01-19T01:38:34
|
|
Merge pull request #4939 from libgit2/ethomson/git_ref
Move `git_ref_t` to `git_reference_t`
|
|
83151018
|
2019-01-17T10:47:32
|
|
object_type: convert final internal users to new names
Update some missed types that were continuing to use the old `GIT_OBJ`
names.
|
|
ed8cfbf0
|
2019-01-17T00:32:31
|
|
references: use new names in internal usage
Update internal usage to use the `git_reference` names for constants.
|
|
50186ce8
|
2018-08-26T11:26:45
|
|
Merge pull request #4374 from pks-t/pks/pack-file-verify
Pack file verification
|
|
ea9e2c1a
|
2018-07-20T13:06:56
|
|
Merge pull request #4692 from tiennou/examples/checkout
Add a checkout example
|
|
b24202e1
|
2018-07-07T12:52:24
|
|
examples: add checkout
|
|
e1a4a8eb
|
2018-06-25T11:58:34
|
|
cmake: enforce C90 standard
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.
|
|
c13e56f9
|
2018-06-25T14:12:53
|
|
cmake: distinguish internal and system include directories
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.
|
|
9994cd3f
|
2018-06-25T11:56:52
|
|
treewide: remove use of C++ style comments
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.
|
|
5b7ba786
|
2018-06-23T15:45:04
|
|
examples: add a helper for boolean-style options
|
|
8e063eb6
|
2018-06-23T15:44:35
|
|
examples: make the refish resolution work with short OIDs
|
|
8a629afe
|
2018-01-31T00:02:00
|
|
examples: move refish resolution function in common
|
|
c16556aa
|
2017-11-12T10:31:48
|
|
indexer: introduce options struct to `git_indexer_new`
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.
|
|
ecf4f33a
|
2018-02-08T11:14:48
|
|
Convert usage of `git_buf_free` to new `git_buf_dispose`
|
|
f9cf9a04
|
2018-05-09T14:51:57
|
|
Merge pull request #4642 from pks-t/pks/cmake-resolve-pkgconfig
cmake: resolve libraries found by pkg-config
|
|
8ab470f5
|
2018-04-27T15:31:43
|
|
cmake: remove now-useless LIBGIT2_LIBDIRS handling
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.
|
|
8aa437ef
|
2018-05-02T07:55:26
|
|
tests: ls-files: use puts instead of printf and fix typos
|
|
d7394c36
|
2018-03-27T07:21:02
|
|
examples: ls-files: print entry path only when entry is found
|
|
29ca3f33
|
2018-01-06T11:26:41
|
|
examples: ls-files: update print_paths to print all cases
|
|
7d079413
|
2017-12-19T15:29:40
|
|
test: ls-files: remove dependency on git_array
|
|
ee144650
|
2017-11-13T21:03:21
|
|
examples: ls-files: fix build error
|
|
e8661169
|
2017-11-13T20:52:31
|
|
examples: ls-files: address PR and style
|
|
3f64a9db
|
2017-10-25T19:19:17
|
|
examples: ls-files: use git_array_t to handle files
|
|
37cbc3ea
|
2017-10-23T09:54:39
|
|
examples: ls-files: build file list with array
|
|
d2f99e0a
|
2017-10-22T21:23:40
|
|
examples: ls-files: fix compile error
|
|
cd39273d
|
2017-10-22T20:43:22
|
|
examples: ls-files: fix style and refactor
|
|
52d83dde
|
2017-10-17T21:10:54
|
|
examples: ls-files: handle --error-unmatch
|
|
991fc088
|
2017-10-16T21:33:46
|
|
examples: ls-files: show current files in index
|
|
30e919c4
|
2017-10-16T16:46:19
|
|
examples: ls-files: list files
|
|
33f44db9
|
2018-01-25T22:17:39
|
|
examples: zero out our options memory before use
|
|
fb79d7d1
|
2018-01-17T02:34:32
|
|
examples: our/their can be NULL
|
|
cc845595
|
2018-01-17T02:25:36
|
|
examples: fix remaining review comments
|
|
5ce4f19b
|
2018-01-17T02:25:36
|
|
examples: move support code into static functions
|
|
503b30d5
|
2018-01-17T02:25:36
|
|
examples: hoist the merge analysis back into main
|
|
60c6547c
|
2018-01-17T02:25:36
|
|
examples: minor review fixups
|
|
59ea2c58
|
2018-01-17T02:25:36
|
|
examples: add merge
|
|
bb9353cf
|
2018-01-17T02:25:36
|
|
examples: Dead code & warnings
|
|
3fa5e577
|
2018-01-17T02:25:36
|
|
examples: Move xrealloc to common example code
|
|
b6720018
|
2018-01-17T02:25:36
|
|
examples: Switch to the nifty argv helpers from common
|
|
bf15dbf6
|
2017-11-06T12:47:40
|
|
examples: network: fix Win32 linking errors due to getline
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.
|
|
9e3fb594
|
2017-10-29T15:32:18
|
|
Merge pull request #4373 from cjhoward92/examples/log-show-log-size
example-log: add support for --log-size
|
|
9b12eb6f
|
2017-10-20T15:05:26
|
|
examples: remove Makefile
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.
|
|
12a888d5
|
2017-10-13T07:18:54
|
|
examples: log: pass options pointer to print_commit
Cleaned up the PR to address styling issues.
|
|
1436b0e1
|
2017-10-11T21:47:58
|
|
example-log: add support for --log-size
|
|
f4770e47
|
2017-01-01T09:28:39
|
|
Fix Issue #4047 Check return codes and free objects
|
|
8e31cc25
|
2017-06-28T12:51:14
|
|
cmake: keep track of libraries and includes via lists
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.
|
|
f0ca00e0
|
2017-05-03T12:25:48
|
|
examples: network: refactor credentials callback
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.
|
|
f9ea8c6a
|
2017-01-12T22:02:14
|
|
examples: general: fix memory leaks
|
|
ed2b1c7e
|
2017-01-12T22:01:45
|
|
examples: general: display config only if it was found
|
|
5aa10107
|
2017-01-12T22:01:23
|
|
examples: general: narrow down scope of loop variables
|
|
8572e225
|
2017-01-12T22:00:53
|
|
examples: general: clean up committer/author variables
|
|
3fdba15c
|
2017-01-09T14:09:57
|
|
fix examples/network/clone.c: heap-buffer-overflow
Format of a length of string to the correct format is:%.*s
|
|
832278bf
|
2016-12-29T07:43:03
|
|
Fix issue #4046 Seg fault in config_files()
|
|
fc293919
|
2016-08-16T11:43:10
|
|
examples: add: fix type casting warning
|
|
5c2a8361
|
2016-08-16T11:01:09
|
|
examples: diff: parse correct types for line-diffopts
|
|
7314da10
|
2016-08-16T10:55:28
|
|
examples: fix warnings in network/fetch.c
|
|
e2d1b7ec
|
2016-08-16T10:46:35
|
|
examples: general: fix remaining warnings
|
|
662eee15
|
2016-08-16T10:09:52
|
|
examples: general: convert C99 comments to C90 comments
|
|
c313e3d9
|
2016-09-01T12:44:08
|
|
examples: general: extract function demonstrating OID parsing
|
|
29d9afc0
|
2016-08-16T10:06:17
|
|
examples: general: extract function demonstrating ODB
|
|
b009adad
|
2016-08-16T09:59:28
|
|
examples: general: extract function demonstrating commit writing
|
|
15960454
|
2016-08-16T09:36:31
|
|
examples: general: extract functions demonstrating object parsing
|
|
8b93ccdf
|
2016-08-16T09:35:08
|
|
examples: general: extract function demonstrating revwalking
|
|
c079e3c8
|
2016-08-16T09:32:15
|
|
examples: general: extract function demonstrating index walking
|
|
f9a7973d
|
2016-08-16T09:29:14
|
|
examples: general: extract function demonstrating reference listings
|
|
986913f4
|
2016-08-16T09:25:06
|
|
examples: general: extract function demonstrating config files
|
|
176d58ba
|
2016-08-16T09:17:12
|
|
examples: general: use tabs instead of spaces
|
|
07bd3e57
|
2015-05-07T12:57:56
|
|
proxy: ask the user for credentials if necessary
|
|
698e0c27
|
2016-03-07T16:34:30
|
|
Update link to Pro Git's Git internals chapter.
|
|
8b8f1f91
|
2015-10-07T14:01:05
|
|
fix return
|
|
5d7cd57f
|
2015-09-08T14:15:29
|
|
Update another call to git_remote_connect
|
|
97c0a85f
|
2015-07-13T11:23:07
|
|
Merge pull request #3306 from libgit2/cmn/fetch-ex-fetch
examples: modernise the fetch example
|
|
768f8be3
|
2015-06-30T19:00:41
|
|
Fix #3094 - improve use of portable size_t/ssize_t format specifiers.
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.
|
|
6c7e86e1
|
2015-07-12T19:41:01
|
|
examples: modernise the fetch example
Under normal conditions, git_remote_fetch() should be the only function
used to perform a fetch. Don't let the example lead people astray.
|
|
d202bb7d
|
2015-06-29T21:48:35
|
|
examples: clean up some warnings
|
|
c2418f46
|
2015-06-25T12:48:44
|
|
Rename FALLBACK to UNSPECIFIED
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
|
|
7d6dacdc
|
2015-05-09T10:42:00
|
|
examples: adjust to submodule status API change
|
|
9334c86f
|
2015-06-03T14:54:26
|
|
print_usage functions is defined but not used
Use the previously created function to display a message when the arguments are not valid.
ticket 3095
|
|
ae5b9362
|
2015-05-17T15:11:45
|
|
remote: remove fetch parameter from create_anonymous
An anonymous remote is not configured and cannot therefore have
configured refspecs. Remove the parameter which adds this from the
constructor.
|
|
cf66c474
|
2015-05-06T12:26:05
|
|
examples: show the sideband progress on clone
This lets us see what the server (or libgit2 locally) is doing, rather
than having to stare at a non-moving screen.
|
|
3fec548a
|
2015-04-23T06:01:13
|
|
examples: adjust to the new remote API
|
|
785990be
|
2015-05-02T12:16:22
|
|
Restructured to be nicer example
Code restructured to better represent best practice when
using libgit2.
|
|
9bff15f4
|
2015-04-30T15:10:28
|
|
Added call to git_libgit2_shutdown()
Added forgotten call to git_libgit2_shutdown() to the /examples/network/git2.c.
|
|
c843736d
|
2015-04-07T14:43:04
|
|
describe example: enable building by default.
|
|
0a2f99fd
|
2015-01-26T15:36:34
|
|
examples: add remote example.
|
|
72ca65d5
|
2015-03-03T10:07:36
|
|
Merge pull request #2808 from libgit2/cmn/repo-ident
Remove the signature from ref-modifying functions
|
|
659cf202
|
2015-01-07T12:23:05
|
|
Remove the signature from ref-modifying functions
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.
|
|
fe477951
|
2015-03-03T14:35:10
|
|
Merge pull request #2885 from JIghtuse/master
describe example: function to add commits to opts
|