Commit Graph

305 Commits

Author SHA1 Message Date
Patrick Steinhardt
c313e3d986 examples: general: extract function demonstrating OID parsing 2016-10-10 09:04:42 +02:00
Patrick Steinhardt
29d9afc0fb examples: general: extract function demonstrating ODB 2016-10-10 09:04:42 +02:00
Patrick Steinhardt
b009adad35 examples: general: extract function demonstrating commit writing 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
15960454c5 examples: general: extract functions demonstrating object parsing 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
8b93ccdf08 examples: general: extract function demonstrating revwalking 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
c079e3c847 examples: general: extract function demonstrating index walking 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
f9a7973dd9 examples: general: extract function demonstrating reference listings 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
986913f45b examples: general: extract function demonstrating config files 2016-10-10 09:04:41 +02:00
Patrick Steinhardt
176d58bad4 examples: general: use tabs instead of spaces 2016-10-10 09:04:41 +02:00
Carlos Martín Nieto
07bd3e57d9 proxy: ask the user for credentials if necessary 2016-04-19 13:54:19 +02:00
Patrick McKenna
698e0c2777 Update link to Pro Git's Git internals chapter. 2016-03-07 16:34:30 -08:00
Eun
8b8f1f9188 fix return 2015-10-07 14:01:05 +02:00
Matt Burke
5d7cd57f99 Update another call to git_remote_connect 2015-09-08 14:15:29 -04:00
Carlos Martín Nieto
97c0a85fc6 Merge pull request #3306 from libgit2/cmn/fetch-ex-fetch
examples: modernise the fetch example
2015-07-13 11:23:07 +02:00
Matthew Plough
768f8be31c 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.
2015-07-12 19:55:19 +02:00
Carlos Martín Nieto
6c7e86e158 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.
2015-07-12 19:41:01 +02:00
Edward Thomson
d202bb7d3b examples: clean up some warnings 2015-06-29 21:48:35 +00:00
Carlos Martín Nieto
c2418f4613 Rename FALLBACK to UNSPECIFIED
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
2015-06-25 12:48:44 +02:00
Carlos Martín Nieto
7d6dacdc17 examples: adjust to submodule status API change 2015-06-22 17:02:55 +02:00
Ariel O. Barria
9334c86f49 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
2015-06-03 14:54:35 -05:00
Carlos Martín Nieto
ae5b93629c 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.
2015-05-28 15:32:20 +02:00
Carlos Martín Nieto
cf66c4748c 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.
2015-05-13 15:52:12 +02:00
Carlos Martín Nieto
3fec548a98 examples: adjust to the new remote API 2015-05-13 09:46:36 +02:00
Tomas Paladin Volf
785990bead
Restructured to be nicer example
Code restructured to better represent best practice when
using libgit2.
2015-05-02 12:16:22 +02:00
Tomas Paladin Volf
9bff15f4a4 Added call to git_libgit2_shutdown()
Added forgotten call to git_libgit2_shutdown() to the /examples/network/git2.c.
2015-04-30 15:10:28 +02:00
Patrick Steinhardt
c843736d63 describe example: enable building by default. 2015-04-07 14:55:05 +02:00
Patrick Steinhardt
0a2f99fd13 examples: add remote example. 2015-03-19 08:45:34 +01:00
Edward Thomson
72ca65d538 Merge pull request #2808 from libgit2/cmn/repo-ident
Remove the signature from ref-modifying functions
2015-03-03 10:07:36 -05:00
Carlos Martín Nieto
659cf2029f 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.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
fe477951be Merge pull request #2885 from JIghtuse/master
describe example: function to add commits to opts
2015-03-03 14:35:10 +01:00
Edward Thomson
14fec0aea3 example: drop SAFE_CREATE from clone example 2015-02-27 13:50:40 -05:00
Boris Egorov
23d1dbe919 describe example: function to add commits to opts
Add safe function to (a,rea)llocate memory which terminate example on
memory allocation failure.

Move code to allocate commits to its own function.
2015-02-06 12:16:40 +06:00
Boris Egorov
2107dac346 for-each-ref example: init/shutdown libgit2 in main
I don't get how it was working without git_libgit2_init() call. I run it
and libgit2 throws assertion somewhere in its internals. Now it works.

Updated commit with shutdown at the end.
2015-02-05 10:51:22 +06:00
Boris Egorov
36e13399c0 describe example: fix memory allocation size
We need to allocate memory for sizeof(char *) * ncommits, not just for
ncommits.

Issue detected by GCC's AddressSanitizer.
2015-01-25 22:34:46 +06:00
Edward Thomson
9af3c4169c clone example: don't divide by zero
Local transports don't have data about the size, avoid dividing by
zero in the callback.
2015-01-10 18:24:27 +00:00
Will Stamper
b874629b2d Spelling fixes 2014-12-04 21:06:59 -06:00
Vicent Marti
2e1e0f108f blame: Do not assume blob contents are NULL-terminated 2014-11-21 17:24:55 +01:00
Carlos Martín Nieto
799e22ea0c 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.
2014-11-08 23:46:39 +01:00
Carlos Martín Nieto
209425ce26 remote: rename _load() to _lookup()
This brings it in line with the rest of the lookup functions.
2014-11-08 13:28:27 +01:00
Linquize
d6bbcefce3 describe: add example 2014-10-12 19:25:20 +08:00
Carlos Martín Nieto
3f89420523 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.
2014-09-30 15:42:32 +02:00
Vicent Marti
14556cbff7 Merge pull request #2567 from cirosantilli/factor-41
Factor 40 and 41 constants from source.
2014-09-17 17:13:25 +02:00
Ciro Santilli
3b2cb2c91e Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
Linquize
2c22193ba0 Fix typo 2014-09-16 08:56:33 +08:00
Linquize
bd465f9c22 Fix warning 2014-09-01 23:36:12 +08:00
Eoin Coffey
33bf1b1ab0 examples/log.c: invert filtering impl and conditional 2014-05-28 09:40:08 -06:00
Eoin Coffey
26cce32133 Add support for --grep 2014-05-23 12:59:19 -06:00
Eoin Coffey
161e6dc1ca Add --committer option, and break out helper function 2014-05-23 12:27:16 -06:00
Eoin Coffey
97fc71ab3b Add support for --author flag in example log implementation 2014-05-22 17:22:45 -06:00
Edward Thomson
ead9c591ef Include windows.h on win32 for Sleep 2014-05-21 17:25:00 -07:00