- 22 Apr, 2014 2 commits
-
-
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.
Russell Belfer committed -
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.
Russell Belfer committed
-
- 05 Mar, 2014 3 commits
-
-
Sun He committed
-
Sun He committed
-
- 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.
Brian Gesiak committed
-
- 27 Feb, 2014 1 commit
-
-
Russell Belfer committed
-
- 09 Feb, 2014 1 commit
-
-
rocky-luo committed
-
- 08 Feb, 2014 1 commit
-
-
rocky-luo committed
-
- 02 Nov, 2013 1 commit
-
-
Ben Straub committed
-
- 01 Nov, 2013 1 commit
-
-
I'm not too happy about manually inserting < and > but those get output as html tags otherwise.
Carlos Martín Nieto committed
-
- 31 Oct, 2013 1 commit
-
-
Ben Straub committed
-
- 30 Oct, 2013 1 commit
-
-
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.
Russell Belfer committed
-
- 21 Oct, 2013 1 commit
-
-
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.
Russell Belfer committed
-
- 15 Oct, 2013 1 commit
-
-
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.
Russell Belfer committed
-
- 11 Oct, 2013 1 commit
-
-
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.
Russell Belfer committed
-
- 18 May, 2013 1 commit
-
-
Add --raw output format and (some) options to invoke rename/copy detection on the diff.
Russell Belfer committed
-
- 16 May, 2013 1 commit
-
-
Russell Belfer committed
-
- 15 Apr, 2013 2 commits
-
-
Ben Straub committed
-
This will probably prevent many lookup/free operations in calling code.
Ben Straub committed
-
- 09 Apr, 2013 1 commit
-
-
Ben Straub committed
-
- 02 Mar, 2013 1 commit
-
-
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!
Russell Belfer committed
-
- 23 Jan, 2013 1 commit
-
-
The version field is overwritten otherwise. The opt instance is already initialized properly.
Sebastian Bauer committed
-
- 17 Dec, 2012 1 commit
-
-
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
Russell Belfer committed
-
- 30 Nov, 2012 1 commit
-
-
Ben Straub committed
-
- 27 Nov, 2012 2 commits
-
-
This makes the diff functions that take callbacks both take the payload parameter after the callback function pointers and pass the payload as the last argument to the callback function instead of the first. This should make them consistent with other callbacks across the API.
Russell Belfer committed -
Ben Straub committed
-
- 15 Nov, 2012 1 commit
-
-
A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
Russell Belfer committed
-
- 01 Nov, 2012 1 commit
-
-
This improves docs in some of the public header files, cleans up and improves some of the example code, and fixes a couple of pedantic warnings in places.
Russell Belfer committed
-
- 08 Jun, 2012 1 commit
-
-
There are three actual changes in this commit: 1. When the trailing newline of a file is removed in a diff, the change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed to the callback. Previously, the `ADD_EOFNL` constant was given which was just an error in my understanding of when the various circumstances arose. `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and should never be generated. A new newline is simply an `ADD`. 2. Rewrote the `diff_delta__merge_like_cgit` function that contains the core logic of the `git_diff_merge` implementation. The new version doesn't actually have significantly different behavior, but the logic should be much more obvious, I think. 3. Fixed a bug in `git_diff_merge` where it freed a string pool while some of the string data was still in use. This led to `git_diff_print_patch` accessing memory that had been freed. The rest of this commit contains improved documentation in `diff.h` to make the behavior and the equivalencies with core git clearer, and a bunch of new tests to cover the various cases, oh and a minor simplification of `examples/diff.c`.
Russell Belfer committed
-
- 17 May, 2012 3 commits
-
-
Vicent Martí committed
-
Vicent Martí committed
-
This fixes the examples so they will build and adds a PROFILE option to the CMakeFile that enabled gprof info on non-Windows
Russell Belfer committed
-
- 13 Mar, 2012 1 commit
-
-
Signed-off-by: schu <schu-github@schulog.org>
schu committed
-
- 02 Mar, 2012 3 commits
-
-
This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
Russell Belfer committed -
* Implemented git_diff_index_to_tree * Reworked git_diff_options structure to handle more options * Made most of the options in git_diff_options actually work * Reorganized code a bit to remove some redundancy * Added option parsing to examples/diff.c to test most options
Russell Belfer committed -
This fixes several bugs, updates tests and docs, eliminates the FILE* assumption in favor of printing callbacks for the diff patch formatter helpers, and adds a "diff" example function that can perform a diff from the command line.
Russell Belfer committed
-