Thread (56 messages) flat view 56 messages, 7 authors, 2016-06-15

Re: [PATCH 13/13] Build in merge

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:44:52

On Tue, Jul 01, 2008 at 12:44:23AM +0200, Olivier Marin [off-list ref] wrote:
quoted
+	if (new_head && show_diffstat) {
+		struct diff_options opts;
+		diff_setup(&opts);
+		opts.output_format |=
+			DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
+		opts.detect_rename = DIFF_DETECT_RENAME;
+		if (diff_use_color_default > 0)
+			DIFF_OPT_SET(&opts, COLOR_DIFF);
Ah, I missed that. You should call diff_setup_done(), to finish diff_setup()
and have a recursive diffstat.

For example:

$ git checkout -b test c0f5c69
$ git merge 2dce956
Updating c0f5c69..2dce956
Fast forward
 help.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

is wrong. Correct diffstat is:

$ git diff --stat c0f5c69..2dce956
 Documentation/gitcli.txt        |   37 +++++++++++++++++++++++++++++++++----
 Documentation/gittutorial-2.txt |   10 +++++-----
 help.c                          |   22 ++++++++++++++--------
 t/test-lib.sh                   |    2 +-
 4 files changed, 53 insertions(+), 18 deletions(-)
Fixed in my working branch.
quoted
+	git_config(git_merge_config, NULL);
+
+	/* for color.diff and diff.color */
+	git_config(git_diff_ui_config, NULL);
Also, what about doing "return git_diff_ui_config(k, v, cb)" at the end of
git_merge_config() instead, to avoid parsing config files twice.
Sure, changed.

Thanks! :)

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help