summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Fix comment and copyright in exampleRussell Belfer2013-06-201-6/+11
|
* Add example implementation of long format statusRussell Belfer2013-06-201-2/+145
|
* Add status flags to force output sort orderRussell Belfer2013-06-201-1/+2
| | | | | | | | | | | | | | | | Files in status will, be default, be sorted according to the case insensitivity of the filesystem that we're running on. However, in some cases, this is not desirable. Even on case insensitive file systems, 'git status' at the command line will generally use a case sensitive sort (like 'ls'). Some GUIs prefer to display a list of file case insensitively even on case-sensitive platforms. This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the default sort order of the status output and give the user control. This includes tests for exercising these new options and makes the examples/status.c program emulate core Git and always use a case sensitive sort.
* Initial implementation of status exampleRussell Belfer2013-06-202-1/+295
|
* Extend diff exampleRussell Belfer2013-05-171-6/+44
| | | | | Add --raw output format and (some) options to invoke rename/copy detection on the diff.
* Make examples/diff.c compile vs threadsafe libraryRussell Belfer2013-05-161-2/+8
|
* Add cat-file example and increase const use in APIRussell Belfer2013-05-162-1/+230
| | | | | | | | | | | | | | | | This adds an example implementation that emulates git cat-file. It is a convenient and relatively simple example of getting data out of a repository. Implementing this also revealed that there are a number of APIs that are still not using const pointers to objects that really ought to be. The main cause of this is that `git_vector_bsearch` may need to call `git_vector_sort` before doing the search, so a const pointer to the vector is not allowed. However, for tree objects, with a little care, we can ensure that the vector of tree entries is always sorted and allow lookups to take a const pointer. Also, the missing const in commit objects just looks like an oversight.
* Fix trailing whitespacesnulltoken2013-05-151-1/+0
|
* refs: remove the OID/SYMBOLIC filteringCarlos Martín Nieto2013-05-111-1/+1
| | | | | | | | | Nobody should ever be using anything other than ALL at this level, so remove the option altogether. As part of this, git_reference_foreach_glob is now implemented in the frontend using an iterator. Backends will later regain the ability of doing the glob filtering in the backend.
* examples: init the threading systemCarlos Martín Nieto2013-04-231-0/+2
|
* Fix examplesvmg/unified-revisionVicent Marti2013-04-161-9/+11
|
* Merge remote-tracking branch 'ben/unified-revparse' into developmentVicent Marti2013-04-153-14/+16
|\
| * Clean up minor detailsBen Straub2013-04-151-1/+1
| |
| * Clean up example code.Ben Straub2013-04-151-3/+3
| |
| * Change git_revparse to output git_object pointersBen Straub2013-04-152-10/+12
| | | | | | | | This will probably prevent many lookup/free operations in calling code.
| * Add rev-list example to makefilesBen Straub2013-04-091-1/+1
| |
| * Deprecate git_revparse_single and _rangelikeBen Straub2013-04-092-16/+16
| |
* | examples: Don't print weird charactersVicent Marti2013-04-101-2/+1
| |
* | Fix clang warnings and improve checksRussell Belfer2013-04-093-8/+17
|/
* Merge remote-tracking branch 'gnprice/revwalk' into developmentVicent Marti2013-04-073-0/+212
|\
| * examples: a test, for rev-listGreg Price2013-04-061-0/+95
| | | | | | | | | | | | | | | | | | | | | | This test file could probably be improved by a framework like the one in git.git:t/, or by using a language like Python instead of shell. The other examples would benefit from tests too. Probably best to settle on a framework to write them in, then add more tests. Signed-off-by: Greg Price <price@mit.edu>
| * examples: rev-listGreg Price2013-04-062-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This demonstrates parts of the interface for specifying revisions that Git users are familiar with from 'git rev-list', 'git log', and other Git commands. A similar query interface is used in out-of-core command-line programs that browse a Git repo (like 'tig'), and may be useful for an 'advanced search' interface in GUI or web applications. In this version, we parse all the query modifiers we can support with the existing logic in revwalk: basic include/exclude commits, and the ordering flags. More logic will be required to support '--grep', '--author', the pickaxe '-S', etc. Signed-off-by: Greg Price <price@mit.edu>
* | General example: run against testrepo.gitBen Straub2013-04-041-9/+13
| | | | | | | | Fixes #1455
* | Fix link issue in network exampleslionel vitte2013-03-201-2/+3
|/
* Simplify diff example using revparseRussell Belfer2013-03-021-20/+1
| | | | | | When the examples/diff.c was written, there was not yet a revparse API. Now we can use it to make command line parsing way better with less code. Yay!
* Give props to Martin PoolMartin Woodward2013-02-261-1/+4
| | | | | | 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.
* Add rudimentary error checks and reformat commentsRussell Belfer2013-02-151-146/+207
| | | | | | | | | There were a number of functions assigning their return value to `error` without much explanation. I added in some rudimentary error checking to help flesh out the example. Also, I reformatted all of the comments down to 80 cols (and in some cases, slightly updated the wording).
* Merge pull request #1316 from ben/clone-cancelRussell Belfer2013-02-121-1/+2
|\ | | | | Allow network operations to cancel
| * Allow progress callback to cancel fetchBen Straub2013-02-051-1/+2
| | | | | | | | | | This works by having the indexer watch the return code of the callback, so will only take effect on object boundaries.
* | removed other references to api.htmlCarlos Scheidegger2013-02-061-2/+1
|/
* Add user-from-url param to auth callbackBen Straub2013-01-311-0/+1
|
* update examples to work on windowsEdward Thomson2013-01-233-8/+31
|
* Don't clear the opt instance in the diff example.Sebastian Bauer2013-01-231-2/+0
| | | | | The version field is overwritten otherwise. The opt instance is already initialized properly.
* Don't call pthread_exit() in the callback.Sebastian Bauer2013-01-101-1/+1
| | | | | | | | 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.
* Merge pull request #1152 from ben/clone-api-structificationVicent Martí2013-01-023-21/+22
|\ | | | | Segregate in-memory and persisted remotes
| * Include checkout options inlineBen Straub2013-01-021-1/+1
| |
| * Move `url` to last place in parameter listBen Straub2013-01-022-2/+2
| |
| * Fix warnings in exampleBen Straub2012-12-271-3/+15
| |
| * Fix examplesBen Straub2012-12-212-2/+2
| |
| * Rename remote creation APIsBen Straub2012-12-202-2/+2
| | | | | | | | git_remote_add -> git_remote_create git_remote_new -> git_remote_create_inmemory
| * Fix clone sampleBen Straub2012-12-191-17/+6
| |
* | Update showindex exampleRussell Belfer2012-12-281-11/+23
|/ | | | | | | | 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.
* Fix diff constructor name order confusionRussell Belfer2012-12-172-8/+8
| | | | | | | | | | | | 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
* Make building samples more friendlyBen Straub2012-12-162-0/+6
|
* Move non-options back out of options structBen Straub2012-12-141-6/+5
|
* Deploy git_clone_options to network sampleBen Straub2012-12-141-5/+10
|
* Enable authenticated clones in network sampleBen Straub2012-12-131-1/+17
|
* Stop premature remote freeing when cloningBen Straub2012-12-131-0/+1
|
* Fix network exampleBen Straub2012-12-131-2/+11
|
* Deploy GIT_REMOTE_CALLBACKS_INITBen Straub2012-11-301-2/+1
|