git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/3] Showing merges easier with "git log"
@ 2015-08-20 22:43 Junio C Hamano
  2015-08-20 22:43 ` [PATCH 1/3] log: rename "tweak" helpers Junio C Hamano
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-20 22:43 UTC (permalink / raw)
  To: git

This is a combination of two closely related topics.

 - The second patch is my long-time pet peeve (it is even on the
   leftover-bits list at git-blame blog).  When inspecting a branch,
   I often type "git log --first-parent --cc master..", and then
   realize that I need to give "-p" to actually view the condensed
   patch.  We do the same for "log -c" (combined but not desified
   form).

 - The third one is about "git log --cc master..", with which the
   user is clearly telling us that s/he wants to see interesting
   changes for both single-parent commits and for merges (otherwise
   s/he wouldn't be saying "--cc" in the first place).  Even with
   the second one that makes "--cc" imply "-p" unless another patch
   output format (e.g. "--raw") was asked, you'd need "-m", which
   was irritating.

The latter was inspired by a recent discussion, most notably

   http://thread.gmane.org/gmane.comp.version-control.git/273937/focus=273988

but implements it with a much less UI impact.  Tweaking "git log -p"
has a lot of fallout---interested parties can try it out and how two
tests in t4xxx series break.  Doing this for "log --cc" is
conceptually cleaner, as "-p" does not tell us what the user wants
to see for merges (nothing?  first-parent diff?  pairwise diff?
combined?), but "--cc" is a clear indication that dense combined
patch is desired.

Note that this conflicts with 'tr/remerge-diff' topic that has been
stalled on 'pu' for quite some time.  I'll tentatively drop that
other topic before pushing out today's integration result.  People
who are interested in that topic may want to help resurrect and
reroll it.  Hint, hint...

Junio C Hamano (3):
  log: rename "tweak" helpers
  log: when --cc is given, default to -p unless told otherwise
  log: show merge commit when --cc is given

 builtin/log.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

-- 
2.5.0-546-gb1bbc0d

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] log: rename "tweak" helpers
  2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
@ 2015-08-20 22:43 ` Junio C Hamano
  2015-08-20 22:43 ` [PATCH 2/3] log: when --cc is given, default to -p unless told otherwise Junio C Hamano
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-20 22:43 UTC (permalink / raw)
  To: git

The revision walking API allows the callers to tweak its
configuration at the last minute, immediately after all the revision
and pathspec parameters are parsed from the command line but before
the default actions are decided based on them, by defining a "tweak"
callback function when calling setup_revisions().  Traditionally,
this facility was used by "git show" to turn on the patch output
"-p" by default when no diff output option (e.g.  "--raw" or "-s" to
squelch the output altogether) is given on the command line, and
further give dense combined diffs "--cc" for merge commits when no
option to countermand it (e.g. "-m" to show pairwise patches).

Recently, "git log" started using the same facility, but we named
the callback function "default_follow_tweak()", as if the only kind
of tweaking we would want for "git log" will forever be limited to
turning "--follow" on by default when told by a configuration
variable.  That was myopic.

Rename it to more generic name "log_setup_revisions_tweak()", and
match the one used by show "show_setup_revisions_tweak()".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/log.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index b50ef75..8651105 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -504,7 +504,8 @@ static int show_tree_object(const unsigned char *sha1,
 	return 0;
 }
 
-static void show_rev_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
+static void show_setup_revisions_tweak(struct rev_info *rev,
+				       struct setup_revision_opt *opt)
 {
 	if (rev->ignore_merges) {
 		/* There was no "-m" on the command line */
@@ -539,7 +540,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 
 	memset(&opt, 0, sizeof(opt));
 	opt.def = "HEAD";
-	opt.tweak = show_rev_tweak_rev;
+	opt.tweak = show_setup_revisions_tweak;
 	cmd_log_init(argc, argv, prefix, &rev, &opt);
 
 	if (!rev.no_walk)
@@ -626,8 +627,8 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
 	return cmd_log_walk(&rev);
 }
 
-static void default_follow_tweak(struct rev_info *rev,
-				 struct setup_revision_opt *opt)
+static void log_setup_revisions_tweak(struct rev_info *rev,
+				      struct setup_revision_opt *opt)
 {
 	if (DIFF_OPT_TST(&rev->diffopt, DEFAULT_FOLLOW_RENAMES) &&
 	    rev->prune_data.nr == 1)
@@ -647,7 +648,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)
 	memset(&opt, 0, sizeof(opt));
 	opt.def = "HEAD";
 	opt.revarg_opt = REVARG_COMMITTISH;
-	opt.tweak = default_follow_tweak;
+	opt.tweak = log_setup_revisions_tweak;
 	cmd_log_init(argc, argv, prefix, &rev, &opt);
 	return cmd_log_walk(&rev);
 }
-- 
2.5.0-546-gb1bbc0d

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] log: when --cc is given, default to -p unless told otherwise
  2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
  2015-08-20 22:43 ` [PATCH 1/3] log: rename "tweak" helpers Junio C Hamano
@ 2015-08-20 22:43 ` Junio C Hamano
  2015-08-20 22:43 ` [PATCH 3/3] log: show merge commit when --cc is given Junio C Hamano
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-20 22:43 UTC (permalink / raw)
  To: git

The "--cc" option to "git log" is clearly a request to show some
sort of combined diff (be it --patch or --raw), but traditionally
we required the command line to explicitly ask for "git log -p --cc".

Teach the command line parser to treat a lone "--cc" as if the user
specified "-p --cc".  Formats that do ask for other forms of diff
output, e.g. "log --raw --cc", are not overriden.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/log.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/builtin/log.c b/builtin/log.c
index 8651105..e37c27a 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -633,6 +633,10 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
 	if (DIFF_OPT_TST(&rev->diffopt, DEFAULT_FOLLOW_RENAMES) &&
 	    rev->prune_data.nr == 1)
 		DIFF_OPT_SET(&rev->diffopt, FOLLOW_RENAMES);
+
+	/* Turn --cc/-c into -p --cc/-c when -p was not given */
+	if (!rev->diffopt.output_format && rev->combine_merges)
+		rev->diffopt.output_format = DIFF_FORMAT_PATCH;
 }
 
 int cmd_log(int argc, const char **argv, const char *prefix)
-- 
2.5.0-546-gb1bbc0d

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] log: show merge commit when --cc is given
  2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
  2015-08-20 22:43 ` [PATCH 1/3] log: rename "tweak" helpers Junio C Hamano
  2015-08-20 22:43 ` [PATCH 2/3] log: when --cc is given, default to -p unless told otherwise Junio C Hamano
@ 2015-08-20 22:43 ` Junio C Hamano
  2015-08-21 18:03 ` [PATCH 4/3] builtin/log.c: minor reformat Junio C Hamano
  2015-08-21 21:40 ` [PATCH 3z/3] log: make '-p' imply '-m --cc' Junio C Hamano
  4 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-20 22:43 UTC (permalink / raw)
  To: git

We defaulted to ignoring merge diffs because long long ago, in a
galaxy far away, we didn't have a great way to show the diffs.  The
whole "--cc" option goes back to January '06 and commit d8f4790e6fe7
("diff-tree --cc: denser combined diff output for a merge commit").
And before that option - so for about 8 months - we had no good way
to show the diffs of merges in a good dense way.  So the whole
"don't show diffs for merges by default" actually made a lot of
sense originally, because our merge diffs were not very useful.

And this was carried forward to this day.  "git log --cc" still
ignores merge commits, and you need to say "git log -m --cc" to view
a sensible rendition of merge and non-merge commits, even with the
previous change to make "--cc" imply "-p".

Teach "git log" that "--cc" means the user wants to see interesting
changes in merge commits by turning "-m" on.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/log.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/builtin/log.c b/builtin/log.c
index e37c27a..0cdd889 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -637,6 +637,10 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
 	/* Turn --cc/-c into -p --cc/-c when -p was not given */
 	if (!rev->diffopt.output_format && rev->combine_merges)
 		rev->diffopt.output_format = DIFF_FORMAT_PATCH;
+
+	/* Turn -m on when --cc/-c was given */
+	if (rev->combine_merges)
+		rev->ignore_merges = 0;
 }
 
 int cmd_log(int argc, const char **argv, const char *prefix)
-- 
2.5.0-546-gb1bbc0d

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/3] builtin/log.c: minor reformat
  2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
                   ` (2 preceding siblings ...)
  2015-08-20 22:43 ` [PATCH 3/3] log: show merge commit when --cc is given Junio C Hamano
@ 2015-08-21 18:03 ` Junio C Hamano
  2015-08-21 21:40 ` [PATCH 3z/3] log: make '-p' imply '-m --cc' Junio C Hamano
  4 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-21 18:03 UTC (permalink / raw)
  To: git

Two logical lines that were not overly long was split in the middle,
which made them read worse.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/log.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index 0cdd889..a491d3d 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -342,8 +342,7 @@ static int cmd_log_walk(struct rev_info *rev)
 	 * retain that state information if replacing rev->diffopt in this loop
 	 */
 	while ((commit = get_revision(rev)) != NULL) {
-		if (!log_tree_commit(rev, commit) &&
-		    rev->max_count >= 0)
+		if (!log_tree_commit(rev, commit) && rev->max_count >= 0)
 			/*
 			 * We decremented max_count in get_revision,
 			 * but we didn't actually show the commit.
@@ -1464,8 +1463,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (ignore_if_in_upstream &&
-				has_commit_patch_id(commit, &ids))
+		if (ignore_if_in_upstream && has_commit_patch_id(commit, &ids))
 			continue;
 
 		nr++;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3z/3] log: make '-p' imply '-m --cc'
  2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
                   ` (3 preceding siblings ...)
  2015-08-21 18:03 ` [PATCH 4/3] builtin/log.c: minor reformat Junio C Hamano
@ 2015-08-21 21:40 ` Junio C Hamano
  4 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-08-21 21:40 UTC (permalink / raw)
  To: git

Junio C Hamano <gitster@pobox.com> writes:

> The latter was inspired by a recent discussion, most notably
>
>    http://thread.gmane.org/gmane.comp.version-control.git/273937/focus=273988
>
> but implements it with a much less UI impact.  Tweaking "git log -p"
> has a lot of fallout---interested parties can try it out and how two
> tests in t4xxx series break.

Just for the record, here is what I did before deciding that the
idea of turning '-p' into '--cc -m' is not good and instead did the
"'--cc' should show the patch without '-p' and '-m'" that is the
real [3/3].  The attached patch replaces 3/3, showss what happens if
you tweak 'log -p' to imply '-m --cc'"; the change of behaviours is
illustrated by the updated tests.

Many are good-looking, and some others are questionable.

 * "log -G<string> -p" and "log -S<string> -p" that silently turns
   "-p" into "-m --cc" shows merges that changed the occurrences of
   <string>, but if the merge is a trivial textual merge, the change
   itself is not seen (as we are doing "--cc").  This looks very
   questionable.

 * Similarly, "log -p --stat" shows the diffstat against the first
   parent for a merge but does not show the patch text, as "--cc" is
   in effect, for a trivial textual merge.  This looks strange.

 * Even though I very much do like the fact that we see _something_
   in the output for a merge commit, "log --patch-with-stat" that
   outputs a "patch" that cannot be grokked by "git apply" feels
   wrong.

All of the above led me to say "when the user explicitly asks --cc,
show the merges that way, otherwise keeping the 'merges are by
default ignored' is the right thing".


diff --git a/builtin/log.c b/builtin/log.c
index 519f170..1a77804 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -633,6 +633,14 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
 	    rev->prune_data.nr == 1)
 		DIFF_OPT_SET(&rev->diffopt, FOLLOW_RENAMES);
 
+	/* Turn -p without -m to --cc -p -m */
+	if (rev->ignore_merges && !rev->combine_merges &&
+	    (rev->diffopt.output_format & DIFF_FORMAT_PATCH)) {
+		rev->ignore_merges = 0;
+		rev->combine_merges = 1;
+		rev->dense_combined_merges = 1;
+	}
+
 	/* Turn --cc/-c into -p --cc/-c when -p was not given */
 	if (!rev->diffopt.output_format && rev->combine_merges)
 		rev->diffopt.output_format = DIFF_FORMAT_PATCH;
diff --git a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
index a18f147..04f4eee 100644
--- a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
+++ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
@@ -6,6 +6,23 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+ dir/sub | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_--patch-with-stat_master b/t/t4013/diff.log_--patch-with-stat_master
index ae425c4..ec4b1b9 100644
--- a/t/t4013/diff.log_--patch-with-stat_master
+++ b/t/t4013/diff.log_--patch-with-stat_master
@@ -6,6 +6,38 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+ dir/sub | 2 ++
+ file0   | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_--patch-with-stat_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_
index d5207ca..d3be9a2 100644
--- a/t/t4013/diff.log_--patch-with-stat_master_--_dir_
+++ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_
@@ -6,6 +6,23 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+ dir/sub | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
index dffc09d..a6aa60a 100644
--- a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
+++ b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master
@@ -6,6 +6,38 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+ dir/sub | 2 ++
+ file0   | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_--root_--patch-with-stat_master b/t/t4013/diff.log_--root_--patch-with-stat_master
index 55aa980..4d0ff3d 100644
--- a/t/t4013/diff.log_--root_--patch-with-stat_master
+++ b/t/t4013/diff.log_--root_--patch-with-stat_master
@@ -6,6 +6,38 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+ dir/sub | 2 ++
+ file0   | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_--root_-p_master b/t/t4013/diff.log_--root_-p_master
index b42c334..19dfc00 100644
--- a/t/t4013/diff.log_--root_-p_master
+++ b/t/t4013/diff.log_--root_-p_master
@@ -6,6 +6,34 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4013/diff.log_-GF_-p_--pickaxe-all_master b/t/t4013/diff.log_-GF_-p_--pickaxe-all_master
index d36f880..4b6b93a 100644
--- a/t/t4013/diff.log_-GF_-p_--pickaxe-all_master
+++ b/t/t4013/diff.log_-GF_-p_--pickaxe-all_master
@@ -1,4 +1,12 @@
 $ git log -GF -p --pickaxe-all master
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:04:00 2006 +0000
+
+    Merge branch 'side'
+
+
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:02:00 2006 +0000
diff --git a/t/t4013/diff.log_-GF_-p_master b/t/t4013/diff.log_-GF_-p_master
index 9d93f2c..a712a5a 100644
--- a/t/t4013/diff.log_-GF_-p_master
+++ b/t/t4013/diff.log_-GF_-p_master
@@ -1,4 +1,12 @@
 $ git log -GF -p master
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:04:00 2006 +0000
+
+    Merge branch 'side'
+
+
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:02:00 2006 +0000
diff --git a/t/t4013/diff.log_-SF_-p_master b/t/t4013/diff.log_-SF_-p_master
index 5e32438..56c0d52 100644
--- a/t/t4013/diff.log_-SF_-p_master
+++ b/t/t4013/diff.log_-SF_-p_master
@@ -1,4 +1,12 @@
 $ git log -SF -p master
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:04:00 2006 +0000
+
+    Merge branch 'side'
+
+
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:02:00 2006 +0000
diff --git a/t/t4013/diff.log_-p_--first-parent_master b/t/t4013/diff.log_-p_--first-parent_master
index 3fc896d..f5af0c6 100644
--- a/t/t4013/diff.log_-p_--first-parent_master
+++ b/t/t4013/diff.log_-p_--first-parent_master
@@ -6,6 +6,34 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:02:00 2006 +0000
diff --git a/t/t4013/diff.log_-p_master b/t/t4013/diff.log_-p_master
index bf1326d..506947be 100644
--- a/t/t4013/diff.log_-p_master
+++ b/t/t4013/diff.log_-p_master
@@ -6,6 +6,34 @@ Date:   Mon Jun 26 00:04:00 2006 +0000
 
     Merge branch 'side'
 
+diff --cc dir/sub
+index cead32e,7289e35..992913c
+--- a/dir/sub
++++ b/dir/sub
+@@@ -1,6 -1,4 +1,8 @@@
+  A
+  B
+ +C
+ +D
+ +E
+ +F
++ 1
++ 2
+diff --cc file0
+index b414108,f4615da..10a8a9f
+--- a/file0
++++ b/file0
+@@@ -1,6 -1,6 +1,9 @@@
+  1
+  2
+  3
+ +4
+ +5
+ +6
++ A
++ B
++ C
+
 commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:03:00 2006 +0000
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 35d2d7c..e950092 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -570,6 +570,9 @@ cat >expect <<\EOF
 | |
 | |     Merge HEADS DESCRIPTION
 | |
+| |  reach.t | 1 +
+| |  1 file changed, 1 insertion(+)
+| |
 | * commit COMMIT_OBJECT_NAME
 | | Author: A U Thor <author@example.com>
 | |
@@ -593,6 +596,10 @@ cat >expect <<\EOF
 | | | |
 | | | |     Merge HEADS DESCRIPTION
 | | | |
+| | | |  octopus-a.t | 1 +
+| | | |  octopus-b.t | 1 +
+| | | |  2 files changed, 2 insertions(+)
+| | | |
 | | * | commit COMMIT_OBJECT_NAME
 | | |/  Author: A U Thor <author@example.com>
 | | |
@@ -647,18 +654,30 @@ cat >expect <<\EOF
 | |
 | |     Merge branch 'tangle'
 | |
+| |  tangle-a | 1 +
+| |  1 file changed, 1 insertion(+)
+| |
 | *   commit COMMIT_OBJECT_NAME
 | |\  Merge: MERGE_PARENTS
 | | | Author: A U Thor <author@example.com>
 | | |
 | | |     Merge branch 'side' (early part) into tangle
 | | |
+| | |  1 | 1 +
+| | |  1 file changed, 1 insertion(+)
+| | |
 | * |   commit COMMIT_OBJECT_NAME
 | |\ \  Merge: MERGE_PARENTS
 | | | | Author: A U Thor <author@example.com>
 | | | |
 | | | |     Merge branch 'master' (early part) into tangle
 | | | |
+| | | |  a/two | 1 +
+| | | |  ein   | 1 +
+| | | |  ichi  | 1 +
+| | | |  one   | 1 -
+| | | |  4 files changed, 3 insertions(+), 1 deletion(-)
+| | | |
 | * | | commit COMMIT_OBJECT_NAME
 | | | | Author: A U Thor <author@example.com>
 | | | |
@@ -681,6 +700,10 @@ cat >expect <<\EOF
 | | | | |
 | | | | |     Merge branch 'side'
 | | | | |
+| | | | |  1 | 1 +
+| | | | |  2 | 1 +
+| | | | |  2 files changed, 2 insertions(+)
+| | | | |
 | * | | | commit COMMIT_OBJECT_NAME
 | | |_|/  Author: A U Thor <author@example.com>
 | |/| |

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-21 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 22:43 [PATCH 0/3] Showing merges easier with "git log" Junio C Hamano
2015-08-20 22:43 ` [PATCH 1/3] log: rename "tweak" helpers Junio C Hamano
2015-08-20 22:43 ` [PATCH 2/3] log: when --cc is given, default to -p unless told otherwise Junio C Hamano
2015-08-20 22:43 ` [PATCH 3/3] log: show merge commit when --cc is given Junio C Hamano
2015-08-21 18:03 ` [PATCH 4/3] builtin/log.c: minor reformat Junio C Hamano
2015-08-21 21:40 ` [PATCH 3z/3] log: make '-p' imply '-m --cc' Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).