summaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-11-20 21:18:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-21 00:29:52 (GMT)
commitbd361918868284c06a438b832dbc95e11266fd5b (patch)
treeb3a1e3d903000662a4c3f8f0d7d57a7d7bef77c7 /range-diff.c
parent9f726e1b879f6cc191cf18e0b81dbea45eaee60d (diff)
downloadgit-bd361918868284c06a438b832dbc95e11266fd5b.zip
git-bd361918868284c06a438b832dbc95e11266fd5b.tar.gz
git-bd361918868284c06a438b832dbc95e11266fd5b.tar.bz2
range-diff: pass through --notes to `git log`
When a commit being range-diff'd has a note attached to it, the note will be compared as well. However, if a user has multiple notes refs or if they want to suppress notes from being printed, there is currently no way to do this. Pass through `--[no-]notes[=<ref>]` to the `git log` call so that this option is customizable. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/range-diff.c b/range-diff.c
index 6233972..f56b401 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -40,7 +40,8 @@ static size_t find_end_of_line(char *buffer, unsigned long size)
* Reads the patches into a string list, with the `util` field being populated
* as struct object_id (will need to be free()d).
*/
-static int read_patches(const char *range, struct string_list *list)
+static int read_patches(const char *range, struct string_list *list,
+ struct argv_array *other_arg)
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -61,8 +62,11 @@ static int read_patches(const char *range, struct string_list *list)
"--output-indicator-new=>",
"--output-indicator-old=<",
"--output-indicator-context=#",
- "--no-abbrev-commit", range,
+ "--no-abbrev-commit",
NULL);
+ if (other_arg)
+ argv_array_pushv(&cp.args, other_arg->argv);
+ argv_array_push(&cp.args, range);
cp.out = -1;
cp.no_stdin = 1;
cp.git_cmd = 1;
@@ -502,16 +506,17 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
int show_range_diff(const char *range1, const char *range2,
int creation_factor, int dual_color,
- struct diff_options *diffopt)
+ struct diff_options *diffopt,
+ struct argv_array *other_arg)
{
int res = 0;
struct string_list branch1 = STRING_LIST_INIT_DUP;
struct string_list branch2 = STRING_LIST_INIT_DUP;
- if (read_patches(range1, &branch1))
+ if (read_patches(range1, &branch1, other_arg))
res = error(_("could not parse log for '%s'"), range1);
- if (!res && read_patches(range2, &branch2))
+ if (!res && read_patches(range2, &branch2, other_arg))
res = error(_("could not parse log for '%s'"), range2);
if (!res) {