git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/7] making log --first-parent imply -m

From
Sergey Organov <sorganov@gmail.com>
Date
Aug 4, 2020, 17:50 UTC
Message-ID
<874kpi47xj.fsf@osv.gnss.ru>
In-Reply-To
<20200803180824.GA2711830@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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
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
Previous: Sergey OrganovNext: Junio C Hamano
Message 44 of 86 in “making --first-parent imply -m”
  1. 0/3 making --first-parent imply -mJeff King, Jul 28, 2020
  2. 1/3 log: drop "--cc implies -m" logicJeff King, Jul 28, 2020
  3. 2/3 revision: add "--ignore-merges" option to counteract "-m"Jeff King, Jul 28, 2020
  4. Chris TorekJul 28, 2020
  5. Jeff KingJul 29, 2020
  6. Junio C HamanoJul 28, 2020
  7. Jeff KingJul 29, 2020
  8. Jeff KingJul 29, 2020
  9. Junio C HamanoJul 29, 2020
  10. 3/3 log: enable "-m" automatically with "--first-parent"Jeff King, Jul 28, 2020
  11. Jeff KingJul 28, 2020
  12. Junio C HamanoJul 28, 2020
  13. Jeff KingJul 28, 2020
  14. Taylor BlauJul 28, 2020
  15. 0/7 making log --first-parent imply -mJeff King, Jul 29, 2020
  16. 1/7 log: drop "--cc implies -m" logicJeff King, Jul 29, 2020
  17. 2/7 revision: add "--no-diff-merges" option to counteract "-m"Jeff King, Jul 29, 2020
  18. 3/7 log: enable "-m" automatically with "--first-parent"Jeff King, Jul 29, 2020
  19. Junio C HamanoJul 29, 2020
  20. 4/7 doc/git-log: move "Diff Formatting" from rev-list-optionsJeff King, Jul 29, 2020
  21. Junio C HamanoJul 29, 2020
  22. Jeff KingJul 29, 2020
  23. 5/7 doc/git-log: drop "-r" diff optionJeff King, Jul 29, 2020
  24. 6/7 doc/git-log: move "-t" into diff-options listJeff King, Jul 29, 2020
  25. Junio C HamanoJul 29, 2020
  26. Jeff KingJul 29, 2020
  27. 7/7 doc/git-log: clarify handling of merge commit diffsJeff King, Jul 29, 2020
  28. Chris TorekJul 29, 2020
  29. Sergey OrganovJul 29, 2020
  30. Jeff KingJul 31, 2020
  31. Sergey OrganovAug 2, 2020
  32. Junio C HamanoAug 2, 2020
  33. Sergey OrganovAug 3, 2020
  34. Junio C HamanoAug 3, 2020
  35. Sergey OrganovAug 3, 2020
  36. Junio C HamanoAug 3, 2020
  37. Sergey OrganovAug 3, 2020
  38. Jeff KingAug 3, 2020
  39. Sergey OrganovAug 3, 2020
  40. Jeff KingAug 3, 2020
  41. Sergey OrganovAug 3, 2020
  42. Jeff KingAug 3, 2020
  43. Sergey OrganovAug 3, 2020
  44. Sergey OrganovAug 4, 2020
  45. Junio C HamanoAug 4, 2020
  46. Jeff KingAug 4, 2020
  47. Sergey OrganovAug 4, 2020
  48. Jeff KingAug 4, 2020
  49. Junio C HamanoAug 4, 2020
  50. Sergey OrganovAug 4, 2020
  51. Jeff KingAug 4, 2020
  52. Junio C HamanoAug 4, 2020
  53. Jeff KingAug 7, 2020
  54. Sergey OrganovAug 7, 2020
  55. Junio C HamanoAug 7, 2020
  56. Sergey OrganovAug 7, 2020
  57. Junio C HamanoAug 7, 2020
  58. Sergey OrganovAug 7, 2020
  59. Jeff KingAug 7, 2020
  60. Sergey OrganovAug 7, 2020
  61. Junio C HamanoAug 7, 2020
  62. Sergey OrganovAug 7, 2020
  63. Junio C HamanoAug 7, 2020
  64. Sergey OrganovAug 7, 2020
  65. Junio C HamanoAug 7, 2020
  66. Sergey OrganovAug 7, 2020
  67. Sergey OrganovAug 4, 2020
  68. Sergey OrganovAug 4, 2020
  69. Jeff KingAug 4, 2020
  70. Jeff KingAug 4, 2020
  71. Sergey OrganovAug 4, 2020
  72. Jeff KingAug 4, 2020
  73. Sergey OrganovAug 4, 2020
  74. Jeff KingAug 4, 2020
  75. Sergey OrganovAug 4, 2020
  76. Junio C HamanoAug 4, 2020
  77. Sergey OrganovAug 4, 2020
  78. Sergey OrganovAug 4, 2020
  79. Jeff KingAug 4, 2020
  80. revision: fix die() message for "--unpacked="Sergey Organov, Aug 4, 2020
  81. Junio C HamanoAug 5, 2020
  82. Sergey OrganovAug 5, 2020
  83. Junio C HamanoAug 5, 2020
  84. Sergey OrganovAug 5, 2020
  85. Junio C HamanoAug 5, 2020
  86. Sergey OrganovAug 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.