{"thread":{"id":"43789","subject":"[PATCH v5 1/3] diff.c: remove output_prefix_length field","startedAt":"2016-08-11T22:59:53Z","lastAt":"2016-08-15T23:10:19Z","messageCount":10,"participants":["Jacob Keller","Junio C Hamano"],"isPatch":true,"patchVersion":5,"patchTotal":3},"messages":[{"id":"298798","messageId":"20160811225946.18381-1-jacob.e.keller@intel.com","threadId":"43789","inReplyTo":null,"subject":"[PATCH v5 1/3] diff.c: remove output_prefix_length field","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2016-08-11T22:59:44Z","receivedAt":"2016-08-11T22:59:53Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\n\"diff/log --stat\" has a logic that determines the display columns\navailable for the diffstat part of the output and apportions it for\npathnames and diffstat graph automatically.\n\n5e71a84a (Add output_prefix_length to diff_options, 2012-04-16)\nadded the output_prefix_length field to diff_options structure to\nallow this logic subtract the display columns used for display the\nhistory graph part from the total \"terminal width\"; this matters\nwhen the \"git log --graph -p\" option is in use.\n\nThe field be set to the number of display columns needed to show the\noutput from the output_prefix() callback.  Any new output_prefix()\ncallback must also update the field accordingly, which is error\nprone.  As there is only one user of the field, and the user has the\nactual value of the prefix string, let's get rid of the field and\nhave the user count the display width itself.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\nThis is the same as what Junio submitted already, just thought I'd add\nit for clarity.\n\n diff.c  | 2 +-\n diff.h  | 1 -\n graph.c | 2 --\n 3 files changed, 1 insertion(+), 4 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex b43d3dd2ecb7..ae069c303077 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1625,7 +1625,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)\n \t */\n \n \tif (options->stat_width == -1)\n-\t\twidth = term_columns() - options->output_prefix_length;\n+\t\twidth = term_columns() - strlen(line_prefix);\n \telse\n \t\twidth = options->stat_width ? options->stat_width : 80;\n \tnumber_width = decimal_width(max_change) > number_width ?\ndiff --git a/diff.h b/diff.h\nindex 125447be09eb..49e4aaafb2da 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -174,7 +174,6 @@ struct diff_options {\n \tdiff_format_fn_t format_callback;\n \tvoid *format_callback_data;\n \tdiff_prefix_fn_t output_prefix;\n-\tint output_prefix_length;\n \tvoid *output_prefix_data;\n \n \tint diff_path_counter;\ndiff --git a/graph.c b/graph.c\nindex dd1720148dc5..a46803840511 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -197,7 +197,6 @@ static struct strbuf *diff_output_prefix_callback(struct diff_options *opt, void\n \tassert(opt);\n \tassert(graph);\n \n-\topt->output_prefix_length = graph->width;\n \tstrbuf_reset(&msgbuf);\n \tgraph_padding_line(graph, &msgbuf);\n \treturn &msgbuf;\n@@ -245,7 +244,6 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t */\n \topt->diffopt.output_prefix = diff_output_prefix_callback;\n \topt->diffopt.output_prefix_data = graph;\n-\topt->diffopt.output_prefix_length = 0;\n \n \treturn graph;\n }\n-- \n2.9.2.872.g367ebef.dirty\n\n"},{"id":"298799","messageId":"20160811225946.18381-2-jacob.e.keller@intel.com","threadId":"43789","inReplyTo":"20160811225946.18381-1-jacob.e.keller@intel.com","subject":"[PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2016-08-11T22:59:45Z","receivedAt":"2016-08-11T22:59:57Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nAdd an option to pass additional prefix to be displayed before diff\noutput. This feature will be used in a following patch to output correct\n--graph prefix when using a child_process/run_command interface for\nsubmodules.\n\nThe prefix shall come first prior to any other prefix associated with\nthe --graph option or other source.\n\nAdd tests for the same.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\n---\n- v5\n* Changed name to --diff-line-prefix since --line-prefix might indicate\n  for other commands such as log, when it only modifies diff output\n\n Documentation/diff-options.txt                     |  3 +++\n diff.c                                             | 16 ++++++++++--\n diff.h                                             |  1 +\n t/t4013-diff-various.sh                            |  6 +++++\n ...diff_--diff-line-prefix=-->_master_master^_side | 29 ++++++++++++++++++++++\n .../diff.diff_--diff-line-prefix_--cached_--_file0 | 15 +++++++++++\n 6 files changed, 68 insertions(+), 2 deletions(-)\n create mode 100644 t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side\n create mode 100644 t/t4013/diff.diff_--diff-line-prefix_--cached_--_file0\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 705a87394200..f924f57d4f62 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -569,5 +569,8 @@ endif::git-format-patch[]\n --no-prefix::\n \tDo not show any source or destination prefix.\n \n+--diff-line-prefix=<prefix>::\n+\tPrepend an additional prefix to every line of diff output.\n+\n For more detailed explanation on these common options, see also\n linkgit:gitdiffcore[7].\ndiff --git a/diff.c b/diff.c\nindex ae069c303077..73dda58c440c 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1167,10 +1167,18 @@ const char *diff_get_color(int diff_use_color, enum color_diff ix)\n const char *diff_line_prefix(struct diff_options *opt)\n {\n \tstruct strbuf *msgbuf;\n-\tif (!opt->output_prefix)\n-\t\treturn \"\";\n+\n+\tif (!opt->output_prefix) {\n+\t\tif (opt->line_prefix)\n+\t\t\treturn opt->line_prefix;\n+\t\telse\n+\t\t\treturn \"\";\n+\t}\n \n \tmsgbuf = opt->output_prefix(opt, opt->output_prefix_data);\n+\t/* line prefix must be printed before the output_prefix() */\n+\tif (opt->line_prefix)\n+\t\tstrbuf_insert(msgbuf, 0, opt->line_prefix, strlen(opt->line_prefix));\n \treturn msgbuf->buf;\n }\n \n@@ -3966,6 +3974,10 @@ int diff_opt_parse(struct diff_options *options,\n \t\toptions->a_prefix = optarg;\n \t\treturn argcount;\n \t}\n+\telse if ((argcount = parse_long_opt(\"diff-line-prefix\", av, &optarg))) {\n+\t\toptions->line_prefix = optarg;\n+\t\treturn argcount;\n+\t}\n \telse if ((argcount = parse_long_opt(\"dst-prefix\", av, &optarg))) {\n \t\toptions->b_prefix = optarg;\n \t\treturn argcount;\ndiff --git a/diff.h b/diff.h\nindex 49e4aaafb2da..83d0b1ae8580 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -115,6 +115,7 @@ struct diff_options {\n \tconst char *pickaxe;\n \tconst char *single_follow;\n \tconst char *a_prefix, *b_prefix;\n+\tconst char *line_prefix;\n \tunsigned flags;\n \tunsigned touched_flags;\n \ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 94ef5000e787..5204645eb92b 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -306,6 +306,8 @@ diff --no-index --name-status dir2 dir\n diff --no-index --name-status -- dir2 dir\n diff --no-index dir dir3\n diff master master^ side\n+# Can't use spaces...\n+diff --diff-line-prefix=--> master master^ side\n diff --dirstat master~1 master~2\n diff --dirstat initial rearrange\n diff --dirstat-by-file initial rearrange\n@@ -325,6 +327,10 @@ test_expect_success 'diff --cached -- file on unborn branch' '\n \tgit diff --cached -- file0 >result &&\n \ttest_cmp \"$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0\" result\n '\n+test_expect_success 'diff --diff-line-prefix with spaces' '\n+\tgit diff --diff-line-prefix=\"| | | \" --cached -- file0 >result &&\n+\ttest_cmp \"$TEST_DIRECTORY/t4013/diff.diff_--diff-line-prefix_--cached_--_file0\" result\n+'\n \n test_expect_success 'diff-tree --stdin with log formatting' '\n \tcat >expect <<-\\EOF &&\ndiff --git a/t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side b/t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side\nnew file mode 100644\nindex 000000000000..5cc90f27c2d9\n--- /dev/null\n+++ b/t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side\n@@ -0,0 +1,29 @@\n+$ git diff --diff-line-prefix=--> master master^ side\n+-->diff --cc dir/sub\n+-->index cead32e,7289e35..992913c\n+-->--- a/dir/sub\n+-->+++ b/dir/sub\n+-->@@@ -1,6 -1,4 +1,8 @@@\n+-->  A\n+-->  B\n+--> +C\n+--> +D\n+--> +E\n+--> +F\n+-->+ 1\n+-->+ 2\n+-->diff --cc file0\n+-->index b414108,f4615da..10a8a9f\n+-->--- a/file0\n+-->+++ b/file0\n+-->@@@ -1,6 -1,6 +1,9 @@@\n+-->  1\n+-->  2\n+-->  3\n+--> +4\n+--> +5\n+--> +6\n+-->+ A\n+-->+ B\n+-->+ C\n+$\ndiff --git a/t/t4013/diff.diff_--diff-line-prefix_--cached_--_file0 b/t/t4013/diff.diff_--diff-line-prefix_--cached_--_file0\nnew file mode 100644\nindex 000000000000..f41ba4d36aa1\n--- /dev/null\n+++ b/t/t4013/diff.diff_--diff-line-prefix_--cached_--_file0\n@@ -0,0 +1,15 @@\n+| | | diff --git a/file0 b/file0\n+| | | new file mode 100644\n+| | | index 0000000..10a8a9f\n+| | | --- /dev/null\n+| | | +++ b/file0\n+| | | @@ -0,0 +1,9 @@\n+| | | +1\n+| | | +2\n+| | | +3\n+| | | +4\n+| | | +5\n+| | | +6\n+| | | +A\n+| | | +B\n+| | | +C\n-- \n2.9.2.872.g367ebef.dirty\n\n"},{"id":"298800","messageId":"20160811225946.18381-3-jacob.e.keller@intel.com","threadId":"43789","inReplyTo":"20160811225946.18381-1-jacob.e.keller@intel.com","subject":"[PATCH v5 3/3] diff: add SUBMODULE_DIFF format to display submodule diff","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2016-08-11T22:59:46Z","receivedAt":"2016-08-11T22:59:59Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nTeach git-diff and friends a new format for displaying the difference of\na submodule using git-diff inside the submodule project. This allows\nusers to easily see exactly what source changed in a given commit that\nupdates the submodule pointer. To do this, remove DIFF_SUBMODULE_LOG bit\nfrom the diff options, and instead add a new enum type for these\nformats.\n\nAdd some tests for the new format and option.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\n---\nMajor changes in v5 after adding tests, I will try to give an overview.\nUnfortunately an interdiff is not easy as I do not remember which reflog\nentry was v4 and it's been many edits, so I haven't bothered to dig\nenough yet.\n\n- v5\n* reword \"can be tweaked\" text in the diff options\n* remove unused variables\n* print the submodule contains untracked or modified header piece\n* print (new submodule) and (deleted submodule)\n* handle case where the submodule is not initialized at all, and thus\n  has no .git/modules/xyz, making a diff impossible\n* handle the git directory better, plus comments explaining\n* handle modified files better. Untracked unfortunately is more\n  difficult. Suggestions for this welcome.\n* handle null sha1 correctly (replace with empty tree)\n\nI also added tests, mostly for diff output. These should be viewed\ncarefully since it's possible I didn't check the diff output very\ncarefully. Also, I haven't yet added a test for --graph -p mode yet, as\nI haven't found a suitable place for it to be located.\n\n Documentation/diff-config.txt                |   3 +-\n Documentation/diff-options.txt               |   7 +-\n diff.c                                       |  41 +-\n diff.h                                       |   9 +-\n submodule.c                                  | 130 +++++\n submodule.h                                  |   6 +\n t/t4059-diff-submodule-option-diff-format.sh | 738 +++++++++++++++++++++++++++\n 7 files changed, 915 insertions(+), 19 deletions(-)\n create mode 100755 t/t4059-diff-submodule-option-diff-format.sh\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex d5a5b17d5088..f5d693afad6c 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -123,7 +123,8 @@ diff.suppressBlankEmpty::\n diff.submodule::\n \tSpecify the format in which differences in submodules are\n \tshown.  The \"log\" format lists the commits in the range like\n-\tlinkgit:git-submodule[1] `summary` does.  The \"short\" format\n+\tlinkgit:git-submodule[1] `summary` does.  The \"diff\" format shows the\n+\tdiff between the beginning and end of the range. The \"short\" format\n \tformat just shows the names of the commits at the beginning\n \tand end of the range.  Defaults to short.\n \ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex f924f57d4f62..9a8e86ba1477 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -215,8 +215,11 @@ any of those replacements occurred.\n \tthe commits in the range like linkgit:git-submodule[1] `summary` does.\n \tOmitting the `--submodule` option or specifying `--submodule=short`,\n \tuses the 'short' format. This format just shows the names of the commits\n-\tat the beginning and end of the range.  Can be tweaked via the\n-\t`diff.submodule` configuration variable.\n+\tat the beginning and end of the range. When `--submodule=diff` is\n+\tgiven, the 'diff' format is used. This format shows the diff between\n+\tthe old and new submodule commmit from the perspective of the\n+\tsubmodule.  Defaults to `diff.submodule` or 'short' if the config\n+\toption is unset.\n \n --color[=<when>]::\n \tShow colored diff.\ndiff --git a/diff.c b/diff.c\nindex 73dda58c440c..660fdb4cfe46 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -131,9 +131,11 @@ static int parse_dirstat_params(struct diff_options *options, const char *params\n static int parse_submodule_params(struct diff_options *options, const char *value)\n {\n \tif (!strcmp(value, \"log\"))\n-\t\tDIFF_OPT_SET(options, SUBMODULE_LOG);\n+\t\toptions->submodule_format = DIFF_SUBMODULE_LOG;\n+\telse if (!strcmp(value, \"diff\"))\n+\t\toptions->submodule_format = DIFF_SUBMODULE_DIFF;\n \telse if (!strcmp(value, \"short\"))\n-\t\tDIFF_OPT_CLR(options, SUBMODULE_LOG);\n+\t\toptions->submodule_format = DIFF_SUBMODULE_SHORT;\n \telse\n \t\treturn -1;\n \treturn 0;\n@@ -2307,9 +2309,18 @@ static void builtin_diff(const char *name_a,\n \tstruct strbuf header = STRBUF_INIT;\n \tconst char *line_prefix = diff_line_prefix(o);\n \n-\tif (DIFF_OPT_TST(o, SUBMODULE_LOG) &&\n-\t\t\t(!one->mode || S_ISGITLINK(one->mode)) &&\n-\t\t\t(!two->mode || S_ISGITLINK(two->mode))) {\n+\tdiff_set_mnemonic_prefix(o, \"a/\", \"b/\");\n+\tif (DIFF_OPT_TST(o, REVERSE_DIFF)) {\n+\t\ta_prefix = o->b_prefix;\n+\t\tb_prefix = o->a_prefix;\n+\t} else {\n+\t\ta_prefix = o->a_prefix;\n+\t\tb_prefix = o->b_prefix;\n+\t}\n+\n+\tif (o->submodule_format == DIFF_SUBMODULE_LOG &&\n+\t    (!one->mode || S_ISGITLINK(one->mode)) &&\n+\t    (!two->mode || S_ISGITLINK(two->mode))) {\n \t\tconst char *del = diff_get_color_opt(o, DIFF_FILE_OLD);\n \t\tconst char *add = diff_get_color_opt(o, DIFF_FILE_NEW);\n \t\tshow_submodule_summary(o->file, one->path ? one->path : two->path,\n@@ -2318,6 +2329,15 @@ static void builtin_diff(const char *name_a,\n \t\t\t\ttwo->dirty_submodule,\n \t\t\t\tmeta, del, add, reset);\n \t\treturn;\n+\t} else if (o->submodule_format == DIFF_SUBMODULE_DIFF &&\n+\t\t   (!one->mode || S_ISGITLINK(one->mode)) &&\n+\t\t   (!two->mode || S_ISGITLINK(two->mode))) {\n+\t\tshow_submodule_diff(o->file, one->path ? one->path : two->path,\n+\t\t\t\tline_prefix,\n+\t\t\t\tone->oid.hash, two->oid.hash,\n+\t\t\t\ttwo->dirty_submodule,\n+\t\t\t\tmeta, a_prefix, b_prefix, reset);\n+\t\treturn;\n \t}\n \n \tif (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) {\n@@ -2325,15 +2345,6 @@ static void builtin_diff(const char *name_a,\n \t\ttextconv_two = get_textconv(two);\n \t}\n \n-\tdiff_set_mnemonic_prefix(o, \"a/\", \"b/\");\n-\tif (DIFF_OPT_TST(o, REVERSE_DIFF)) {\n-\t\ta_prefix = o->b_prefix;\n-\t\tb_prefix = o->a_prefix;\n-\t} else {\n-\t\ta_prefix = o->a_prefix;\n-\t\tb_prefix = o->b_prefix;\n-\t}\n-\n \t/* Never use a non-valid filename anywhere if at all possible */\n \tname_a = DIFF_FILE_VALID(one) ? name_a : name_b;\n \tname_b = DIFF_FILE_VALID(two) ? name_b : name_a;\n@@ -3923,7 +3934,7 @@ int diff_opt_parse(struct diff_options *options,\n \t\tDIFF_OPT_SET(options, OVERRIDE_SUBMODULE_CONFIG);\n \t\thandle_ignore_submodules_arg(options, arg);\n \t} else if (!strcmp(arg, \"--submodule\"))\n-\t\tDIFF_OPT_SET(options, SUBMODULE_LOG);\n+\t\toptions->submodule_format = DIFF_SUBMODULE_LOG;\n \telse if (skip_prefix(arg, \"--submodule=\", &arg))\n \t\treturn parse_submodule_opt(options, arg);\n \telse if (skip_prefix(arg, \"--ws-error-highlight=\", &arg))\ndiff --git a/diff.h b/diff.h\nindex 83d0b1ae8580..abaa9a49c036 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -83,7 +83,7 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data)\n #define DIFF_OPT_DIRSTAT_BY_FILE     (1 << 20)\n #define DIFF_OPT_ALLOW_TEXTCONV      (1 << 21)\n #define DIFF_OPT_DIFF_FROM_CONTENTS  (1 << 22)\n-#define DIFF_OPT_SUBMODULE_LOG       (1 << 23)\n+/* (1 << 23) unused */\n #define DIFF_OPT_DIRTY_SUBMODULES    (1 << 24)\n #define DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES (1 << 25)\n #define DIFF_OPT_IGNORE_DIRTY_SUBMODULES (1 << 26)\n@@ -110,6 +110,12 @@ enum diff_words_type {\n \tDIFF_WORDS_COLOR\n };\n \n+enum diff_submodule_format {\n+\tDIFF_SUBMODULE_SHORT = 0,\n+\tDIFF_SUBMODULE_LOG,\n+\tDIFF_SUBMODULE_DIFF\n+};\n+\n struct diff_options {\n \tconst char *orderfile;\n \tconst char *pickaxe;\n@@ -156,6 +162,7 @@ struct diff_options {\n \tint stat_count;\n \tconst char *word_regex;\n \tenum diff_words_type word_diff;\n+\tenum diff_submodule_format submodule_format;\n \n \t/* this is set by diffcore for DIFF_FORMAT_PATCH */\n \tint found_changes;\ndiff --git a/submodule.c b/submodule.c\nindex 1b5cdfb7e784..fb0866cb0c68 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -333,6 +333,136 @@ static void print_submodule_summary(struct rev_info *rev, FILE *f,\n \tstrbuf_release(&sb);\n }\n \n+void show_submodule_diff(FILE *f, const char *path,\n+\t\tconst char *line_prefix,\n+\t\tunsigned char one[20], unsigned char two[20],\n+\t\tunsigned dirty_submodule, const char *meta,\n+\t\tconst char *a_prefix, const char *b_prefix,\n+\t\tconst char *reset)\n+{\n+\tstruct strbuf submodule_git_dir = STRBUF_INIT, sb = STRBUF_INIT;\n+\tstruct child_process cp = CHILD_PROCESS_INIT;\n+\tconst char *git_dir;\n+\n+\tif (dirty_submodule & DIRTY_SUBMODULE_UNTRACKED) {\n+\t\tfprintf(f, \"%sSubmodule %s contains untracked content\\n\",\n+\t\t\tline_prefix, path);\n+\t}\n+\tif (dirty_submodule & DIRTY_SUBMODULE_MODIFIED) {\n+\t\tfprintf(f, \"%sSubmodule %s contains modified content\\n\",\n+\t\t\tline_prefix, path);\n+\t}\n+\n+\tstrbuf_addf(&sb, \"%s%sSubmodule %s %s..\",\n+\t\t    line_prefix, meta, path,\n+\t\t    find_unique_abbrev(one, DEFAULT_ABBREV));\n+\tstrbuf_addf(&sb, \"%s:%s\",\n+\t\t    find_unique_abbrev(two, DEFAULT_ABBREV),\n+\t\t    reset);\n+\tfwrite(sb.buf, sb.len, 1, f);\n+\n+\tif (is_null_sha1(one))\n+\t\tfprintf(f, \" (new submodule)\");\n+\tif (is_null_sha1(two))\n+\t\tfprintf(f, \" (submodule deleted)\");\n+\n+\t/*\n+\t * We need to determine the most accurate location to call the sub\n+\t * command, and handle the various corner cases involved. We'll first\n+\t * attempt to use the path directly if the submodule is checked out.\n+\t * Then, if that fails, we'll check the standard module location in\n+\t * the git directory. If even this fails, it means we can't do the\n+\t * lookup because the module has not been initialized.\n+\t */\n+\tstrbuf_addf(&submodule_git_dir, \"%s/.git\", path);\n+\tgit_dir = resolve_gitdir(submodule_git_dir.buf);\n+\tif (git_dir) {\n+\t\t/*\n+\t\t * If we can resolve a git dir, this means that the submodule\n+\t\t * has been checked out. In this case, just use the original\n+\t\t * path since we want access to the work tree\n+\t\t */\n+\t\tgit_dir = path;\n+\t} else {\n+\t\t/*\n+\t\t * If we can't resolve a git dir, this means that the\n+\t\t * submodule has not been checked out. In this case, try the\n+\t\t * standard location for modules\n+\t\t */\n+\t\tstrbuf_reset(&submodule_git_dir);\n+\t\tstrbuf_addf(&submodule_git_dir, \"%s/modules/%s\", get_git_dir(), path);\n+\t\tgit_dir = resolve_gitdir(submodule_git_dir.buf);\n+\t\tif (!git_dir) {\n+\t\t\t/*\n+\t\t\t * If we failed to find a git directory here, then the\n+\t\t\t * submodule must not have been initialized. Without\n+\t\t\t * the initialized contents of the submodule, we won't\n+\t\t\t * be able to perform the difference.\n+\t\t\t */\n+\t\t\tfprintf(f, \" (submodule not initialized)\\n\");\n+\t\t\tgoto out;\n+\t\t}\n+\t}\n+\n+\t/*\n+\t * print a newline and flush the file so that the diff output appears\n+\t * starting on its own line\n+\t */\n+\tfprintf(f, \"\\n\");\n+\tfflush(f);\n+\n+\tcp.git_cmd = 1;\n+\tcp.dir = git_dir;\n+\tcp.out = dup(fileno(f));\n+\tcp.no_stdin = 1;\n+\n+\targv_array_push(&cp.args, \"diff\");\n+\targv_array_pushf(&cp.args, \"--diff-line-prefix=%s\", line_prefix);\n+\targv_array_pushf(&cp.args, \"--src-prefix=%s%s/\", a_prefix, path);\n+\targv_array_pushf(&cp.args, \"--dst-prefix=%s%s/\", b_prefix, path);\n+\n+\tif (is_null_sha1(one)) {\n+\t\t/*\n+\t\t * If the origin commit is null, we want to use the empty tree\n+\t\t * so that we see a diff of all the new contents added.\n+\t\t */\n+\t\targv_array_push(&cp.args, EMPTY_TREE_SHA1_HEX);\n+\t} else {\n+\t\t/* Use the old commit as the diff base */\n+\t\targv_array_push(&cp.args, sha1_to_hex(one));\n+\t}\n+\n+\tif (dirty_submodule & DIRTY_SUBMODULE_MODIFIED) {\n+\t\t/*\n+\t\t * If the submodule has modified contents we want to diff\n+\t\t * against the work tree, so don't add a second parameter.\n+\t\t * This is essentially equivalent of using diff-index instead.\n+\t\t * Note that we can't (easily) show the diff of any untracked\n+\t\t * files.\n+\t\t */\n+\t} else if (is_null_sha1(two)) {\n+\t\t/*\n+\t\t * If new commit is null, we should diff against the empty\n+\t\t * tree, so that we see a diff of all submodule contents\n+\t\t * removed.\n+\t\t */\n+\t\targv_array_push(&cp.args, EMPTY_TREE_SHA1_HEX);\n+\t} else {\n+\t\t/*\n+\t\t * Finally, in other cases use the new commit as the end\n+\t\t * result.\n+\t\t */\n+\t\targv_array_push(&cp.args, sha1_to_hex(two));\n+\t}\n+\n+\tif (run_command(&cp))\n+\t\tfprintf(f, \"(diff failed)\\n\");\n+\n+out:\n+\tstrbuf_release(&submodule_git_dir);\n+\tstrbuf_release(&sb);\n+}\n+\n void show_submodule_summary(FILE *f, const char *path,\n \t\tconst char *line_prefix,\n \t\tunsigned char one[20], unsigned char two[20],\ndiff --git a/submodule.h b/submodule.h\nindex 2af939099819..f32a25c667ab 100644\n--- a/submodule.h\n+++ b/submodule.h\n@@ -41,6 +41,12 @@ int parse_submodule_update_strategy(const char *value,\n \t\tstruct submodule_update_strategy *dst);\n const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);\n void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *);\n+void show_submodule_diff(FILE *f, const char *path,\n+\t\tconst char *line_prefix,\n+\t\tunsigned char one[20], unsigned char two[20],\n+\t\tunsigned dirty_submodule, const char *meta,\n+\t\tconst char *a_prefix, const char *b_prefix,\n+\t\tconst char *reset);\n void show_submodule_summary(FILE *f, const char *path,\n \t\tconst char *line_prefix,\n \t\tunsigned char one[20], unsigned char two[20],\ndiff --git a/t/t4059-diff-submodule-option-diff-format.sh b/t/t4059-diff-submodule-option-diff-format.sh\nnew file mode 100755\nindex 000000000000..d1306b65986c\n--- /dev/null\n+++ b/t/t4059-diff-submodule-option-diff-format.sh\n@@ -0,0 +1,738 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Jens Lehmann, based on t7401 by Ping Yin\n+# Copyright (c) 2011 Alexey Shumkin (+ non-UTF-8 commit encoding tests)\n+# Copyright (c) 2016 Jacob Keller (copy + convert to --submodule=diff)\n+#\n+\n+test_description='Support for diff format verbose submodule difference in git diff\n+\n+This test tries to verify the sanity of --submodule=diff option of git diff.\n+'\n+\n+. ./test-lib.sh\n+\n+# Tested non-UTF-8 encoding\n+test_encoding=\"ISO8859-1\"\n+\n+# String \"added\" in German (translated with Google Translate), encoded in UTF-8,\n+# used in sample commit log messages in add_file() function below.\n+added=$(printf \"hinzugef\\303\\274gt\")\n+add_file () {\n+\t(\n+\t\tcd \"$1\" &&\n+\t\tshift &&\n+\t\tfor name\n+\t\tdo\n+\t\t\techo \"$name\" >\"$name\" &&\n+\t\t\tgit add \"$name\" &&\n+\t\t\ttest_tick &&\n+\t\t\t# \"git commit -m\" would break MinGW, as Windows refuse to pass\n+\t\t\t# $test_encoding encoded parameter to git.\n+\t\t\techo \"Add $name ($added $name)\" | iconv -f utf-8 -t $test_encoding |\n+\t\t\tgit -c \"i18n.commitEncoding=$test_encoding\" commit -F -\n+\t\tdone >/dev/null &&\n+\t\tgit rev-parse --short --verify HEAD\n+\t)\n+}\n+commit_file () {\n+\ttest_tick &&\n+\tgit commit \"$@\" -m \"Commit $*\" >/dev/null\n+}\n+\n+test_create_repo sm1 &&\n+add_file . foo >/dev/null\n+\n+head1=$(add_file sm1 foo1 foo2)\n+fullhead1=$(cd sm1; git rev-parse --verify HEAD)\n+\n+test_expect_success 'added submodule' '\n+\tgit add sm1 &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 0000000..1beffeb: (new submodule)\n+\tdiff --git a/sm1/foo1 b/sm1/foo1\n+\tnew file mode 100644\n+\tindex 0000000..1715acd\n+\t--- /dev/null\n+\t+++ b/sm1/foo1\n+\t@@ -0,0 +1 @@\n+\t+foo1\n+\tdiff --git a/sm1/foo2 b/sm1/foo2\n+\tnew file mode 100644\n+\tindex 0000000..54b060e\n+\t--- /dev/null\n+\t+++ b/sm1/foo2\n+\t@@ -0,0 +1 @@\n+\t+foo2\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'added submodule, set diff.submodule' '\n+\tgit config diff.submodule log &&\n+\tgit add sm1 &&\n+\tgit diff --cached >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 0000000...$head1 (new submodule)\n+\tEOF\n+\tgit config --unset diff.submodule &&\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success '--submodule=short overrides diff.submodule' '\n+\ttest_config diff.submodule log &&\n+\tgit add sm1 &&\n+\tgit diff --submodule=short --cached >actual &&\n+\tcat >expected <<-EOF &&\n+\tdiff --git a/sm1 b/sm1\n+\tnew file mode 160000\n+\tindex 0000000..$head1\n+\t--- /dev/null\n+\t+++ b/sm1\n+\t@@ -0,0 +1 @@\n+\t+Subproject commit $fullhead1\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'diff.submodule does not affect plumbing' '\n+\ttest_config diff.submodule log &&\n+\tgit diff-index -p HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tdiff --git a/sm1 b/sm1\n+\tnew file mode 160000\n+\tindex 0000000..$head1\n+\t--- /dev/null\n+\t+++ b/sm1\n+\t@@ -0,0 +1 @@\n+\t+Subproject commit $fullhead1\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file sm1 &&\n+head2=$(add_file sm1 foo3)\n+\n+test_expect_success 'modified submodule(forward)' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 1beffeb..30b9670:\n+\tdiff --git a/sm1/foo3 b/sm1/foo3\n+\tnew file mode 100644\n+\tindex 0000000..c1ec6c6\n+\t--- /dev/null\n+\t+++ b/sm1/foo3\n+\t@@ -0,0 +1 @@\n+\t+foo3\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule(forward)' '\n+\tgit diff --submodule=diff >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 1beffeb..30b9670:\n+\tdiff --git a/sm1/foo3 b/sm1/foo3\n+\tnew file mode 100644\n+\tindex 0000000..c1ec6c6\n+\t--- /dev/null\n+\t+++ b/sm1/foo3\n+\t@@ -0,0 +1 @@\n+\t+foo3\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule(forward) --submodule' '\n+\tgit diff --submodule >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 $head1..$head2:\n+\t  > Add foo3 ($added foo3)\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+fullhead2=$(cd sm1; git rev-parse --verify HEAD)\n+test_expect_success 'modified submodule(forward) --submodule=short' '\n+\tgit diff --submodule=short >actual &&\n+\tcat >expected <<-EOF &&\n+\tdiff --git a/sm1 b/sm1\n+\tindex $head1..$head2 160000\n+\t--- a/sm1\n+\t+++ b/sm1\n+\t@@ -1 +1 @@\n+\t-Subproject commit $fullhead1\n+\t+Subproject commit $fullhead2\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file sm1 &&\n+head3=$(\n+\tcd sm1 &&\n+\tgit reset --hard HEAD~2 >/dev/null &&\n+\tgit rev-parse --short --verify HEAD\n+)\n+\n+test_expect_success 'modified submodule(backward)' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 30b9670..dafb207:\n+\tdiff --git a/sm1/foo2 b/sm1/foo2\n+\tdeleted file mode 100644\n+\tindex 54b060e..0000000\n+\t--- a/sm1/foo2\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo2\n+\tdiff --git a/sm1/foo3 b/sm1/foo3\n+\tdeleted file mode 100644\n+\tindex c1ec6c6..0000000\n+\t--- a/sm1/foo3\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo3\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+head4=$(add_file sm1 foo4 foo5)\n+test_expect_success 'modified submodule(backward and forward)' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 30b9670..d176589:\n+\tdiff --git a/sm1/foo2 b/sm1/foo2\n+\tdeleted file mode 100644\n+\tindex 54b060e..0000000\n+\t--- a/sm1/foo2\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo2\n+\tdiff --git a/sm1/foo3 b/sm1/foo3\n+\tdeleted file mode 100644\n+\tindex c1ec6c6..0000000\n+\t--- a/sm1/foo3\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo3\n+\tdiff --git a/sm1/foo4 b/sm1/foo4\n+\tnew file mode 100644\n+\tindex 0000000..a0016db\n+\t--- /dev/null\n+\t+++ b/sm1/foo4\n+\t@@ -0,0 +1 @@\n+\t+foo4\n+\tdiff --git a/sm1/foo5 b/sm1/foo5\n+\tnew file mode 100644\n+\tindex 0000000..d6f2413\n+\t--- /dev/null\n+\t+++ b/sm1/foo5\n+\t@@ -0,0 +1 @@\n+\t+foo5\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file sm1 &&\n+mv sm1 sm1-bak &&\n+echo sm1 >sm1 &&\n+head5=$(git hash-object sm1 | cut -c1-7) &&\n+git add sm1 &&\n+rm -f sm1 &&\n+mv sm1-bak sm1\n+\n+test_expect_success 'typechanged submodule(submodule->blob), --cached' '\n+\tgit diff --submodule=diff --cached >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 d176589..0000000: (submodule deleted)\n+\tdiff --git a/sm1/foo1 b/sm1/foo1\n+\tdeleted file mode 100644\n+\tindex 1715acd..0000000\n+\t--- a/sm1/foo1\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo1\n+\tdiff --git a/sm1/foo4 b/sm1/foo4\n+\tdeleted file mode 100644\n+\tindex a0016db..0000000\n+\t--- a/sm1/foo4\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo4\n+\tdiff --git a/sm1/foo5 b/sm1/foo5\n+\tdeleted file mode 100644\n+\tindex d6f2413..0000000\n+\t--- a/sm1/foo5\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-foo5\n+\tdiff --git a/sm1 b/sm1\n+\tnew file mode 100644\n+\tindex 0000000..9da5fb8\n+\t--- /dev/null\n+\t+++ b/sm1\n+\t@@ -0,0 +1 @@\n+\t+sm1\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'typechanged submodule(submodule->blob)' '\n+\tgit diff --submodule=diff >actual &&\n+\tcat >expected <<-EOF &&\n+\tdiff --git a/sm1 b/sm1\n+\tdeleted file mode 100644\n+\tindex 9da5fb8..0000000\n+\t--- a/sm1\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-sm1\n+\tSubmodule sm1 0000000..d176589: (new submodule)\n+\tdiff --git a/sm1/foo1 b/sm1/foo1\n+\tnew file mode 100644\n+\tindex 0000000..1715acd\n+\t--- /dev/null\n+\t+++ b/sm1/foo1\n+\t@@ -0,0 +1 @@\n+\t+foo1\n+\tdiff --git a/sm1/foo4 b/sm1/foo4\n+\tnew file mode 100644\n+\tindex 0000000..a0016db\n+\t--- /dev/null\n+\t+++ b/sm1/foo4\n+\t@@ -0,0 +1 @@\n+\t+foo4\n+\tdiff --git a/sm1/foo5 b/sm1/foo5\n+\tnew file mode 100644\n+\tindex 0000000..d6f2413\n+\t--- /dev/null\n+\t+++ b/sm1/foo5\n+\t@@ -0,0 +1 @@\n+\t+foo5\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+rm -rf sm1 &&\n+git checkout-index sm1\n+test_expect_success 'typechanged submodule(submodule->blob)' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 $head4..0000000: (submodule deleted) (submodule not initialized)\n+\tdiff --git a/sm1 b/sm1\n+\tnew file mode 100644\n+\tindex 0000000..$head5\n+\t--- /dev/null\n+\t+++ b/sm1\n+\t@@ -0,0 +1 @@\n+\t+sm1\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+rm -f sm1 &&\n+test_create_repo sm1 &&\n+head6=$(add_file sm1 foo6 foo7)\n+fullhead6=$(cd sm1; git rev-parse --verify HEAD)\n+test_expect_success 'nonexistent commit' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 d176589..17243c9:\n+\t(diff failed)\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file\n+test_expect_success 'typechanged submodule(blob->submodule)' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tdiff --git a/sm1 b/sm1\n+\tdeleted file mode 100644\n+\tindex 9da5fb8..0000000\n+\t--- a/sm1\n+\t+++ /dev/null\n+\t@@ -1 +0,0 @@\n+\t-sm1\n+\tSubmodule sm1 0000000..17243c9: (new submodule)\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tnew file mode 100644\n+\tindex 0000000..462398b\n+\t--- /dev/null\n+\t+++ b/sm1/foo6\n+\t@@ -0,0 +1 @@\n+\t+foo6\n+\tdiff --git a/sm1/foo7 b/sm1/foo7\n+\tnew file mode 100644\n+\tindex 0000000..6e9262c\n+\t--- /dev/null\n+\t+++ b/sm1/foo7\n+\t@@ -0,0 +1 @@\n+\t+foo7\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file sm1 &&\n+test_expect_success 'submodule is up to date' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'submodule contains untracked content' '\n+\techo new > sm1/new-file &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains untracked content\n+\tSubmodule sm1 17243c9..17243c9:\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'submodule contains untracked content (untracked ignored)' '\n+\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'submodule contains untracked content (dirty ignored)' '\n+\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'submodule contains untracked content (all ignored)' '\n+\tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'submodule contains untracked and modified content' '\n+\techo new > sm1/foo6 &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains untracked content\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..17243c9:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+# NOT OK\n+test_expect_success 'submodule contains untracked and modified content (untracked ignored)' '\n+\techo new > sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..17243c9:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'submodule contains untracked and modified content (dirty ignored)' '\n+\techo new > sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'submodule contains untracked and modified content (all ignored)' '\n+\techo new > sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'submodule contains modified content' '\n+\trm -f sm1/new-file &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..17243c9:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+(cd sm1; git commit -mchange foo6 >/dev/null) &&\n+head8=$(cd sm1; git rev-parse --short --verify HEAD) &&\n+test_expect_success 'submodule is modified' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked content' '\n+\techo new > sm1/new-file &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains untracked content\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked content (untracked ignored)' '\n+\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked content (dirty ignored)' '\n+\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked content (all ignored)' '\n+\tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked and modified content' '\n+\techo modification >> sm1/foo6 &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains untracked content\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..dfda541 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1,2 @@\n+\t-foo6\n+\t+new\n+\t+modification\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked and modified content (untracked ignored)' '\n+\techo modification >> sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..e20e2d9 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1,3 @@\n+\t-foo6\n+\t+new\n+\t+modification\n+\t+modification\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked and modified content (dirty ignored)' '\n+\techo modification >> sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..3e75765 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1 @@\n+\t-foo6\n+\t+new\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'modified submodule contains untracked and modified content (all ignored)' '\n+\techo modification >> sm1/foo6 &&\n+\tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n+\t! test -s actual\n+'\n+\n+# NOT OK\n+test_expect_success 'modified submodule contains modified content' '\n+\trm -f sm1/new-file &&\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 contains modified content\n+\tSubmodule sm1 17243c9..cfce562:\n+\tdiff --git a/sm1/foo6 b/sm1/foo6\n+\tindex 462398b..ac466ca 100644\n+\t--- a/sm1/foo6\n+\t+++ b/sm1/foo6\n+\t@@ -1 +1,5 @@\n+\t-foo6\n+\t+new\n+\t+modification\n+\t+modification\n+\t+modification\n+\t+modification\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+rm -rf sm1\n+test_expect_success 'deleted submodule' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..0000000: (submodule deleted) (submodule not initialized)\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_create_repo sm2 &&\n+head7=$(add_file sm2 foo8 foo9) &&\n+git add sm2\n+\n+test_expect_success 'multiple submodules' '\n+\tgit diff-index -p --submodule=diff HEAD >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..0000000: (submodule deleted) (submodule not initialized)\n+\tSubmodule sm2 0000000..a5a65c9: (new submodule)\n+\tdiff --git a/sm2/foo8 b/sm2/foo8\n+\tnew file mode 100644\n+\tindex 0000000..db9916b\n+\t--- /dev/null\n+\t+++ b/sm2/foo8\n+\t@@ -0,0 +1 @@\n+\t+foo8\n+\tdiff --git a/sm2/foo9 b/sm2/foo9\n+\tnew file mode 100644\n+\tindex 0000000..9c3b4f6\n+\t--- /dev/null\n+\t+++ b/sm2/foo9\n+\t@@ -0,0 +1 @@\n+\t+foo9\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'path filter' '\n+\tgit diff-index -p --submodule=diff HEAD sm2 >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm2 0000000..a5a65c9: (new submodule)\n+\tdiff --git a/sm2/foo8 b/sm2/foo8\n+\tnew file mode 100644\n+\tindex 0000000..db9916b\n+\t--- /dev/null\n+\t+++ b/sm2/foo8\n+\t@@ -0,0 +1 @@\n+\t+foo8\n+\tdiff --git a/sm2/foo9 b/sm2/foo9\n+\tnew file mode 100644\n+\tindex 0000000..9c3b4f6\n+\t--- /dev/null\n+\t+++ b/sm2/foo9\n+\t@@ -0,0 +1 @@\n+\t+foo9\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+commit_file sm2\n+test_expect_success 'given commit' '\n+\tgit diff-index -p --submodule=diff HEAD^ >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..0000000: (submodule deleted) (submodule not initialized)\n+\tSubmodule sm2 0000000..a5a65c9: (new submodule)\n+\tdiff --git a/sm2/foo8 b/sm2/foo8\n+\tnew file mode 100644\n+\tindex 0000000..db9916b\n+\t--- /dev/null\n+\t+++ b/sm2/foo8\n+\t@@ -0,0 +1 @@\n+\t+foo8\n+\tdiff --git a/sm2/foo9 b/sm2/foo9\n+\tnew file mode 100644\n+\tindex 0000000..9c3b4f6\n+\t--- /dev/null\n+\t+++ b/sm2/foo9\n+\t@@ -0,0 +1 @@\n+\t+foo9\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'setup .git file for sm2' '\n+\t(cd sm2 &&\n+\t REAL=\"$(pwd)/../.real\" &&\n+\t mv .git \"$REAL\"\n+\t echo \"gitdir: $REAL\" >.git)\n+'\n+\n+test_expect_success 'diff --submodule=diff with .git file' '\n+\tgit diff --submodule=diff HEAD^ >actual &&\n+\tcat >expected <<-EOF &&\n+\tSubmodule sm1 17243c9..0000000: (submodule deleted) (submodule not initialized)\n+\tSubmodule sm2 0000000..a5a65c9: (new submodule)\n+\tdiff --git a/sm2/foo8 b/sm2/foo8\n+\tnew file mode 100644\n+\tindex 0000000..db9916b\n+\t--- /dev/null\n+\t+++ b/sm2/foo8\n+\t@@ -0,0 +1 @@\n+\t+foo8\n+\tdiff --git a/sm2/foo9 b/sm2/foo9\n+\tnew file mode 100644\n+\tindex 0000000..9c3b4f6\n+\t--- /dev/null\n+\t+++ b/sm2/foo9\n+\t@@ -0,0 +1 @@\n+\t+foo9\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_done\n-- \n2.9.2.872.g367ebef.dirty\n\n"},{"id":"298890","messageId":"xmqqvaz5vgc7.fsf@gitster.mtv.corp.google.com","threadId":"43789","inReplyTo":"20160811225946.18381-2-jacob.e.keller@intel.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-12T21:15:52Z","receivedAt":"2016-08-12T21:16:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.e.keller@intel.com> writes:\n\n> The prefix shall come first prior to any other prefix associated with\n> the --graph option or other source.\n>\n> Add tests for the same.\n>\n> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>\n> ---\n> - v5\n> * Changed name to --diff-line-prefix since --line-prefix might indicate\n>   for other commands such as log, when it only modifies diff output\n\nAs you are adding this to \"diff.c\", I think the option would be\nvisible to \"git log\" anyway, and more importantly\n\n    git log --line-prefix='I I ' --graph --boundary -p HEAD^..HEAD\n\nshould honor the line-prefix for the log message part.  I'd expect\nthat its output would be like:\n\nI I * commit 3c90ffd2f01e2d0d080c8e42df2ee89709b324de\nI I | Author: Jacob Keller <jacob.keller@gmail.com>\nI I | Date:   Thu Aug 11 15:59:45 2016 -0700\nI I | \nI I |     diff: add --diff-line-prefix option for passing in a prefix\nI I |     \nI I |     Add an option to pass additional prefix to be displayed before diff\nI I |     output. This feature will be used in a following patch to output correct\nI I |     ...\nI I |     Signed-off-by: Jacob Keller <jacob.keller@gmail.com>\nI I |     Signed-off-by: Junio C Hamano <gitster@pobox.com>\nI I | \nI I | diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nI I | index 705a873..f924f57 100644\nI I | --- a/Documentation/diff-options.txt\nI I | +++ b/Documentation/diff-options.txt\nI I | ...\n\nOtherwise, a \"git log --graph -p --submodule=log-with-diff\", when\nshowing a commit in the superproject that changes submodule from\ncommit A to commit B, wouldn't be able to run \"git log --graph -p A..B\",\ni.e. as if the command recursed beyond the module boundary, would\nit?\n\n\n\n"},{"id":"298891","messageId":"CA+P7+xoX6AT7tGb5AJr1CSjzAQ67o8QXJFF1LxsV_7E_pF-moA@mail.gmail.com","threadId":"43789","inReplyTo":"xmqqvaz5vgc7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-08-12T21:21:48Z","receivedAt":"2016-08-12T21:22:25Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Fri, Aug 12, 2016 at 2:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jacob Keller <jacob.e.keller@intel.com> writes:\n>\n>> The prefix shall come first prior to any other prefix associated with\n>> the --graph option or other source.\n>>\n>> Add tests for the same.\n>>\n>> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>\n>> ---\n>> - v5\n>> * Changed name to --diff-line-prefix since --line-prefix might indicate\n>>   for other commands such as log, when it only modifies diff output\n>\n> As you are adding this to \"diff.c\", I think the option would be\n> visible to \"git log\" anyway, and more importantly\n>\n>     git log --line-prefix='I I ' --graph --boundary -p HEAD^..HEAD\n>\n> should honor the line-prefix for the log message part.  I'd expect\n> that its output would be like:\n>\n> I I * commit 3c90ffd2f01e2d0d080c8e42df2ee89709b324de\n> I I | Author: Jacob Keller <jacob.keller@gmail.com>\n> I I | Date:   Thu Aug 11 15:59:45 2016 -0700\n> I I |\n> I I |     diff: add --diff-line-prefix option for passing in a prefix\n> I I |\n> I I |     Add an option to pass additional prefix to be displayed before diff\n> I I |     output. This feature will be used in a following patch to output correct\n> I I |     ...\n> I I |     Signed-off-by: Jacob Keller <jacob.keller@gmail.com>\n> I I |     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> I I |\n> I I | diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n> I I | index 705a873..f924f57 100644\n> I I | --- a/Documentation/diff-options.txt\n> I I | +++ b/Documentation/diff-options.txt\n> I I | ...\n>\n> Otherwise, a \"git log --graph -p --submodule=log-with-diff\", when\n> showing a commit in the superproject that changes submodule from\n> commit A to commit B, wouldn't be able to run \"git log --graph -p A..B\",\n> i.e. as if the command recursed beyond the module boundary, would\n> it?\n>\n\nHmmmm, yes. I'll dig through and see if I can get the prefix to be\nhonored by the git log as well.\n\nThanks,\nJake\n\n>\n>\n"},{"id":"298894","messageId":"CA+P7+xq+GTbvzOtVvpu4_rdYYy-hhGZHhpk_ka=KkeU7UmQRew@mail.gmail.com","threadId":"43789","inReplyTo":"CA+P7+xoX6AT7tGb5AJr1CSjzAQ67o8QXJFF1LxsV_7E_pF-moA@mail.gmail.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-08-12T21:43:35Z","receivedAt":"2016-08-12T21:44:04Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Fri, Aug 12, 2016 at 2:21 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n> On Fri, Aug 12, 2016 at 2:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Otherwise, a \"git log --graph -p --submodule=log-with-diff\", when\n>> showing a commit in the superproject that changes submodule from\n>> commit A to commit B, wouldn't be able to run \"git log --graph -p A..B\",\n>> i.e. as if the command recursed beyond the module boundary, would\n>> it?\n>>\n>\n> Hmmmm, yes. I'll dig through and see if I can get the prefix to be\n> honored by the git log as well.\n>\n> Thanks,\n> Jake\n\nOk so the big problem here is that unlike with diff which has support\nfor line-prefixes already due to needing it for graph mode, I can't\nfigure out where to get the prefix added for log output. Especially if\nwe want it to be honored prior to the graph output. This seems like a\nmuch bigger task, which is better saved for future maybe?\n\nThanks,\nJake\n"},{"id":"299288","messageId":"xmqqa8gfkpw1.fsf@gitster.mtv.corp.google.com","threadId":"43789","inReplyTo":"CA+P7+xp_sPk6P1qyyDfOgpkXU1GxWPivfSzvveS4PAvGb-=ggQ@mail.gmail.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-14T21:21:50Z","receivedAt":"2016-08-14T21:21:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> On Fri, Aug 12, 2016 at 2:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> On Fri, Aug 12, 2016 at 2:43 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n>>> Ok so the big problem here is that unlike with diff which has support\n>>> for line-prefixes already due to needing it for graph mode, I can't\n>>> figure out where to get the prefix added for log output.\n>>\n>> Doesn't the --graph mode show the graph lines already? I think most\n>> if not all of that processing happens inside log-tree.c::show_log().\n>\n> Yes but the problem is how to get this additional prefix to be displayed for\n>\n> (a) non graph mode\n> (b) for graph mode but display the prefix before the graph prefix\n>\n> It doesn't seem straight forward, and I haven't figured out how the\n> graph code already works.\n\nBecause you only need \"diff --line-prefix\" to work while leaving\n\"log --line-prefix\" broken for the purpose of your immediate purpose\nto update \"diff/log [--graph and other options] --submodule=<type>\"\nto show \"diff A B\" in the submodule, I think it is OK to leave it\nbroken, as long as it is clearly documented that \"--line-prefix\"\nshould also apply to the log message part but the current code\ndoesn't.  Eventually, when somebody wants to add a new <type> that\nruns \"log -p A..B\" instead of \"diff A B\" in submodules and wants to\nmake it interact well with \"log --graph\" at the superproject level,\nthey need to fix the breakage you leave behind.  That would be much\nbetter than \"because I cannot figure out how to prefix on the log\npart, I'll name this --diff-line-prefix\", which will force us to\nsupport that half-baked option forever while having to add a proper\n\"--line-prefix\" eventually anyway.\n"},{"id":"299312","messageId":"CA+P7+xr9RcKQ0uO_F7CtK6nsz83KH0OqpFaBVnzL1jqyP9YfSQ@mail.gmail.com","threadId":"43789","inReplyTo":"xmqqa8gfkpw1.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-08-15T05:32:49Z","receivedAt":"2016-08-15T05:33:18Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Sun, Aug 14, 2016 at 2:21 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jacob Keller <jacob.keller@gmail.com> writes:\n>\n>> On Fri, Aug 12, 2016 at 2:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> On Fri, Aug 12, 2016 at 2:43 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n>>>> Ok so the big problem here is that unlike with diff which has support\n>>>> for line-prefixes already due to needing it for graph mode, I can't\n>>>> figure out where to get the prefix added for log output.\n>>>\n>>> Doesn't the --graph mode show the graph lines already? I think most\n>>> if not all of that processing happens inside log-tree.c::show_log().\n>>\n>> Yes but the problem is how to get this additional prefix to be displayed for\n>>\n>> (a) non graph mode\n>> (b) for graph mode but display the prefix before the graph prefix\n>>\n>> It doesn't seem straight forward, and I haven't figured out how the\n>> graph code already works.\n>\n> Because you only need \"diff --line-prefix\" to work while leaving\n> \"log --line-prefix\" broken for the purpose of your immediate purpose\n> to update \"diff/log [--graph and other options] --submodule=<type>\"\n> to show \"diff A B\" in the submodule, I think it is OK to leave it\n> broken, as long as it is clearly documented that \"--line-prefix\"\n> should also apply to the log message part but the current code\n> doesn't.  Eventually, when somebody wants to add a new <type> that\n> runs \"log -p A..B\" instead of \"diff A B\" in submodules and wants to\n> make it interact well with \"log --graph\" at the superproject level,\n> they need to fix the breakage you leave behind.  That would be much\n> better than \"because I cannot figure out how to prefix on the log\n> part, I'll name this --diff-line-prefix\", which will force us to\n> support that half-baked option forever while having to add a proper\n> \"--line-prefix\" eventually anyway.\n\nI will look more into how to do the log version tomorrow, if I am\nstill stuck I will re-work the patches as you suggest here.\n\nI am hoping I can find a good solution for how to handle it though.\n\nThanks,\nJake\n"},{"id":"299350","messageId":"xmqqwpjihwkz.fsf@gitster.mtv.corp.google.com","threadId":"43789","inReplyTo":"CA+P7+xr9RcKQ0uO_F7CtK6nsz83KH0OqpFaBVnzL1jqyP9YfSQ@mail.gmail.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-15T15:37:48Z","receivedAt":"2016-08-15T15:37:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> I will look more into how to do the log version tomorrow, if I am\n> still stuck I will re-work the patches as you suggest here.\n>\n> I am hoping I can find a good solution for how to handle it though.\n\nThanks, I am hoping the same, too ;-)\n"},{"id":"299425","messageId":"CA+P7+xq7cEjAeW720gtKXm==8rrfOdJu81efJdtEmsXfv7E4Vw@mail.gmail.com","threadId":"43789","inReplyTo":"xmqqwpjihwkz.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v5 2/3] diff: add --diff-line-prefix option for passing in a prefix","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-08-15T23:09:33Z","receivedAt":"2016-08-15T23:10:19Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Mon, Aug 15, 2016 at 8:37 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jacob Keller <jacob.keller@gmail.com> writes:\n>\n>> I will look more into how to do the log version tomorrow, if I am\n>> still stuck I will re-work the patches as you suggest here.\n>>\n>> I am hoping I can find a good solution for how to handle it though.\n>\n> Thanks, I am hoping the same, too ;-)\n\nOk, so I found a way that (ab)uses the graph API to enable line-prefix\nsupport. I moved the way we handle diff prefix into the graph callback\nhandler as well, and I also moved around some code so that the graph\nAPI will work correctly. I found several places that actually broke if\nyou tried calling the graph API with a null graph, because they would\nstill try to access the FILE* pointer inside and could lead to a\nsegfault. This should fix those up as well.\n\nHopefully this is along the lines of what you were thinking, and it\nshould allow more advanced calls to a submodule format that shows the\nfull log if we wanted.\n\nThanks,\nJake\n"}]}