git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Chris Torek <chris.torek@gmail.com>
Subject: Re: [PATCH v2 0/7] making log --first-parent imply -m
Date: Tue, 04 Aug 2020 20:50:16 +0300	[thread overview]
Message-ID: <874kpi47xj.fsf@osv.gnss.ru> (raw)
In-Reply-To: <20200803180824.GA2711830@coredump.intra.peff.net> (Jeff King's message of "Mon, 3 Aug 2020 14:08:24 -0400")

[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

Jeff King <peff@peff.net> writes:

> It's too late for "-m" to change semantics (we could do a long
> deprecation, but I don't see much point in doing so). But --diff-merges
> is definitely still changeable until we release v2.29. My resistance was
> mostly that I didn't want to complicate my series by adding new
> elements. But we could do something on top.

Attached is rather minimal incompatible change to --diff-merges that'd
allow extensions in the future, to get out of urge for the discussed
changes. I'm going to follow-up with actual improvements and I'm aware
it lacks documentation changes.

What do you think, is it OK to have something like this before v2.29?
And, by the way, what's approximate timeline to v2.29?

As for me, I'm not sure 'combined-all-paths' should be included and if
it should, is it a good enough name. In addition, do we need more
descriptive (additional) names for "c" and "cc" modes?

-- Sergey


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-revision-change-diff-merges-option-to-require-parame.patch --]
[-- Type: text/x-patch, Size: 2282 bytes --]

From b75e410797d4576e266d056ece16acf07e4b0116 Mon Sep 17 00:00:00 2001
From: Sergey Organov <sorganov@gmail.com>
Date: Tue, 4 Aug 2020 16:48:27 +0300
Subject: [PATCH RFC] revision: change "--diff-merges" option to require
 parameter

Make --diff-merges require parameter having one of the following values:

  off, all, c, cc, combined-all-paths

that are equivalents of passing the following separate options, respectively:

  --no-diff-merges, -m, -c, -cc, --combined-all-paths

that, except --no-diff-merges, could be deprecated later.

This gives us single option that entirely defines how merge commits are to be
represented.

This patch is a preparation for supporting --diff-merges=<parent>, where
<parent> is parent number to provide diff against, that adds new essential
functionality and therefore is a separate change.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
---
 revision.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/revision.c b/revision.c
index 669bc856694f..dcdff59bc36a 100644
--- a/revision.c
+++ b/revision.c
@@ -2323,10 +2323,31 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->diff = 1;
 		revs->diffopt.flags.recursive = 1;
 		revs->diffopt.flags.tree_in_recursive = 1;
-	} else if (!strcmp(arg, "-m") || !strcmp(arg, "--diff-merges")) {
+	} else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) {
 		revs->ignore_merges = 0;
+		if (!strcmp(optarg, "off")) {
+			revs->ignore_merges = 1;
+		} else if (!strcmp(optarg, "all")) {
+			revs->diff = 0;
+		} else if (!strcmp(optarg, "c")) {
+			revs->diff = 1;
+			revs->dense_combined_merges = 0;
+			revs->combine_merges = 1;
+		} else if (!strcmp(optarg, "cc")) {
+			revs->diff = 1;
+			revs->dense_combined_merges = 1;
+			revs->combine_merges = 1;
+		} else if (!strcmp(optarg, "combined-all-paths")) {
+			revs->diff = 1;
+			revs->combined_all_paths = 1;
+		} else {
+			die("--diff-merges: unknown value '%s'.", optarg);
+		}
+		return argcount;
 	} else if (!strcmp(arg, "--no-diff-merges")) {
 		revs->ignore_merges = 1;
+	} else if (!strcmp(arg, "-m")) {
+		revs->ignore_merges = 0;
 	} else if (!strcmp(arg, "-c")) {
 		revs->diff = 1;
 		revs->dense_combined_merges = 0;
-- 
2.20.1


  parent reply	other threads:[~2020-08-04 17:50 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 16:36 [PATCH 0/3] making " Jeff King
2020-07-28 16:36 ` [PATCH 1/3] log: drop "--cc implies -m" logic Jeff King
2020-07-28 16:38 ` [PATCH 2/3] revision: add "--ignore-merges" option to counteract "-m" Jeff King
2020-07-28 17:52   ` Chris Torek
2020-07-29 18:42     ` Jeff King
2020-07-28 21:01   ` Junio C Hamano
2020-07-29 18:22     ` Jeff King
2020-07-29 18:30       ` Jeff King
2020-07-29 18:53         ` Junio C Hamano
2020-07-28 16:39 ` [PATCH 3/3] log: enable "-m" automatically with "--first-parent" Jeff King
2020-07-28 16:47 ` [PATCH 0/3] making --first-parent imply -m Jeff King
2020-07-28 16:48 ` Junio C Hamano
2020-07-28 16:53   ` Jeff King
2020-07-28 16:55 ` Taylor Blau
2020-07-29 20:10 ` [PATCH v2 0/7] making log " Jeff King
2020-07-29 20:10   ` [PATCH v2 1/7] log: drop "--cc implies -m" logic Jeff King
2020-07-29 20:10   ` [PATCH v2 2/7] revision: add "--no-diff-merges" option to counteract "-m" Jeff King
2020-07-29 20:10   ` [PATCH v2 3/7] log: enable "-m" automatically with "--first-parent" Jeff King
2020-07-29 20:28     ` Junio C Hamano
2020-07-29 20:11   ` [PATCH v2 4/7] doc/git-log: move "Diff Formatting" from rev-list-options Jeff King
2020-07-29 20:56     ` Junio C Hamano
2020-07-29 21:02       ` Jeff King
2020-07-29 20:11   ` [PATCH v2 5/7] doc/git-log: drop "-r" diff option Jeff King
2020-07-29 20:12   ` [PATCH v2 6/7] doc/git-log: move "-t" into diff-options list Jeff King
2020-07-29 21:10     ` Junio C Hamano
2020-07-29 21:55       ` Jeff King
2020-07-29 20:12   ` [PATCH v2 7/7] doc/git-log: clarify handling of merge commit diffs Jeff King
2020-07-29 21:03   ` [PATCH v2 0/7] making log --first-parent imply -m Chris Torek
2020-07-29 21:41   ` Sergey Organov
2020-07-31 23:08     ` Jeff King
2020-08-02 12:59       ` Sergey Organov
2020-08-02 17:35         ` Junio C Hamano
2020-08-03 15:47           ` Sergey Organov
2020-08-03 16:35             ` Junio C Hamano
2020-08-03 16:41               ` Sergey Organov
2020-08-03 17:21                 ` Junio C Hamano
2020-08-03 20:25                   ` Sergey Organov
2020-08-03 20:58                     ` Jeff King
2020-08-03 21:16                       ` Sergey Organov
2020-08-03 18:08             ` Jeff King
2020-08-03 20:00               ` Sergey Organov
2020-08-03 20:55                 ` Jeff King
2020-08-03 21:18                   ` Sergey Organov
2020-08-04 17:50               ` Sergey Organov [this message]
2020-08-04 19:42                 ` Junio C Hamano
2020-08-04 20:00                   ` Jeff King
2020-08-04 20:55                     ` Sergey Organov
2020-08-04 21:22                       ` Jeff King
2020-08-04 21:55                         ` Junio C Hamano
2020-08-04 22:06                           ` Sergey Organov
2020-08-04 22:14                             ` Jeff King
2020-08-04 22:49                               ` Junio C Hamano
2020-08-07  8:26                                 ` Jeff King
2020-08-07  9:25                                   ` Sergey Organov
2020-08-07 17:43                                   ` Junio C Hamano
2020-08-07 17:52                                     ` Sergey Organov
2020-08-07 19:01                                       ` Junio C Hamano
2020-08-07 19:12                                         ` Sergey Organov
2020-08-07 19:20                                           ` Jeff King
2020-08-07 19:28                                             ` Sergey Organov
2020-08-07 19:46                                           ` Junio C Hamano
2020-08-07 20:29                                             ` Sergey Organov
2020-08-07 20:39                                               ` Junio C Hamano
2020-08-07 21:08                                                 ` Sergey Organov
2020-08-07 21:54                                                   ` Junio C Hamano
2020-08-07 23:07                                                     ` Sergey Organov
2020-08-04 22:53                               ` Sergey Organov
2020-08-04 21:21                     ` Sergey Organov
2020-08-04 21:26                       ` Jeff King
2020-08-04 19:58                 ` Jeff King
2020-08-04 20:56                   ` Sergey Organov
2020-08-04 21:25                     ` Jeff King
2020-08-04 21:41                       ` Sergey Organov
2020-08-04 22:07                         ` Jeff King
2020-08-04 22:15                           ` Sergey Organov
2020-08-04 21:27                     ` Junio C Hamano
2020-08-04 21:44                       ` Sergey Organov
2020-08-04 21:58                   ` Sergey Organov
2020-08-04 22:08                     ` Jeff King
2020-08-04 22:26                       ` [PATCH] revision: fix die() message for "--unpacked=" Sergey Organov
2020-08-05  0:03                         ` Junio C Hamano
2020-08-05 15:37                   ` [PATCH v2 0/7] making log --first-parent imply -m Sergey Organov
2020-08-05 16:05                     ` Junio C Hamano
2020-08-05 17:55                       ` Sergey Organov
2020-08-05 19:24                         ` Junio C Hamano
2020-08-05 20:27                           ` Sergey Organov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kpi47xj.fsf@osv.gnss.ru \
    --to=sorganov@gmail.com \
    --cc=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --subject='Re: [PATCH v2 0/7] making log --first-parent imply -m' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).