summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-221-66/+37
| | | | | | | | | | | | | | | | | | | | | This takes the `--stat` and related example options in the example diff.c program and converts them to use the `git_diff_get_stats` API which nicely formats stats for you. I went to add bar-graph scaling to the stats formatter and noticed that the `git_diff_stats` structure was holding on to all of the `git_patch` objects. Unfortunately, each of these objects keeps the full text of the diff in memory, so this is very expensive. I ended up modifying `git_diff_stats` to keep just the data that it needs to keep and allowed it to release the patches. Then, I added width scaling to the output on top of that. In making the diff example program match 'git diff' output, I ended up removing an newline from the sumamry output which I then had to compensate for in the email formatting to match the expectations. Lastly, I went through and refactored the tests to use a couple of helper functions and reduce the overall amount of code there.
* Some doc and examples/diff.c changesRussell Belfer2014-04-221-65/+86
| | | | | | | | | | | | | | I was playing with "git diff-index" and wanted to be able to emulate that behavior a little more closely with the diff example. Also, I wanted to play with running `git_diff_tree_to_workdir` directly even though core Git doesn't exactly have the equivalent, so I added a command line option for that and tweaked some other things in the example code. This changes a minor output thing in that the "raw" print helper function will no longer add ellipses (...) if the OID is not actually abbreviated.
* Add some funny options for debugging statusRussell Belfer2014-04-011-9/+50
| | | | | | | | This allows you to use a --repeat option to run status over and over and see how the output changes as you make local directory changes without reopening the git_repository object each time. Also, adds a flag to explicitly list the submodules before status.
* Merge pull request #2228 from mekishizufu/example_short_idVicent Marti2014-04-011-4/+6
|\ | | | | Use git_object_short_id in examples
| * examples: Use git_object_short_idJiri Pospisil2014-04-011-4/+6
| |
* | Merge pull request #2206 from libgit2/cmn/inmemory-swap-orderVicent Marti2014-04-012-2/+2
|\ \ | |/ |/| Rename in-memory remote to anonymous and swap url and fetch order
| * remote: rename inmemory to anonymous and swap url and fetch orderCarlos Martín Nieto2014-04-012-2/+2
| | | | | | | | | | | | | | | | | | | | The order in this function is the opposite to what create_with_fetchspec() has, so change this one, as url-then-refspec is what git does. As we need to break compilation and the swap doesn't do that, let's take this opportunity to rename in-memory remotes to anonymous as that's really what sets them apart.
* | Make submodules externally refcountedRussell Belfer2014-03-251-11/+14
|/ | | | | | | | `git_submodule` objects were already refcounted internally in case the submodule name was different from the path at which it was stored. This makes that refcounting externally used as well, so `git_submodule_lookup` and `git_submodule_add_setup` return an object that requires a `git_submodule_free` when done.
* Merge pull request #2028 from libgit2/options-namesVicent Marti2014-03-071-1/+1
|\ | | | | Rename options structures
| * git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-1/+1
| |
* | Merge pull request #2153 from mekishizufu/tag_exampleRussell Belfer2014-03-073-1/+319
|\ \ | |/ |/| Add a tag example
| * Move all variable declarations to the top of the blockJiri Pospisil2014-03-051-4/+7
| |
| * Add tag exampleJiri Pospisil2014-03-053-1/+316
| |
* | Merge completed: resolve the conflict with the upstreamSun He2014-03-061-0/+4
|\ \ | |/
| * examples/diff: Add minimal, patience diff options.Brian Gesiak2014-03-051-0/+4
| | | | | | | | | | | | | | - Add minimal, patience diff options to diff example. libgit2 `diff_xdiff.git_xdiff_init` already supports these flags, so no additional change is necessary. - Remove minimal and patience flag addition from project list.
* | fix the output format of diffSun He2014-03-051-2/+2
| |
* | Add the --shortstat flag to examples/diff.cSun He2014-03-051-1/+51
|/
* - examples CMakeLists.txt reverted to previous stateMiha Ravšelj2014-03-031-5/+1
|
* cmake examples change so that general.c is off by defaultMiha2014-03-031-1/+5
|
* - general.c reverted to original( before pr state )Miha2014-03-031-39/+43
|
* Merge remote-tracking branch 'remotes/upstream/development' into developmentMiha2014-03-032-7/+16
|\
| * Fix warnings and code style issuesRussell Belfer2014-02-271-7/+11
| |
| * Document enumerator and rewordingJuan Rubén2014-02-241-1/+1
| |
| * Add option to limit blame to first parentJuan Rubén2014-02-231-0/+5
| |
* | - BUGFIX #2133 (@fourplusone) in smart_protocol.cMiha2014-02-256-48/+45
|/ | | | | | - added MSVC cmake definitions to disable warnings - general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows - some MSVC reported warning fixes
* replace 'out' with 'patch',replace the literal tabs with '\t'.rocky-luo2014-02-091-6/+6
|
* add example for diff with --numstatrocky-luo2014-02-081-8/+38
|
* Fix a few references to changed function signaturesBen Straub2014-02-051-1/+1
|
* Merge pull request #2075 from libgit2/cmn/leftover-oidVicent Marti2014-01-271-1/+1
|\ | | | | Leftover OID -> ID changes
| * index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-251-1/+1
| | | | | | | | This was not converted when we converted the rest, so do it now.
* | Merge pull request #2078 from linquize/msvcVicent Marti2014-01-271-2/+1
|\ \ | | | | | | MSVC doesn't like modern code neither
| * | MSVC doesn't like modern code neitherLinquize2014-01-271-2/+1
| |/
* | Make blame example compile on MSVCLinquize2014-01-271-0/+5
|/
* Update files that reference tests-clarBen Straub2013-11-142-2/+2
|
* Fix warningsLinquize2013-11-121-1/+1
|
* Merge pull request #1956 from libgit2/cmn/fetch-default-headVicent Martí2013-11-111-12/+14
|\ | | | | Remote revamp (director's cut)
| * remote: make _ls return the list directlyCarlos Martín Nieto2013-11-111-12/+14
| | | | | | | | | | | | | | | | | | | | | | The callback-based method of listing remote references dates back to the beginning of the network code's lifetime, when we didn't know any better. We need to keep the list around for update_tips() after disconnect() so let's make use of this to simply give the user a pointer to the array so they can write straightforward code instead of having to go through a callback.
* | update example to new packfile creation signatureEdward Thomson2013-11-071-1/+1
| |
* | blame sample: usage commentBen Straub2013-11-041-0/+1
| |
* | Fix warningsBen Straub2013-11-041-2/+2
| |
* | Reorganize and doc-commentify blame sample.Ben Straub2013-11-041-69/+96
| |
* | Standardize layout of blame sampleBen Straub2013-11-041-36/+47
| |
* | Merge pull request #1317 from libgit2/blameRussell Belfer2013-11-043-1/+167
|\ \ | | | | | | Blame Canada
| * \ Merge remote-tracking branch 'libgit2/development' into blameBen Straub2013-10-285-52/+63
| |\ \
| * | | Fix post-line-range iterationBen Straub2013-10-101-1/+5
| | | |
| * | | Include signatures in blame hunksBen Straub2013-10-101-6/+4
| | | |
| * | | Only show lines that had blame run on themBen Straub2013-10-101-12/+14
| | | |
| * | | Be more flexible with argument order and formatBen Straub2013-10-101-8/+31
| | | |
| * | | Ignore more built examplesBen Straub2013-10-091-0/+5
| | | |
| * | | Simplify loading blobBen Straub2013-10-091-13/+11
| | | |