]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/range-diff-one-side-only'
authorJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
The "git range-diff" command learned "--(left|right)-only" option
to show only one side of the compared range.

* js/range-diff-one-side-only:
  range-diff: offer --left-only/--right-only options
  range-diff: move the diffopt initialization down one layer
  range-diff: combine all options in a single data structure
  range-diff: simplify code spawning `git log`
  range-diff: libify the read_patches() function again
  range-diff: avoid leaking memory in two error code paths

1  2 
Documentation/git-range-diff.txt
builtin/log.c
builtin/range-diff.c
log-tree.c
range-diff.c
range-diff.h
t/t3206-range-diff.sh

Simple merge
diff --cc builtin/log.c
Simple merge
Simple merge
diff --cc log-tree.c
Simple merge
diff --cc range-diff.c
Simple merge
diff --cc range-diff.h
index 4abd70c40fed668b80ad935668c026c0ddbf9ce8,27c9adfd2be46b1267ef655d6a80a5433a31b1c0..04ffe217be67c32d378a94f90094b70b01e55548
@@@ -6,20 -6,19 +6,25 @@@
  
  #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
  
+ struct range_diff_options {
+       int creation_factor;
+       unsigned dual_color:1;
+       unsigned left_only:1, right_only:1;
+       const struct diff_options *diffopt; /* may be NULL */
+       const struct strvec *other_arg; /* may be NULL */
+ };
  /*
-  * Compare series of commits in RANGE1 and RANGE2, and emit to the
-  * standard output.  NULL can be passed to DIFFOPT to use the built-in
-  * default.
+  * Compare series of commits in `range1` and `range2`, and emit to the
+  * standard output.
   */
  int show_range_diff(const char *range1, const char *range2,
-                   int creation_factor, int dual_color,
-                   const struct diff_options *diffopt,
-                   const struct strvec *other_arg);
+                   struct range_diff_options *opts);
  
 +/*
 + * Determine whether the given argument is usable as a range argument of `git
 + * range-diff`, e.g. A..B.
 + */
 +int is_range_diff_range(const char *arg);
 +
  #endif
Simple merge