summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge pull request #1934 from libgit2/relicense-examplesVicent Martí2013-11-0414-34/+250
|\ \ \ \ \ \ | | | | | | | | | | | | | | Relicense examples under CC0
| * | | | | | Replace copyright topmatter in example filesBen Straub2013-11-0212-33/+125
| | | | | | |
| * | | | | | Relicense examples under CC0Ben Straub2013-11-012-1/+125
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #1929 from libgit2/rb/misc-diff-fixesVicent Martí2013-11-041-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix some observed problems with incorrect diffs
| * | | | | | Make diff and status perform soft index reloadRussell Belfer2013-11-011-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
* | | | | | examples: doc updateCarlos Martín Nieto2013-11-031-16/+42
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the explanation to reflect our use of git_status_list_new() and make the breaks in rocco more meaningful. Clarify why GIT_STATUS_CURRENT and index_to_workdir don't always imply each other. Fixes #1740.
* | | | | Merge pull request #1916 from libgit2/simplify-examplesVicent Martí2013-11-0116-950/+1255
|\ \ \ \ \ | | | | | | | | | | | | Fix examples to make the important stuff more obvious
| * | | | | Fix typosBen Straub2013-11-012-3/+3
| | | | | |
| * | | | | A few formatting changes for roccoCarlos Martín Nieto2013-11-014-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not too happy about manually inserting < and > but those get output as html tags otherwise.
| * | | | | Update examples/README.mdRussell Belfer2013-10-311-6/+14
| | | | | |
| * | | | | Format comments for use with doccoBen Straub2013-10-315-72/+86
| | | | | |
| * | | | | Clean up showindex sampleBen Straub2013-10-301-23/+15
| | | | | |
| * | | | | Reorganize rev-parse exampleBen Straub2013-10-301-53/+56
| | | | | |
| * | | | | rev-list.c example: use common utils, reorganizeBen Straub2013-10-301-34/+28
| | | | | |
| * | | | | cat-file.c example: deploy helpers, reorgBen Straub2013-10-301-76/+78
| | | | | |
| * | | | | add.c: proper frontmatterBen Straub2013-10-301-3/+8
| | | | | |
| * | | | | init.c example: deploy more helpersBen Straub2013-10-301-7/+4
| | | | | |
| * | | | | add.c example: deploy helpers, reorgBen Straub2013-10-301-57/+61
| | | | | |
| * | | | | init example: deploy helpers, reorgBen Straub2013-10-301-127/+122
| | | | | |
| * | | | | Extract common example helpers and reorg examplesRussell Belfer2013-10-297-540/+808
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reorganizes a few of the examples so that the main function comes first with the argument parsing extracted into a helper that can come at the end of the file (so the example focuses more on the use of libgit2 instead of command line support). This also creates a shared examples/common.[ch] so that useful helper funcs can be shared across examples instead of repeated.
* | | | | Merge pull request #1918 from libgit2/cmn/indexer-namingVicent Martí2013-11-011-6/+6
|\ \ \ \ \ | | | | | | | | | | | | indexer: remove the stream infix
| * | | | | indexer: remove the stream infixCarlos Martín Nieto2013-10-301-6/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Use gmtime() instead of gmtime_t()Linquize2013-10-311-3/+3
|/ / / / | | | | | | | | | | | | The latter is not available on Windows
* | | | Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí2013-10-283-4/+20
|\ \ \ \ | | | | | | | | | | Add support for thin packs
| * | | | indexer: include the delta statsCarlos Martín Nieto2013-10-232-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | examples: show used local objects in fetchCarlos Martín Nieto2013-10-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Show how many local objects were used to fix the thin pack in our fetch example.
| * | | | indexer: fix thin packsCarlos Martín Nieto2013-10-041-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | 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.
* | | | Create git_diff_line and extend git_diff_hunkRussell Belfer2013-10-212-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having functions with so very many parameters to pass hunk and line data, this takes the existing git_diff_hunk struct and extends it with more hunk data, plus adds a git_diff_line. Those structs are used to pass back hunk and line data instead of the old APIs that took tons of parameters. Some work that was previously only being done for git_diff_patch creation (scanning the diff content for exact line counts) is now done for all callbacks, but the performance difference should not be noticable.
* | | | Diff API cleanupRussell Belfer2013-10-152-22/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lays groundwork for separating formatting options from diff creation options. This groups the formatting flags separately from the diff list creation flags and reorders the options. This also tweaks some APIs to further separate code that uses patches from code that just looks at git_diffs.
* | | | Rename diff objects and split patch.hRussell Belfer2013-10-112-10/+10
| |_|/ |/| | | | | | | | | | | | | | This makes no functional change to diff but renames a couple of the objects and splits the new git_patch (formerly git_diff_patch) into a new header file.
* | | clone: put the callbacks struct directly in the clone optionsCarlos Martín Nieto2013-10-021-5/+3
| | | | | | | | | | | | There's no need for this to be a pointer to somewhere else.
* | | remote: move the credentials callback to the structCarlos Martín Nieto2013-10-023-3/+5
| | | | | | | | | | | | | | | 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.
* | | remote: put the _download() callback with the othersCarlos Martín Nieto2013-10-022-3/+5
|/ / | | | | | | | | | | 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.
* | Some tests with ident and crlf filtersRussell Belfer2013-09-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the filter order to match core Git, too. This test demonstrates an interesting behavior of core Git (which is totally reasonable and which libgit2 matches, although mostly by coincidence). If you use the ident filter and commit a file with a garbage ident in it, like '$Id: this is just garbage$' and then immediately do a 'git checkout-index' with the new file, Git will not consider the file out of date and will not overwrite the file with an updated $Id$. Libgit2 has the same behavior. If you remove the file and then do a checkout-index, it will be replaced with a filtered version that has injected the OID correctly.
* | No such thing as an orphan branchCarlos Martín Nieto2013-09-171-1/+1
|/ | | | | | | | | | | Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
* Make work if built with threading enabledRussell Belfer2013-09-091-0/+4
|
* Only use callbacks when -n or -v in add example.Krzysztof Adamski2013-09-091-4/+4
|
* Move statement after declarations in add example.Krzysztof Adamski2013-09-091-2/+1
|
* Remove unnececery arguments priting in add example.Krzysztof Adamski2013-09-091-3/+0
|
* Better usage info in add example.Krzysztof Adamski2013-09-091-7/+20
|
* Add -u option to add example.Krzysztof Adamski2013-09-091-2/+11
|
* Supported options information in add example.Krzysztof Adamski2013-09-091-1/+1
|
* Adding add example.Krzysztof Adamski2013-09-091-0/+121
|
* Split examples CMakeLists.txtRussell Belfer2013-09-031-0/+14
| | | | | Also, this converts the examples/CMakeLists.txt from explicitly listing to just globbing for all the individual C files.
* Adding credentials callback to ls-remote and fetch too.Krzysztof Adamski2013-09-016-33/+45
|
* Removing unneeded code duplication in ls-remote.cKrzysztof Adamski2013-09-011-33/+7
|
* Improve isolation of new test from user environsRussell Belfer2013-08-161-0/+28
|
* Add example like "git init"Russell Belfer2013-08-162-1/+218
|
* Fix -n bug; default to all ancestorsBrendan Macmillan2013-07-271-3/+4
|
* Add a bunch more features to log exampleRussell Belfer2013-07-101-14/+112
|