blob: 2f69f6a434d7d05877ebf8d181475cb6848aee28 [file] [log] [blame]
Johannes Schindelind9c66f02018-08-13 04:33:04 -07001#ifndef RANGE_DIFF_H
2#define RANGE_DIFF_H
3
Johannes Schindelinc8c5e432018-08-13 04:33:07 -07004#include "diff.h"
Jeff Kingdbbcd442020-07-28 16:23:39 -04005#include "strvec.h"
Johannes Schindelinc8c5e432018-08-13 04:33:07 -07006
Eric Sunshine25668652018-07-22 05:57:11 -04007#define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
8
Junio C Hamanoc22d41d2024-05-06 09:40:31 -07009/*
10 * A much higher value than the default, when we KNOW we are comparing
11 * the same series (e.g., used when format-patch calls range-diff).
12 */
13#define CREATION_FACTOR_FOR_THE_SAME_SERIES 999
14
Johannes Schindelinf1ce6c12021-02-05 14:46:11 +000015struct range_diff_options {
16 int creation_factor;
17 unsigned dual_color:1;
Johannes Schindelin1e79f972021-02-05 14:46:13 +000018 unsigned left_only:1, right_only:1;
Johannes Schindelinf1ce6c12021-02-05 14:46:11 +000019 const struct diff_options *diffopt; /* may be NULL */
20 const struct strvec *other_arg; /* may be NULL */
21};
22
Junio C Hamanod8981c32018-11-30 13:27:11 +090023/*
Johannes Schindelinf1ce6c12021-02-05 14:46:11 +000024 * Compare series of commits in `range1` and `range2`, and emit to the
25 * standard output.
Junio C Hamanod8981c32018-11-30 13:27:11 +090026 */
Johannes Schindelind9c66f02018-08-13 04:33:04 -070027int show_range_diff(const char *range1, const char *range2,
Johannes Schindelinf1ce6c12021-02-05 14:46:11 +000028 struct range_diff_options *opts);
Johannes Schindelind9c66f02018-08-13 04:33:04 -070029
Johannes Schindelin679b5912021-01-27 16:37:22 +000030/*
31 * Determine whether the given argument is usable as a range argument of `git
Johannes Schindelin359f0d72021-02-05 14:44:48 +000032 * range-diff`, e.g. A..B.
Johannes Schindelin679b5912021-01-27 16:37:22 +000033 */
34int is_range_diff_range(const char *arg);
35
Johannes Schindelind9c66f02018-08-13 04:33:04 -070036#endif