summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: add remote example.Patrick Steinhardt2015-03-193-1/+279
|
* Merge pull request #2808 from libgit2/cmn/repo-identEdward Thomson2015-03-031-1/+1
|\ | | | | Remove the signature from ref-modifying functions
| * Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #2885 from JIghtuse/masterCarlos Martín Nieto2015-03-031-6/+24
|\ \ | |/ |/| describe example: function to add commits to opts
| * describe example: function to add commits to optsBoris Egorov2015-02-061-6/+24
| | | | | | | | | | | | | | Add safe function to (a,rea)llocate memory which terminate example on memory allocation failure. Move code to allocate commits to its own function.
* | example: drop `SAFE_CREATE` from clone exampleEdward Thomson2015-02-271-1/+1
|/
* for-each-ref example: init/shutdown libgit2 in mainBoris Egorov2015-02-051-0/+3
| | | | | | | 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.
* describe example: fix memory allocation sizeBoris Egorov2015-01-251-2/+4
| | | | | | | We need to allocate memory for sizeof(char *) * ncommits, not just for ncommits. Issue detected by GCC's AddressSanitizer.
* clone example: don't divide by zeroEdward Thomson2015-01-101-3/+9
| | | | | Local transports don't have data about the size, avoid dividing by zero in the callback.
* Spelling fixesWill Stamper2014-12-041-2/+2
|
* blame: Do not assume blob contents are NULL-terminatedVicent Marti2014-11-211-6/+8
|
* Rename git_threads_ to git_libgit2_Carlos Martín Nieto2014-11-0814-25/+29
| | | | | | 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.
* remote: rename _load() to _lookup()cmn/remote-lookupCarlos Martín Nieto2014-11-082-2/+2
| | | | This brings it in line with the rest of the lookup functions.
* describe: add exampleLinquize2014-10-123-0/+198
|
* remote: allow overriding the refspecs for download and fetchCarlos Martín Nieto2014-09-301-1/+1
| | | | | | | 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.
* Merge pull request #2567 from cirosantilli/factor-41Vicent Marti2014-09-173-6/+6
|\ | | | | Factor 40 and 41 constants from source.
| * Factor 40 and 41 constants from source.Ciro Santilli2014-09-163-6/+6
| |
* | Fix typoLinquize2014-09-161-1/+1
|/
* Fix warningLinquize2014-09-011-1/+1
|
* examples/log.c: invert filtering impl and conditionalEoin Coffey2014-05-281-14/+14
|
* Add support for --grepEoin Coffey2014-05-231-1/+23
|
* Add --committer option, and break out helper functionEoin Coffey2014-05-231-7/+21
|
* Add support for --author flag in example log implementationEoin Coffey2014-05-221-1/+10
|
* Include windows.h on win32 for SleepEdward Thomson2014-05-211-2/+3
|
* examples: add a basic for-each-ref examplepeff/iconvJeff King2014-05-083-0/+48
| | | | | | | | | | | | | This is quite close to running "git for-each-ref" except: 1. It does not take any formatting or selection options at all. 2. The output is not sorted. I wrote it to look at debugging some issues with ref iteration, but there's no reason it can't live on as an example command.
* Make examples/status.c compile on WindowsLinquize2014-05-011-0/+4
|
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-251-1/+1
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
| |
* | 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
| |