Commit Graph

106 Commits

Author SHA1 Message Date
Ben Straub
fe95ac1b67 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.
2013-02-05 10:59:58 -08:00
Ben Straub
7602cb7c0e Add user-from-url param to auth callback 2013-01-31 10:44:57 -08:00
Edward Thomson
c27e211219 update examples to work on windows 2013-01-23 17:38:00 -06:00
Sebastian Bauer
75a0a80029 Don't clear the opt instance in the diff example.
The version field is overwritten otherwise. The opt instance is
already initialized properly.
2013-01-23 07:47:40 +01:00
Sebastian Bauer
cea994b902 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.
2013-01-10 12:39:17 +01:00
Vicent Martí
cd5ca5b97f Merge pull request #1152 from ben/clone-api-structification
Segregate in-memory and persisted remotes
2013-01-02 13:50:41 -08:00
Ben Straub
730df6d0f7 Include checkout options inline 2013-01-02 13:43:54 -08:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
Russell Belfer
dbc4aa0750 Update showindex example
I find the showindex example to be pretty useful on occasion, but
there were are couple of output tweaks I wanted, plus I wanted the
ability to specify a path to an actual index file instead of having
to open the whole repository.  This makes those changes and expands
the example slightly.
2012-12-28 22:00:24 -08:00
Ben Straub
3de2256708 Fix warnings in example 2012-12-27 11:12:14 -08:00
Ben Straub
69d1bd9125 Fix examples 2012-12-21 15:30:46 -08:00
Ben Straub
29f27599ea Rename remote creation APIs
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
2012-12-20 10:52:57 -08:00
Ben Straub
316bca697f Fix clone sample 2012-12-19 17:07:12 -08:00
Russell Belfer
56c72b759c Fix diff constructor name order confusion
The diff constructor functions had some confusing names, where the
"old" side of the diff was coming after the "new" side.  This
reverses the order in the function name to make it less confusing.

Specifically...

* git_diff_index_to_tree becomes git_diff_tree_to_index
* git_diff_workdir_to_index becomes git_diff_index_to_workdir
* git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
2012-12-17 11:00:53 -08:00
Ben Straub
cc3e9b5af4 Make building samples more friendly 2012-12-16 10:50:10 -08:00
Ben Straub
b9e7e2b4e1 Move non-options back out of options struct 2012-12-14 13:46:45 -08:00
Ben Straub
0015b5875e Deploy git_clone_options to network sample 2012-12-14 13:18:06 -08:00
Ben Straub
2b10a2b0e8 Enable authenticated clones in network sample 2012-12-13 11:47:14 -08:00
Ben Straub
24393ea6d3 Stop premature remote freeing when cloning 2012-12-13 09:14:56 -08:00
Ben Straub
34c8c75433 Fix network example 2012-12-13 08:54:23 -08:00
Ben Straub
9267ff586f Deploy GIT_REMOTE_CALLBACKS_INIT 2012-11-30 13:12:15 -08:00
Ben Straub
2f8d30becb Deploy GIT_DIFF_OPTIONS_INIT 2012-11-30 13:12:14 -08:00
Ben Straub
b81aa2f1de Deploy GIT_CHECKOUT_OPTS_INIT 2012-11-30 13:12:14 -08:00
Ben Straub
df705148ec API updates for remote.h
Includes typedef for git_direction, and renames for
GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
2012-11-27 13:19:49 -08:00
Ben Straub
f45d51ff8e API updates for index.h 2012-11-27 13:18:28 -08:00
Russell Belfer
793c438559 Update diff callback param order
This makes the diff functions that take callbacks both take
the payload parameter after the callback function pointers and
pass the payload as the last argument to the callback function
instead of the first.  This should make them consistent with
other callbacks across the API.
2012-11-27 13:18:28 -08:00
Russell Belfer
e120123e36 API review / update for tree.h 2012-11-27 13:18:28 -08:00
Ben Straub
3f63cc9e6d Examples: fix clone api 2012-11-27 13:18:28 -08:00
Ben Straub
bac695b58c Examples: fix reference names 2012-11-27 13:18:28 -08:00
nulltoken
aa8a76eff9 tag: rename git_tag_type to git_tag_target_type 2012-11-17 05:41:20 -08:00
Russell Belfer
bbe6dbec81 Add explicit git_index ptr to diff and checkout
A number of diff APIs and the `git_checkout_index` API take a
`git_repository` object an operate on the index.  This updates
them to take a `git_index` pointer explicitly and only fall back
on the `git_repository` index if the index input is NULL.  This
makes it easier to operate on a temporary index.
2012-11-14 23:29:48 -08:00
Russell Belfer
0f3def715d 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.
2012-11-09 13:52:07 -08:00
Russell Belfer
b90500f03d Improve docs, examples, warnings
This improves docs in some of the public header files, cleans
up and improves some of the example code, and fixes a couple
of pedantic warnings in places.
2012-11-01 14:08:30 -07:00
Edward Thomson
f45ec1a076 index refactoring 2012-10-29 20:04:21 -05:00
Ben Straub
1e3b8ed5cf Remove 'bytes' param from git_remote_download 2012-10-24 14:07:07 -07:00
Ben Straub
9762ad993d Renaming: fix example 2012-10-24 13:43:23 -07:00
Ben Straub
7d222e1312 Network progress: rename things
git_indexer_stats and friends -> git_transfer_progress*

Also made git_transfer_progress members more sanely
named.
2012-10-24 13:29:14 -07:00
Ben Straub
2dae54a941 Improve clone sample's formatting 2012-10-19 20:24:15 -07:00
Ben Straub
9c05c17b7a Checkout progress now reports completed/total steps 2012-10-19 20:05:18 -07:00
Ben Straub
7bcd9e23e8 gitno_buffer: callback on each packet
The fetch code takes advantage of this to implement a
progress callback every 100kb of transfer.
2012-10-19 19:36:23 -07:00
Ben Straub
45b60d7b8d Correct progress reporting from checkout 2012-10-19 19:36:22 -07:00
Ben Straub
aa1e86741d Clone: in-line callbacks for progress
Also implemented in the git2 example.
2012-10-19 19:36:22 -07:00
Ben Straub
7635a1188a Fix example compilation 2012-10-19 19:36:22 -07:00
Ben Straub
2b7efe0340 Example: compile fixes (not yet working) 2012-10-19 19:36:22 -07:00
Ben Straub
d57c47dc07 Add accessor for git_remote's stats field
Also converted the network example to use it.
2012-10-19 19:34:15 -07:00
Carlos Martín Nieto
2af1c26641 examples: fix config getter param order 2012-09-30 11:02:53 +02:00
Carlos Martín Nieto
0a1db746fb examples: add progress output to fetch 2012-08-24 20:29:45 +02:00
Carlos Martín Nieto
bffa852f89 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.
2012-08-24 19:01:10 +02:00
Vicent Martí
f98c32f3fe Merge pull request #778 from ben/clone
Clone
2012-08-19 01:26:06 -07:00
Ben Straub
383fb799ee Rename example function to avoid name collision. 2012-07-31 08:51:38 -07:00