examples/network


Log

Author Commit Date CI Message
Patrick Steinhardt 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.
Force.Charlie-I 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
Patrick Steinhardt 7314da10 2016-08-16T10:55:28 examples: fix warnings in network/fetch.c
Carlos Martín Nieto 07bd3e57 2015-05-07T12:57:56 proxy: ask the user for credentials if necessary
Eun 8b8f1f91 2015-10-07T14:01:05 fix return
Matt Burke 5d7cd57f 2015-09-08T14:15:29 Update another call to git_remote_connect
Carlos Martín Nieto 97c0a85f 2015-07-13T11:23:07 Merge pull request #3306 from libgit2/cmn/fetch-ex-fetch examples: modernise the fetch example
Matthew Plough 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.
Carlos Martín Nieto 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.
Edward Thomson d202bb7d 2015-06-29T21:48:35 examples: clean up some warnings
Carlos Martín Nieto 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.
Carlos Martín Nieto 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.
Carlos Martín Nieto 3fec548a 2015-04-23T06:01:13 examples: adjust to the new remote API
Tomas Paladin Volf 785990be 2015-05-02T12:16:22 Restructured to be nicer example Code restructured to better represent best practice when using libgit2.
Tomas Paladin Volf 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.
Carlos Martín Nieto 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.
Edward Thomson 14fec0ae 2015-02-14T12:10:00 example: drop `SAFE_CREATE` from clone example
Edward Thomson 9af3c416 2015-01-10T18:05:01 clone example: don't divide by zero Local transports don't have data about the size, avoid dividing by zero in the callback.
Carlos Martín Nieto 799e22ea 2014-10-23T17:34:41 Rename git_threads_ to git_libgit2_ This describes their purpose better, as we now initialize ssl and some other global stuff in there. Calling the init function is not something which has been optional for a while now.
Carlos Martín Nieto 209425ce 2014-11-08T13:25:51 remote: rename _load() to _lookup() This brings it in line with the rest of the lookup functions.
Carlos Martín Nieto 3f894205 2014-06-06T15:01:45 remote: allow overriding the refspecs for download and fetch With opportunistic ref updates, git has introduced the concept of having base refspecs *and* refspecs that are active for a particular fetch. Let's start by letting the user override the refspecs for download.
Linquize 2c22193b 2014-09-16T08:56:33 Fix typo
Jacques Germishuys 48e60ae7 2014-04-21T11:23:29 Don't redefine the same callback types, their signatures may change
Carlos Martín Nieto fd536d29 2014-03-26T11:15:57 remote: rename inmemory to anonymous and swap url and fetch order The order in this function is the opposite to what create_with_fetchspec() has, so change this one, as url-then-refspec is what git does. As we need to break compilation and the swap doesn't do that, let's take this opportunity to rename in-memory remotes to anonymous as that's really what sets them apart.
Ben Straub 6affd71f 2014-01-03T17:38:34 git_checkout_opts -> git_checkout_options
Miha 300f4412 2014-02-25T11:56:11 - BUGFIX #2133 (@fourplusone) in smart_protocol.c - added MSVC cmake definitions to disable warnings - general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows - some MSVC reported warning fixes
Ben Straub 5c8be325 2014-02-05T13:32:45 Fix a few references to changed function signatures
Vicent Martí 6414fd33 2013-11-11T06:47:15 Merge pull request #1956 from libgit2/cmn/fetch-default-head Remote revamp (director's cut)
Carlos Martín Nieto 359dce72 2013-11-02T00:05:32 remote: make _ls return the list directly The callback-based method of listing remote references dates back to the beginning of the network code's lifetime, when we didn't know any better. We need to keep the list around for update_tips() after disconnect() so let's make use of this to simply give the user a pointer to the array so they can write straightforward code instead of having to go through a callback.
Edward Thomson ad62f2ee 2013-11-07T12:00:43 update example to new packfile creation signature
Ben Straub ea8ce3d1 2013-11-04T15:50:33 Fix warnings
Vicent Martí 567649f2 2013-11-01T09:38:34 Merge pull request #1916 from libgit2/simplify-examples Fix examples to make the important stuff more obvious
Ben Straub 4f62d559 2013-11-01T05:39:21 Fix typos
Carlos Martín Nieto c44820c6 2013-10-31T23:42:50 A few formatting changes for rocco I'm not too happy about manually inserting < and > but those get output as html tags otherwise.
Carlos Martín Nieto a6154f21 2013-10-30T15:00:05 indexer: remove the stream infix It was there to keep it apart from the one which read in from a file on disk. This other indexer does not exist anymore, so there is no need for anything other than git_indexer to refer to it. While here, rename _add() function to _append() and _finalize() to _commit(). The former change is cosmetic, while the latter avoids talking about "finalizing", which OO languages use to mean something completely different.
Vicent Martí 5c50f22a 2013-10-28T09:25:44 Merge pull request #1891 from libgit2/cmn/fix-thin-packs Add support for thin packs
Carlos Martín Nieto ab46b1d8 2013-10-23T15:08:18 indexer: include the delta stats The user is unable to derive the number of deltas in the pack, as that would require them to capture the stats exactly in the moment between download and final processing, which is abstracted away in the fetch. Capture these numbers for the user and expose them in the progress struct. The clone and fetch examples now also present this information to the user.
Carlos Martín Nieto ebbd48f0 2013-10-23T14:22:44 examples: show used local objects in fetch Show how many local objects were used to fix the thin pack in our fetch example.
Carlos Martín Nieto 0b33fca0 2013-10-02T13:39:35 indexer: fix thin packs When given an ODB from which to read objects, the indexer will attempt to inject the missing bases at the end of the pack and update the header and trailer to reflect the new contents.
Carlos Martín Nieto 0e0cf787 2013-10-02T14:04:44 clone: put the callbacks struct directly in the clone options There's no need for this to be a pointer to somewhere else.
Carlos Martín Nieto e3c131c5 2013-09-16T05:02:25 remote: move the credentials callback to the struct Move this one as well, letting us have a single way of setting the callbacks for the remote, and removing fields from the clone options.
Carlos Martín Nieto d31402a3 2013-09-16T04:20:05 remote: put the _download() callback with the others The text progress and update_tips callbacks are already part of the struct, which was meant to unify the callback setup, but the download one was left out.
Krzysztof Adamski 255836dd 2013-09-01T18:35:39 Adding credentials callback to ls-remote and fetch too.
Krzysztof Adamski d6d52348 2013-09-01T18:30:11 Removing unneeded code duplication in ls-remote.c
Carlos Martín Nieto 6c1b6b7a 2013-04-23T16:21:47 examples: init the threading system
Russell Belfer 9da187e8 2013-04-09T11:40:00 Fix clang warnings and improve checks
lionel vitte e2886f1e 2013-03-20T21:13:43 Fix link issue in network examples
Martin Woodward 5c46937b 2013-02-26T09:00:37 Give props to Martin Pool Martin Pool was the original author of the code referenced in the clone example. Make note that he's given his permission and also give him the proper credit.
Ben Straub fe95ac1b 2013-02-05T10:59:58 Allow progress callback to cancel fetch This works by having the indexer watch the return code of the callback, so will only take effect on object boundaries.
Ben Straub 7602cb7c 2013-01-31T10:44:57 Add user-from-url param to auth callback
Edward Thomson c27e2112 2013-01-23T17:38:00 update examples to work on windows
Sebastian Bauer cea994b9 2013-01-10T12:39:17 Don't call pthread_exit() in the callback. Compilers that are not aware that pthread_exit() does not return issue a warning when compiling the present code. This change exchanges the call to pthread_exit() with a simple return statement. According to the pthread specification this is equivalent.
Ben Straub 730df6d0 2013-01-02T13:43:54 Include checkout options inline
Ben Straub 0642c143 2013-01-02T12:44:47 Move `url` to last place in parameter list
Ben Straub 3de22567 2012-12-27T11:12:14 Fix warnings in example
Ben Straub 69d1bd91 2012-12-21T15:30:46 Fix examples
Ben Straub 29f27599 2012-12-20T10:51:09 Rename remote creation APIs git_remote_add -> git_remote_create git_remote_new -> git_remote_create_inmemory
Ben Straub 316bca69 2012-12-19T17:07:12 Fix clone sample
Ben Straub cc3e9b5a 2012-12-16T10:50:10 Make building samples more friendly
Ben Straub b9e7e2b4 2012-12-14T13:46:45 Move non-options back out of options struct
Ben Straub 0015b587 2012-12-14T13:18:06 Deploy git_clone_options to network sample
Ben Straub 2b10a2b0 2012-12-13T11:47:14 Enable authenticated clones in network sample
Ben Straub 24393ea6 2012-12-13T09:14:56 Stop premature remote freeing when cloning
Ben Straub 34c8c754 2012-12-13T08:54:23 Fix network example
Ben Straub 9267ff58 2012-11-29T20:01:24 Deploy GIT_REMOTE_CALLBACKS_INIT
Ben Straub b81aa2f1 2012-11-29T14:06:40 Deploy GIT_CHECKOUT_OPTS_INIT
Ben Straub df705148 2012-11-27T13:15:43 API updates for remote.h Includes typedef for git_direction, and renames for GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
Ben Straub 3f63cc9e 2012-11-18T22:20:47 Examples: fix clone api
Russell Belfer 0f3def71 2012-11-09T11:19:46 Fix various cross-platform build issues This fixes a number of warnings and problems with cross-platform builds. Among other things, it's not safe to name a member of a structure "strcmp" because that may be #defined.
Ben Straub 1e3b8ed5 2012-10-24T14:07:07 Remove 'bytes' param from git_remote_download
Ben Straub 9762ad99 2012-10-24T13:43:23 Renaming: fix example
Ben Straub 7d222e13 2012-10-24T13:29:14 Network progress: rename things git_indexer_stats and friends -> git_transfer_progress* Also made git_transfer_progress members more sanely named.
Ben Straub 2dae54a9 2012-10-19T20:24:15 Improve clone sample's formatting
Ben Straub 9c05c17b 2012-10-19T20:05:18 Checkout progress now reports completed/total steps
Ben Straub 7bcd9e23 2012-10-19T19:23:32 gitno_buffer: callback on each packet The fetch code takes advantage of this to implement a progress callback every 100kb of transfer.
Ben Straub aa1e8674 2012-10-18T12:57:47 Clone: in-line callbacks for progress Also implemented in the git2 example.
Ben Straub 7635a118 2012-10-17T14:06:32 Fix example compilation
Ben Straub 2b7efe03 2012-10-17T10:15:51 Example: compile fixes (not yet working)
Ben Straub 45b60d7b 2012-10-18T15:17:12 Correct progress reporting from checkout
Ben Straub d57c47dc 2012-10-16T13:29:12 Add accessor for git_remote's stats field Also converted the network example to use it.
Carlos Martín Nieto 0a1db746 2012-05-14T20:46:30 examples: add progress output to fetch
Carlos Martín Nieto bffa852f 2012-07-13T12:01:11 indexer: recognize and mark when all of the packfile has been downloaded We can't always rely on the network telling us when the download is finished. Recognize it from the indexer itself.
Vicent Martí f98c32f3 2012-08-19T01:26:06 Merge pull request #778 from ben/clone Clone
Ben Straub 383fb799 2012-07-31T08:51:38 Rename example function to avoid name collision.
Ben Straub 7e02c7c5 2012-07-31T08:45:42 Checkout: save index on checkout.
Ben Straub 84595a30 2012-07-30T14:38:32 Add clone to the network example.
Carlos Martín Nieto ae789622 2012-07-25T10:52:20 examples: fix warnings in network/
Carlos Martín Nieto 64d01de8 2012-07-24T14:23:16 remote: start moving the protocol to a common area For the transition, http is going to keep its own logic until the git/common code catches up with the implied multi_ack that http has. This also has the side-effect of making the code cleaner and more correct regardingt he protocol.
Carlos Martín Nieto b3aaa7a7 2012-07-21T17:52:51 Add a struct for network callbacks Currently only update_tips is used, but it prepares the way for progress output during download.
Carlos Martín Nieto 37159957 2012-06-28T09:33:08 indexer: don't use '/objects/pack/' unconditionally Not everyone who indexes a packfile wants to put it in the standard git repository location.
Chris Young 66a8b662 2012-06-14T19:15:46 Fix incorrect revert
Chris Young a8df98c6 2012-06-14T18:57:24 Updates from comments on OS4 compatibility pull request http://github.com/libgit2/libgit2/pull/766
Chris Young 41cbbea8 2012-06-09T23:03:27 Let platform 'Generic' get the regex deps so we don't need to use our external ones
Chris Young 5c0fd7b9 2012-06-09T13:20:07 allow disabling pthreads for testing
Chris Young bb502fa8 2012-06-09T12:52:49 Fix makefile
Carlos Martín Nieto 7eeec8f2 2012-05-24T16:41:53 examples/network: consistently use tabs for indentation
Vicent Martí e172cf08 2012-05-18T01:21:06 errors: Rename the generic return codes
Carlos Martín Nieto 41178b41 2012-05-11T21:49:33 examples: fix an oopsie
Carlos Martín Nieto fb49bdf9 2012-05-10T16:52:12 examples: update network examples error handling Use giterr_last() and make sure it's not NULL.
Carlos Martín Nieto baaa8a44 2012-05-03T20:25:56 remotes: change git_remote_new's signature Add a fetch refspec arguemnt and make the arguments (name, url, refspec), as that order makes more sense.