libgit2/include/git2
Russell Belfer 8d09efa24e Use git_diff_get_stats in example/diff + refactor
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.
2014-04-22 12:33:27 -07:00
..
sys Add public diff print helpers 2014-04-17 14:43:45 -07:00
attr.h Update docs for new callback return value behavior 2013-12-11 10:57:50 -08:00
blame.h Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
blob.h Const correctness! 2014-04-03 16:06:31 +02:00
branch.h Add GIT_BRANCH_ALL to git_branch_t enum 2014-04-16 18:51:16 +02:00
buffer.h Port tests from PR 1683 2013-09-17 09:31:45 -07:00
checkout.h git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
cherrypick.h Added cherry-pick support 2014-04-14 16:16:21 +02:00
clone.h git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
commit.h Add git_commit_amend API 2014-02-07 16:17:59 -08:00
common.h opts: bits are not bytes 2014-03-24 13:21:51 +01:00
config.h config: use git_buf for returning paths 2014-01-27 04:44:05 +01:00
cred_helpers.h fixing headers with bad values for objective-c 2013-09-09 13:53:22 -04:00
diff.h Use git_diff_get_stats in example/diff + refactor 2014-04-22 12:33:27 -07:00
errors.h Added cherry-pick support 2014-04-14 16:16:21 +02:00
filter.h Merge git_buf and git_buffer 2013-09-17 09:31:45 -07:00
graph.h Add git_graph_descendant_of. 2014-01-28 19:39:14 +01:00
ignore.h update copyrights 2013-01-08 17:31:27 -06:00
index.h Fix leak in git_index_conflict_cleanup 2014-04-17 14:43:46 -07:00
indexer.h Allow callers to set mode on packfile creation 2013-11-07 12:04:32 -05:00
inttypes.h Unify whitespaces to tabs 2013-05-15 20:26:55 +08:00
merge.h Const correctness! 2014-04-03 16:06:31 +02:00
message.h messsage: use git_buf in prettify() 2014-01-27 04:44:06 +01:00
net.h No bitfields in public headers b/c packing is compiler-specific 2013-02-07 12:47:29 -05:00
notes.h note: rename the id getter to git_note_id() 2014-01-24 11:18:51 +01:00
object.h Merge pull request #2153 from mekishizufu/tag_example 2014-03-07 09:13:43 -08:00
odb_backend.h Take umask into account in filebuf_commit 2013-11-04 22:32:50 -05:00
odb.h Add exists_prefix to ODB backend and ODB API 2014-03-04 15:34:23 -08:00
oid.h Make git_oid_equal a non-inline API 2014-02-20 11:00:31 -08:00
pack.h In-memory packing backend 2014-03-26 18:17:08 +01:00
patch.h Fix const-correctness of git_patch_get_delta, git_patch_num_hunks, git_patch_num_lines_in_hunk 2014-04-11 21:55:36 +02:00
pathspec.h Rename diff objects and split patch.h 2013-10-11 14:51:54 -07:00
push.h Const correctness! 2014-04-03 16:06:31 +02:00
refdb.h Move git_reference__alloc to include/git2/sys 2013-04-21 12:52:17 -07:00
reflog.h reflog: remove git_reflog_append_to() 2013-11-23 14:55:02 +01:00
refs.h Const correctness! 2014-04-03 16:06:31 +02:00
refspec.h refspec: move to git_buf for outputting strings 2014-01-27 04:44:06 +01:00
remote.h transports: allow the creds callback to say it doesn't exist 2014-04-22 14:34:26 +02:00
repository.h Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
reset.h Add reflog parameters to git_reset 2014-02-03 15:05:55 -08:00
revert.h Update git_merge_tree_opts to git_merge_options 2014-03-20 09:25:08 -07:00
revparse.h Some documentation improvements 2013-08-28 09:31:32 -07:00
revwalk.h Correcting format of comments in header file 2014-03-24 11:20:51 -07:00
signature.h Align git_signature_dup. 2014-01-14 21:33:35 +01:00
stash.h Update docs for new callback return value behavior 2013-12-11 10:57:50 -08:00
status.h Added function-based initializers for every options struct. 2014-03-05 21:49:23 -05:00
stdint.h msvc: Properly handle inttypes.h/stdint.h 2011-10-05 16:21:16 -04:00
strarray.h Unify whitespaces to tabs 2013-05-15 20:26:55 +08:00
submodule.h Fix segfault if gitmodules is invalid 2014-03-26 14:38:26 -07:00
tag.h tag: Introduce git_tag_annotation_create() 2013-05-21 19:32:59 +02:00
threads.h update copyrights 2013-01-08 17:31:27 -06:00
trace.h Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
transport.h Replace void * with proper callback types 2014-04-18 17:58:25 +02:00
tree.h tree: remove legacy 'oid' naming 2014-01-25 08:15:44 +01:00
types.h Add GIT_BRANCH_ALL to git_branch_t enum 2014-04-16 18:51:16 +02:00
version.h libgit2 0.20.0 "anmeldung" 2013-11-20 12:53:33 +01:00