Johannes Schindelin | d9c66f0 | 2018-08-13 04:33:04 -0700 | [diff] [blame] | 1 | #ifndef RANGE_DIFF_H |
| 2 | #define RANGE_DIFF_H |
| 3 | |
Johannes Schindelin | c8c5e43 | 2018-08-13 04:33:07 -0700 | [diff] [blame] | 4 | #include "diff.h" |
Jeff King | dbbcd44 | 2020-07-28 16:23:39 -0400 | [diff] [blame] | 5 | #include "strvec.h" |
Johannes Schindelin | c8c5e43 | 2018-08-13 04:33:07 -0700 | [diff] [blame] | 6 | |
Eric Sunshine | 2566865 | 2018-07-22 05:57:11 -0400 | [diff] [blame] | 7 | #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60 |
| 8 | |
Junio C Hamano | c22d41d | 2024-05-06 09:40:31 -0700 | [diff] [blame] | 9 | /* |
| 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 Schindelin | f1ce6c1 | 2021-02-05 14:46:11 +0000 | [diff] [blame] | 15 | struct range_diff_options { |
| 16 | int creation_factor; |
| 17 | unsigned dual_color:1; |
Johannes Schindelin | 1e79f97 | 2021-02-05 14:46:13 +0000 | [diff] [blame] | 18 | unsigned left_only:1, right_only:1; |
Johannes Schindelin | f1ce6c1 | 2021-02-05 14:46:11 +0000 | [diff] [blame] | 19 | const struct diff_options *diffopt; /* may be NULL */ |
| 20 | const struct strvec *other_arg; /* may be NULL */ |
| 21 | }; |
| 22 | |
Junio C Hamano | d8981c3 | 2018-11-30 13:27:11 +0900 | [diff] [blame] | 23 | /* |
Johannes Schindelin | f1ce6c1 | 2021-02-05 14:46:11 +0000 | [diff] [blame] | 24 | * Compare series of commits in `range1` and `range2`, and emit to the |
| 25 | * standard output. |
Junio C Hamano | d8981c3 | 2018-11-30 13:27:11 +0900 | [diff] [blame] | 26 | */ |
Johannes Schindelin | d9c66f0 | 2018-08-13 04:33:04 -0700 | [diff] [blame] | 27 | int show_range_diff(const char *range1, const char *range2, |
Johannes Schindelin | f1ce6c1 | 2021-02-05 14:46:11 +0000 | [diff] [blame] | 28 | struct range_diff_options *opts); |
Johannes Schindelin | d9c66f0 | 2018-08-13 04:33:04 -0700 | [diff] [blame] | 29 | |
Johannes Schindelin | 679b591 | 2021-01-27 16:37:22 +0000 | [diff] [blame] | 30 | /* |
| 31 | * Determine whether the given argument is usable as a range argument of `git |
Johannes Schindelin | 359f0d7 | 2021-02-05 14:44:48 +0000 | [diff] [blame] | 32 | * range-diff`, e.g. A..B. |
Johannes Schindelin | 679b591 | 2021-01-27 16:37:22 +0000 | [diff] [blame] | 33 | */ |
| 34 | int is_range_diff_range(const char *arg); |
| 35 | |
Johannes Schindelin | d9c66f0 | 2018-08-13 04:33:04 -0700 | [diff] [blame] | 36 | #endif |