summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-02 15:59:02 -0700
committerVicent Martí <tanoku@gmail.com>2012-05-02 15:59:02 -0700
commit40879facad0337d954d4904e212af3b36cdb9465 (patch)
treeaea730551948c67bb1fb88098cf8a67d3ed3211d /include/git2/diff.h
parent2218fd57a50ceb851cb131939bf0747e072e40f6 (diff)
parent3fd99be98a91416dae77d65fe593965a0723fa8c (diff)
downloadlibgit2-40879facad0337d954d4904e212af3b36cdb9465.tar.gz
Merge branch 'new-error-handling' into development
Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r--include/git2/diff.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 0176d1c2f..6afa608bb 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -39,7 +39,9 @@ enum {
GIT_DIFF_IGNORE_SUBMODULES = (1 << 5),
GIT_DIFF_PATIENCE = (1 << 6),
GIT_DIFF_INCLUDE_IGNORED = (1 << 7),
- GIT_DIFF_INCLUDE_UNTRACKED = (1 << 8)
+ GIT_DIFF_INCLUDE_UNTRACKED = (1 << 8),
+ GIT_DIFF_INCLUDE_UNMODIFIED = (1 << 9),
+ GIT_DIFF_RECURSE_UNTRACKED_DIRS = (1 << 10),
};
/**
@@ -152,19 +154,22 @@ typedef int (*git_diff_hunk_fn)(
* Line origin constants.
*
* These values describe where a line came from and will be passed to
- * the git_diff_line_fn when iterating over a diff. There are some
+ * the git_diff_data_fn when iterating over a diff. There are some
* special origin contants at the end that are used for the text
* output callbacks to demarcate lines that are actually part of
* the file or hunk headers.
*/
enum {
- /* these values will be sent to `git_diff_line_fn` along with the line */
+ /* these values will be sent to `git_diff_data_fn` along with the line */
GIT_DIFF_LINE_CONTEXT = ' ',
GIT_DIFF_LINE_ADDITION = '+',
GIT_DIFF_LINE_DELETION = '-',
GIT_DIFF_LINE_ADD_EOFNL = '\n', /**< LF was added at end of file */
GIT_DIFF_LINE_DEL_EOFNL = '\0', /**< LF was removed at end of file */
- /* these values will only be sent to a `git_diff_output_fn` */
+ /* these values will only be sent to a `git_diff_data_fn` when the content
+ * of a diff is being formatted (eg. through git_diff_print_patch() or
+ * git_diff_print_compact(), for instance).
+ */
GIT_DIFF_LINE_FILE_HDR = 'F',
GIT_DIFF_LINE_HUNK_HDR = 'H',
GIT_DIFF_LINE_BINARY = 'B'
@@ -172,25 +177,19 @@ enum {
/**
* When iterating over a diff, callback that will be made per text diff
- * line.
- */
-typedef int (*git_diff_line_fn)(
- void *cb_data,
- git_diff_delta *delta,
- char line_origin, /**< GIT_DIFF_LINE_... value from above */
- const char *content,
- size_t content_len);
-
-/**
+ * line. In this context, the provided range will be NULL.
+ *
* When printing a diff, callback that will be made to output each line
* of text. This uses some extra GIT_DIFF_LINE_... constants for output
* of lines of file and hunk headers.
*/
-typedef int (*git_diff_output_fn)(
+typedef int (*git_diff_data_fn)(
void *cb_data,
+ git_diff_delta *delta,
+ git_diff_range *range,
char line_origin, /**< GIT_DIFF_LINE_... value from above */
- const char *formatted_output);
-
+ const char *content,
+ size_t content_len);
/** @name Diff List Generator Functions
*
@@ -309,7 +308,7 @@ GIT_EXTERN(int) git_diff_foreach(
void *cb_data,
git_diff_file_fn file_cb,
git_diff_hunk_fn hunk_cb,
- git_diff_line_fn line_cb);
+ git_diff_data_fn line_cb);
/**
* Iterate over a diff generating text output like "git diff --name-status".
@@ -317,7 +316,7 @@ GIT_EXTERN(int) git_diff_foreach(
GIT_EXTERN(int) git_diff_print_compact(
git_diff_list *diff,
void *cb_data,
- git_diff_output_fn print_cb);
+ git_diff_data_fn print_cb);
/**
* Iterate over a diff generating text output like "git diff".
@@ -327,7 +326,7 @@ GIT_EXTERN(int) git_diff_print_compact(
GIT_EXTERN(int) git_diff_print_patch(
git_diff_list *diff,
void *cb_data,
- git_diff_output_fn print_cb);
+ git_diff_data_fn print_cb);
/**@}*/
@@ -345,7 +344,7 @@ GIT_EXTERN(int) git_diff_blobs(
git_diff_options *options,
void *cb_data,
git_diff_hunk_fn hunk_cb,
- git_diff_line_fn line_cb);
+ git_diff_data_fn line_cb);
GIT_END_DECL