diff options
author | Russell Belfer <rb@github.com> | 2012-09-10 11:49:12 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-09-10 11:49:12 -0700 |
commit | e597b1890ebd43e398d84b7bf4ca366365b24d27 (patch) | |
tree | 1c82889385a73be24fe95f24ad43c207023d28f9 /include/git2/diff.h | |
parent | b36effa22e015871948daeea250b4996c663e11a (diff) | |
download | libgit2-e597b1890ebd43e398d84b7bf4ca366365b24d27.tar.gz |
Move diff max_size to public API
This commit adds a max_size value in the public `git_diff_options`
structure so that the user can automatically flag blobs over a
certain size as binary regardless of other properties.
Also, and perhaps more importantly, this moves binary detection
to be as early as possible in the diff traversal inner loop and
makes sure that we stop loading objects as soon as we decide that
they are binary.
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r-- | include/git2/diff.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index 7a86d2463..4b4591a9e 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -56,7 +56,13 @@ enum { * values. Similarly, passing NULL for the options structure will * give the defaults. The default values are marked below. * - * @todo Most of the parameters here are not actually supported at this time. + * - flags: a combination of the GIT_DIFF_... values above + * - context_lines: number of lines of context to show around diffs + * - interhunk_lines: min lines between diff hunks to merge them + * - old_prefix: "directory" to prefix to old file names (default "a") + * - new_prefix: "directory" to prefix to new file names (default "b") + * - pathspec: array of paths / patterns to constrain diff + * - max_size: maximum blob size to diff, above this treated as binary */ typedef struct { uint32_t flags; /**< defaults to GIT_DIFF_NORMAL */ @@ -65,6 +71,7 @@ typedef struct { char *old_prefix; /**< defaults to "a" */ char *new_prefix; /**< defaults to "b" */ git_strarray pathspec; /**< defaults to show all paths */ + git_off_t max_size; /**< defaults to 512Mb */ } git_diff_options; /** |