3
3
// to write native speed custom Git applications in any language which
4
4
// supports C bindings.
5
5
//
6
- // [This file][ex] is an example of using that API in a real, compilable C file.
7
- // Before published, this file is compiled and run to make sure it actually
8
- // runs. As the API is updated, this file will be updated to demonstrate the
9
- // new functionality. This project is [on GitHub][ex].
6
+ // This file is an example of using that API in a real, compilable C file.
7
+ // As the API is updated, this file will be updated to demonstrate the
8
+ // new functionality.
10
9
//
11
10
// If you're trying to write something in C using [libgit2][lg], you will also want
12
11
// to check out the generated [API documentation][ap] and the [Usage Guide][ug]. We've
17
16
// to work with Git at this level, check out [Chapter 9][pg] of the Pro Git book.
18
17
//
19
18
// [lg]: http://libgit2.github.com
20
- // [ap]: http://libgit2.github.com/libgit2/modules.html
19
+ // [ap]: http://libgit2.github.com/libgit2
21
20
// [ug]: http://libgit2.github.com/api.html
22
21
// [pg]: http://progit.org/book/ch9-0.html
23
- // [ex]: http://github.com/schacon/libgit2-examples
24
22
25
23
// ### Includes
26
24
@@ -38,7 +36,7 @@ int main (int argc, char** argv)
38
36
// There are also [methods][me] for specifying the index file and work tree locations, here
39
37
// we are assuming they are in the normal places.
40
38
//
41
- // [me]: http://libgit2.github.com/libgit2/group__git__repository.html
39
+ // [me]: http://libgit2.github.com/libgit2/#HEAD/group/repository
42
40
git_repository * repo ;
43
41
git_repository_open (& repo , "/opt/libgit2-test/.git" );
44
42
@@ -70,7 +68,7 @@ int main (int argc, char** argv)
70
68
// The object database is where the actual objects are stored in Git. For
71
69
// working with raw objects, we'll need to get this structure from the
72
70
// repository.
73
- // [odb]: http://libgit2.github.com/libgit2/group__git__odb.html
71
+ // [odb]: http://libgit2.github.com/libgit2/#HEAD/group/odb
74
72
git_odb * odb ;
75
73
odb = git_repository_database (repo );
76
74
@@ -130,7 +128,7 @@ int main (int argc, char** argv)
130
128
// #### Commit Parsing
131
129
// [Parsing commit objects][pco] is simple and gives you access to all the data in the commit
132
130
// - the // author (name, email, datetime), committer (same), tree, message, encoding and parent(s).
133
- // [pco]: http://libgit2.github.com/libgit2/group__git__commit.html
131
+ // [pco]: http://libgit2.github.com/libgit2/#HEAD/group/commit
134
132
135
133
printf ("\n*Commit Parsing*\n" );
136
134
@@ -178,7 +176,7 @@ int main (int argc, char** argv)
178
176
// libgit2 provides a couple of methods to create commit objects easily as well. There are four
179
177
// different create signatures, we'll just show one of them here. You can read about the other
180
178
// ones in the [commit API docs][cd].
181
- // [cd]: http://libgit2.github.com/libgit2/group__git__commit.html
179
+ // [cd]: http://libgit2.github.com/libgit2/#HEAD/group/commit
182
180
183
181
printf ("\n*Commit Writing*\n" );
184
182
git_oid tree_id , parent_id , commit_id ;
@@ -216,7 +214,7 @@ int main (int argc, char** argv)
216
214
// #### Tag Parsing
217
215
// You can parse and create tags with the [tag management API][tm], which functions very similarly
218
216
// to the commit lookup, parsing and creation methods, since the objects themselves are very similar.
219
- // [tm]: http://libgit2.github.com/libgit2/group__git__tag.html
217
+ // [tm]: http://libgit2.github.com/libgit2/#HEAD/group/tag
220
218
printf ("\n*Tag Parsing*\n" );
221
219
git_tag * tag ;
222
220
const char * tmessage , * tname ;
@@ -244,7 +242,7 @@ int main (int argc, char** argv)
244
242
// tree entry. This is not an actual object type in Git, but a useful structure for parsing and
245
243
// traversing tree entries.
246
244
//
247
- // [tp]: http://libgit2.github.com/libgit2/group__git__tree.html
245
+ // [tp]: http://libgit2.github.com/libgit2/#HEAD/group/tree
248
246
printf ("\n*Tree Parsing*\n" );
249
247
250
248
git_tree * tree ;
@@ -281,7 +279,7 @@ int main (int argc, char** argv)
281
279
// of the content. There is also a helper for reading a file from disk and writing it to the db and
282
280
// getting the oid back so you don't have to do all those steps yourself.
283
281
//
284
- // [ba]: http://libgit2.github.com/libgit2/group__git__blob.html
282
+ // [ba]: http://libgit2.github.com/libgit2/#HEAD/group/blob
285
283
286
284
printf ("\n*Blob Parsing*\n" );
287
285
git_blob * blob ;
@@ -304,7 +302,7 @@ int main (int argc, char** argv)
304
302
// were ancestors of (reachable from) a given starting point. This can allow you to create `git log`
305
303
// type functionality.
306
304
//
307
- // [rw]: http://libgit2.github.com/libgit2/group__git__revwalk.html
305
+ // [rw]: http://libgit2.github.com/libgit2/#HEAD/group/revwalk
308
306
309
307
printf ("\n*Revwalking*\n" );
310
308
git_revwalk * walk ;
@@ -348,7 +346,7 @@ int main (int argc, char** argv)
348
346
// The [index file API][gi] allows you to read, traverse, update and write the Git index file
349
347
// (sometimes thought of as the staging area).
350
348
//
351
- // [gi]: http://libgit2.github.com/libgit2/group__git__index.html
349
+ // [gi]: http://libgit2.github.com/libgit2/#HEAD/group/index
352
350
353
351
printf ("\n*Index Walking*\n" );
354
352
@@ -380,7 +378,7 @@ int main (int argc, char** argv)
380
378
// The [reference API][ref] allows you to list, resolve, create and update references such as
381
379
// branches, tags and remote references (everything in the .git/refs directory).
382
380
//
383
- // [ref]: http://libgit2.github.com/libgit2/refs_8h.html
381
+ // [ref]: http://libgit2.github.com/libgit2/#HEAD/group/reference
384
382
385
383
printf ("\n*Reference Listing*\n" );
386
384
0 commit comments