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

Re: [PATCH v3 03/15] merge-tree: add option parsing and initial shell for real merge function

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 3, 2022, 17:15 UTC
Message-ID
<220203.86bkzn6ea8.gmgdl@evledraar.gmail.com>
In-Reply-To
<CABPp-BF8VoQ7F7yvfzrpQEZwErxHzb9x8M_R9PrrM7vWzw=wSw@mail.gmail.com>
On Thu, Feb 03 2022, Elijah Newren wrote:
Show 40 quoted lines
> On Thu, Feb 3, 2022 at 1:52 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>>
>> On Thu, Feb 03 2022, Elijah Newren wrote:
>>
> [...]
>> > ...also, even if we did require the `--write-tree` flag, we'd still
>> > have to look at argc.  Since the option parsing handles both modes,
>> > someone could leave off --write-tree, but include a bunch of other
>> > options that only make sense with --write-tree.  Individually checking
>> > the setting of every extra flag along with write_tree is a royal pain
>> > and I don't want to repeat that for each new option added.  Simply
>> > checking argc allows you to provide an error message if the user does
>> > that.
>> >
>> > (And I think it's sad that in Git we often forgot to warn and notify
>> > users of options that are only functional with certain other
>> > arguments; it makes it harder for users to figure out, and has in the
>> > past even made it harder for other developers to figure out what was
>> > meant and how things are to be used.  I think I've seen multiple Git
>> > devs be confused over ls-files --directory and --no-empty-directory
>> > options, assuming they'd do something sensible for tracked files, when
>> > in fact those arguments are simply ignored because they are only
>> > modifiers for how untracked files are treated.)
>>
>> There's a much simpler way to do what you're trying to do here which is
>> to only parse --write-tree, and as soon as you have that pass off two
>> one function or the other, and have those functions call
>> parse_options().
>
> But that makes --write-tree a mandatory argument when trying to use
> that mode, right?  If so, that is not a simpler way to do what I'm
> trying to do at all; it breaks my intended usage.
>
> --write-tree is a documentation-only construct that users should never
> have to pass.
>
> Also, what happens if we remove the --trivial-merge flag and its whole
> mode after a sufficient deprecation period?  Would the --write-tree
> parameter remain required in your model to select the only existing
> mode, simply due to us having gone through a transition period?

You can have your cake and eat it too by running parse_optionss() N number of times. Although perhaps in this case the end result isn't worth it.

I was hoping this could be a simpler case of a subcommand dispatch, and perhaps it can still be generalized to that.

If the "trivial" mode never takes options and always 3 argv elements, we could just run parse_options() for it with no options, after checking that we have 3 arguments, and none start with '-'.

But the below is a generalization of this I tried out just now, it passes all your tests, and means that whenever you add new options you don't need to keep saying "no, not with the trivial mode" for each one.

Basically we run parse_options() once with the full set of options, and save away argc/argv (note the lack of strvec_clear() there, that's a TODO memory leak).

Then we've got a o.mode, which along with argc is the *only* thing we pay attention to at that point.

Then we dispatch to the "trivial" or "write" functions, which do parse_options() again, this time with only their options.

It means that e.g. this now works as expected:
    
    ./git merge-tree --trivial-merge -z origin/{master,next,seen}
    error: unknown switch `z'
    usage: git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>
    
        --trivial-merge       do a trivial merge only
I.e. we error out, with your verison we'll just ignore the -z.

Your "--trivial-merge is incompatible with all other options" doesn't work as you expect, and is buggy whether you want to go this route or not, as the added tests show.

Basically it does nothing at all. Because if you add --foo we'll die before we get there, parse_options() will die for us.

But if you do --trivial-merge -z your argc/argv will be trimmed, because
-z is a known option. So your check is doing nothing. Your tests also
pass with this removal of the only option compatibily check on top:
	
	diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
	index 58c0ddc5a32..08f18d43334 100644
	--- a/builtin/merge-tree.c
	+++ b/builtin/merge-tree.c
	@@ -476,7 +476,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
	 {
	 	struct merge_tree_options o = { .show_messages = -1 };
	 	int expected_remaining_argc;
	-	int original_argc;
	 
	 	const char * const merge_tree_usage[] = {
	 		N_("git merge-tree [--write-tree] [<options>] <branch1> <branch2>"),
	@@ -505,7 +504,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
	 	};
	 
	 	/* Parse arguments */
	-	original_argc = argc;
	 	argc = parse_options(argc, argv, prefix, mt_options,
	 			     merge_tree_usage, PARSE_OPT_STOP_AT_NON_OPTION);
	 	if (o.mode) {
	@@ -517,8 +515,6 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
	 			usage_with_options(merge_tree_usage, mt_options);
	 		o.mode = (argc == 2 ? 'w' : 't');
	 	}
	-	if (o.mode == 't' && original_argc < argc)
	-		die(_("--trivial-merge is incompatible with all other options"));
	 
	 	/* Do the relevant type of merge */
	 	if (o.mode == 'w')

So, here it is in all its glory :) A bit nasty for sure, but IMO preferrable to an ever expanding list of "X isn't compatible with A".

diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 58c0ddc5a32..1d47912816d 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -12,6 +12,7 @@
 #include "exec-cmd.h"
 #include "merge-blobs.h"
 #include "quote.h"
+#include "strvec.h"
 
 static int line_termination = '\n';
 
@@ -371,13 +372,66 @@ static void *get_tree_descriptor(struct repository *r,
 	return buf;
 }
 
-static int trivial_merge(const char *base,
-			 const char *branch1,
-			 const char *branch2)
+struct merge_tree_options {
+	int mode;
+	int allow_unrelated_histories;
+	int show_messages;
+	int exclude_modes_oids_stages;
+};
+
+#define BUILTIN_MERGE_TREE_USAGE_WRITE \
+		N_("git merge-tree [--write-tree] [<options>] <branch1> <branch2>")
+#define BUILTIN_MERGE_TREE_USAGE_TRIVIAL \
+		N_("git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>")
+
+#define BUILTIN_MERGE_TREE_OPT_CMDMODE_TRIVIAL \
+		OPT_CMDMODE(0, "trivial-merge", &o.mode, \
+			    N_("do a trivial merge only"), 't')
+
+#define BUILTIN_MERGE_TREE_OPT_CMDMODE_WRITE \
+		OPT_CMDMODE(0, "write-tree", &o.mode, \
+			    N_("do a real merge instead of a trivial merge"), \
+			    'w')
+
+#define BUILTIN_MERGE_TREE_OPT_WRITE \
+		BUILTIN_MERGE_TREE_OPT_CMDMODE_WRITE, \
+		OPT_BOOL(0, "messages", &o.show_messages, \
+			 N_("also show informational/conflict messages")), \
+		OPT_SET_INT('z', NULL, &line_termination, \
+			    N_("separate paths with the NUL character"), '\0'), \
+		OPT_BOOL_F('l', "exclude-modes-oids-stages", \
+			   &o.exclude_modes_oids_stages, \
+			   N_("list conflicted files without modes/oids/stages"), \
+			   PARSE_OPT_NONEG), \
+		OPT_BOOL_F(0, "allow-unrelated-histories", \
+			   &o.allow_unrelated_histories, \
+			   N_("allow merging unrelated histories"), \
+			   PARSE_OPT_NONEG)
+
+static int trivial_merge(int argc, const char **argv, const char *prefix)
 {
 	struct repository *r = the_repository;
 	struct tree_desc t[3];
 	void *buf1, *buf2, *buf3;
+	struct merge_tree_options o = { 0 };
+	const char * const usage[] = {
+		BUILTIN_MERGE_TREE_USAGE_TRIVIAL,
+		NULL,
+	};
+	struct option options[] = {
+		BUILTIN_MERGE_TREE_OPT_CMDMODE_TRIVIAL,
+		OPT_END()
+	};
+	const char *base, *branch1, *branch2;
+
+	argc = parse_options(argc, argv, prefix, options, usage,
+			     PARSE_OPT_STOP_AT_NON_OPTION);
+	if (argc != 3)
+		BUG("should have ensured remaining argc == 3 already! Got %d", argc);
+
+	base = argv[0];
+	branch1 = argv[1];
+	branch2 = argv[2];;
 
 	buf1 = get_tree_descriptor(r, t+0, base);
 	buf2 = get_tree_descriptor(r, t+1, branch1);
@@ -391,24 +445,34 @@ static int trivial_merge(const char *base,
 	return 0;
 }
 
-struct merge_tree_options {
-	int mode;
-	int allow_unrelated_histories;
-	int show_messages;
-	int exclude_modes_oids_stages;
-};
-
-static int real_merge(struct merge_tree_options *o,
-		      const char *branch1, const char *branch2,
-		      const char *prefix)
+static int real_merge(int argc, const char **argv, const char *prefix)
 {
 	struct commit *parent1, *parent2;
 	struct commit_list *common;
 	struct commit_list *merge_bases = NULL;
 	struct commit_list *j;
+	struct merge_tree_options o = { .show_messages = 1 };
 	struct merge_options opt;
 	struct merge_result result = { 0 };
 
+	const char * const usage[] = {
+		BUILTIN_MERGE_TREE_USAGE_WRITE,
+		NULL,
+	};
+	struct option options[] = {
+		BUILTIN_MERGE_TREE_OPT_CMDMODE_WRITE,
+		BUILTIN_MERGE_TREE_OPT_WRITE,
+		OPT_END()
+	};
+	const char *branch1, *branch2;
+
+	argc = parse_options(argc, argv, prefix, options, usage,
+			     PARSE_OPT_STOP_AT_NON_OPTION);
+	if (argc != 2)
+		BUG("should have ensured remaining argc == 2 already! Got %d", argc);
+	branch1 = argv[0];
+	branch2 = argv[1];
+
 	parent1 = get_merge_parent(branch1);
 	if (!parent1)
 		help_unknown_ref(branch1, "merge-tree",
@@ -431,7 +495,7 @@ static int real_merge(struct merge_tree_options *o,
 	 * merge_incore_recursive in merge-ort.h
 	 */
 	common = get_merge_bases(parent1, parent2);
-	if (!common && !o->allow_unrelated_histories)
+	if (!common && !o.allow_unrelated_histories)
 		die(_("refusing to merge unrelated histories"));
 	for (j = common; j; j = j->next)
 		commit_list_insert(j->item, &merge_bases);
@@ -440,8 +504,8 @@ static int real_merge(struct merge_tree_options *o,
 	if (result.clean < 0)
 		die(_("failure to merge"));
 
-	if (o->show_messages == -1)
-		o->show_messages = !result.clean;
+	if (o.show_messages == -1)
+		o.show_messages = !result.clean;
 
 	puts(oid_to_hex(&result.tree->object.oid));
 	if (!result.clean) {
@@ -453,7 +517,7 @@ static int real_merge(struct merge_tree_options *o,
 		for (i = 0; i < conflicted_files.nr; i++) {
 			const char *name = conflicted_files.items[i].string;
 			struct stage_info *c = conflicted_files.items[i].util;
-			if (!o->exclude_modes_oids_stages)
+			if (!o.exclude_modes_oids_stages)
 				printf("%06o %s %d\t",
 				       c->mode, oid_to_hex(&c->oid), c->stage);
 			else if (last && !strcmp(last, name))
@@ -464,7 +528,7 @@ static int real_merge(struct merge_tree_options *o,
 		}
 		string_list_clear(&conflicted_files, 1);
 	}
-	if (o->show_messages) {
+	if (o.show_messages) {
 		putchar(line_termination);
 		merge_display_update_messages(&opt, &result, stdout);
 	}
@@ -474,40 +538,32 @@ static int real_merge(struct merge_tree_options *o,
 
 int cmd_merge_tree(int argc, const char **argv, const char *prefix)
 {
-	struct merge_tree_options o = { .show_messages = -1 };
+	struct merge_tree_options o;
 	int expected_remaining_argc;
-	int original_argc;
-
+	int original_argc = argc;
+	struct strvec original_args = STRVEC_INIT;
 	const char * const merge_tree_usage[] = {
-		N_("git merge-tree [--write-tree] [<options>] <branch1> <branch2>"),
-		N_("git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"),
+		BUILTIN_MERGE_TREE_USAGE_WRITE,
+		BUILTIN_MERGE_TREE_USAGE_TRIVIAL,
 		NULL
 	};
 	struct option mt_options[] = {
-		OPT_CMDMODE(0, "write-tree", &o.mode,
-			    N_("do a real merge instead of a trivial merge"),
-			    'w'),
-		OPT_CMDMODE(0, "trivial-merge", &o.mode,
-			    N_("do a trivial merge only"), 't'),
-		OPT_BOOL(0, "messages", &o.show_messages,
-			 N_("also show informational/conflict messages")),
-		OPT_SET_INT('z', NULL, &line_termination,
-			    N_("separate paths with the NUL character"), '\0'),
-		OPT_BOOL_F('l', "exclude-modes-oids-stages",
-			   &o.exclude_modes_oids_stages,
-			   N_("list conflicted files without modes/oids/stages"),
-			   PARSE_OPT_NONEG),
-		OPT_BOOL_F(0, "allow-unrelated-histories",
-			   &o.allow_unrelated_histories,
-			   N_("allow merging unrelated histories"),
-			   PARSE_OPT_NONEG),
+		BUILTIN_MERGE_TREE_OPT_CMDMODE_TRIVIAL,
+		BUILTIN_MERGE_TREE_OPT_CMDMODE_WRITE,
+		BUILTIN_MERGE_TREE_OPT_WRITE,
 		OPT_END()
 	};
 
+	/* We only care about deciding "o.mode" here */
+	o.mode = 0;
+	/*
+	 * We need our original argv, and
+	 * PARSE_OPT_KEEP_{ARGV0,UNKNOWN} would do the wrong thing
+	 */
+	strvec_pushv(&original_args, argv);
 	/* Parse arguments */
-	original_argc = argc;
 	argc = parse_options(argc, argv, prefix, mt_options,
-			     merge_tree_usage, PARSE_OPT_STOP_AT_NON_OPTION);
+			     merge_tree_usage, 0);
 	if (o.mode) {
 		expected_remaining_argc = (o.mode == 'w' ? 2 : 3);
 		if (argc != expected_remaining_argc)
@@ -517,12 +573,10 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
 			usage_with_options(merge_tree_usage, mt_options);
 		o.mode = (argc == 2 ? 'w' : 't');
 	}
-	if (o.mode == 't' && original_argc < argc)
-		die(_("--trivial-merge is incompatible with all other options"));
 
 	/* Do the relevant type of merge */
 	if (o.mode == 'w')
-		return real_merge(&o, argv[0], argv[1], prefix);
+		return real_merge(original_argc, original_args.v, prefix);
 	else
-		return trivial_merge(argv[0], argv[1], argv[2]);
+		return trivial_merge(original_argc, original_args.v, prefix);
 }
diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh
index 4de089d976d..749bdb6862d 100755
--- a/t/t4301-merge-tree-write-tree.sh
+++ b/t/t4301-merge-tree-write-tree.sh
@@ -92,6 +92,18 @@ test_expect_success 'Barf on too many arguments' '
 	grep "^usage: git merge-tree" expect
 '
 
+for opt in $(git merge-tree --git-completion-helper-all)
+do
+	if test $opt = "--trivial-merge" || test $opt = "--write-tree"
+	then
+		continue
+	fi
+
+	test_expect_success "usage: --trivial-merge is incompatible with $opt" '
+		test_expect_code 129 git merge-tree --trivial-merge $opt side1 side2 side3
+	'
+done
+
 test_expect_success 'test conflict notices and such' '
 	test_expect_code 1 git merge-tree --write-tree --exclude-modes-oids-stages side1 side2 >out &&
 	sed -e "s/[0-9a-f]\{40,\}/HASH/g" out >actual &&
Previous: Elijah NewrenNext: Elijah Newren
Message 122 of 240 in “RFC: In-core git merge-tree ("Server side merges")”
  1. 00/12 RFC: In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Jan 22, 2022
  2. 01/12 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Jan 22, 2022
  3. 02/12 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Jan 22, 2022
  4. 03/12 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Jan 22, 2022
  5. René ScharfeJan 23, 2022
  6. Elijah NewrenJan 24, 2022
  7. Ævar Arnfjörð BjarmasonJan 24, 2022
  8. Elijah NewrenJan 24, 2022
  9. 04/12 merge-tree: implement real mergesElijah Newren via GitGitGadget, Jan 22, 2022
  10. Ævar Arnfjörð BjarmasonJan 24, 2022
  11. Elijah NewrenJan 24, 2022
  12. Johannes SchindelinJan 25, 2022
  13. Christian CouderJan 26, 2022
  14. Elijah NewrenJan 29, 2022
  15. 05/12 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Jan 22, 2022
  16. Ævar Arnfjörð BjarmasonJan 24, 2022
  17. Elijah NewrenJan 25, 2022
  18. Johannes SchindelinJan 28, 2022
  19. 07/12 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Jan 22, 2022
  20. Christian CouderJan 26, 2022
  21. Elijah NewrenJan 29, 2022
  22. Johannes SchindelinJan 28, 2022
  23. Elijah NewrenJan 29, 2022
  24. 06/12 merge-ort: allow update messages to be written to different file streamElijah Newren via GitGitGadget, Jan 22, 2022
  25. Johannes SchindelinJan 28, 2022
  26. Elijah NewrenJan 29, 2022
  27. 10/12 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Jan 22, 2022
  28. Ævar Arnfjörð BjarmasonJan 24, 2022
  29. Elijah NewrenJan 24, 2022
  30. 08/12 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Jan 22, 2022
  31. Christian CouderJan 26, 2022
  32. Elijah NewrenJan 29, 2022
  33. Christian CouderJan 26, 2022
  34. Elijah NewrenJan 29, 2022
  35. Johannes SchindelinJan 28, 2022
  36. Elijah NewrenJan 29, 2022
  37. Johannes SixtJan 29, 2022
  38. Elijah NewrenJan 29, 2022
  39. Johannes SchindelinFeb 4, 2022
  40. Elijah NewrenFeb 5, 2022
  41. Johannes SchindelinFeb 21, 2022
  42. Ævar Arnfjörð BjarmasonFeb 21, 2022
  43. machine-parsable git-merge-tree messages (was: [PATCH 08/12] merge-ort: provide a merge_get_conflicted_files() helper function)Ævar Arnfjörð Bjarmason, Feb 21, 2022
  44. Elijah NewrenFeb 23, 2022
  45. Ævar Arnfjörð BjarmasonFeb 28, 2022
  46. Elijah NewrenMar 1, 2022
  47. Johannes SchindelinFeb 22, 2022
  48. Elijah NewrenFeb 23, 2022
  49. Johannes SchindelinFeb 25, 2022
  50. Elijah NewrenFeb 23, 2022
  51. Johannes SchindelinFeb 25, 2022
  52. Junio C HamanoFeb 25, 2022
  53. Elijah NewrenFeb 26, 2022
  54. Johannes SchindelinMar 7, 2022
  55. Elijah NewrenMar 8, 2022
  56. Johannes SchindelinMar 10, 2022
  57. Johannes SchindelinMay 13, 2022
  58. Elijah NewrenMay 17, 2022
  59. Johannes SchindelinJun 3, 2022
  60. Johannes SchindelinJun 5, 2022
  61. Johannes SchindelinJun 5, 2022
  62. Johannes SchindelinJun 6, 2022
  63. Elijah NewrenJun 7, 2022
  64. Elijah NewrenJun 17, 2022
  65. Johannes SchindelinJun 18, 2022
  66. 11/12 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Jan 22, 2022
  67. 12/12 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Jan 22, 2022
  68. 09/12 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Jan 22, 2022
  69. Ævar Arnfjörð BjarmasonJan 24, 2022
  70. Elijah NewrenJan 24, 2022
  71. Johannes SchindelinJan 28, 2022
  72. Elijah NewrenJan 29, 2022
  73. Johannes SchindelinFeb 4, 2022
  74. Christian CouderJan 26, 2022
  75. Johannes SchindelinJan 26, 2022
  76. Christian CouderJan 26, 2022
  77. Johannes SchindelinJan 28, 2022
  78. Christian CouderJan 28, 2022
  79. Johannes SchindelinJan 28, 2022
  80. Elijah NewrenJan 29, 2022
  81. Christian CouderJan 29, 2022
  82. Elijah NewrenJan 29, 2022
  83. Elijah NewrenJan 31, 2022
  84. Johannes SchindelinJan 28, 2022
  85. 00/13 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Jan 29, 2022
  86. 01/13 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Jan 29, 2022
  87. 02/13 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Jan 29, 2022
  88. 03/13 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Jan 29, 2022
  89. Junio C HamanoFeb 2, 2022
  90. 04/13 merge-tree: implement real mergesElijah Newren via GitGitGadget, Jan 29, 2022
  91. Junio C HamanoFeb 2, 2022
  92. Elijah NewrenFeb 2, 2022
  93. Johannes SchindelinFeb 21, 2022
  94. 05/13 diff: allow diff_warn_rename_limit to write somewhere besides stdoutJohannes Schindelin via GitGitGadget, Jan 29, 2022
  95. 06/13 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Jan 29, 2022
  96. 07/13 merge-ort: allow update messages to be written to different file streamElijah Newren via GitGitGadget, Jan 29, 2022
  97. 11/13 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Jan 29, 2022
  98. Junio C HamanoFeb 2, 2022
  99. Elijah NewrenFeb 2, 2022
  100. Ævar Arnfjörð BjarmasonFeb 3, 2022
  101. Elijah NewrenFeb 3, 2022
  102. 10/13 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Jan 29, 2022
  103. Junio C HamanoFeb 2, 2022
  104. Junio C HamanoFeb 2, 2022
  105. Junio C HamanoFeb 3, 2022
  106. 09/13 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Jan 29, 2022
  107. 08/13 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Jan 29, 2022
  108. Junio C HamanoFeb 2, 2022
  109. Elijah NewrenFeb 2, 2022
  110. 13/13 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Jan 29, 2022
  111. 12/13 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Jan 29, 2022
  112. Junio C HamanoFeb 2, 2022
  113. 00/15 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Feb 2, 2022
  114. 01/15 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Feb 2, 2022
  115. 02/15 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Feb 2, 2022
  116. 03/15 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Feb 2, 2022
  117. Ævar Arnfjörð BjarmasonFeb 3, 2022
  118. Elijah NewrenFeb 3, 2022
  119. Elijah NewrenFeb 3, 2022
  120. Ævar Arnfjörð BjarmasonFeb 3, 2022
  121. Elijah NewrenFeb 3, 2022
  122. Ævar Arnfjörð BjarmasonFeb 3, 2022
  123. Elijah NewrenFeb 3, 2022
  124. Ævar Arnfjörð BjarmasonFeb 3, 2022
  125. Emily ShafferFeb 7, 2022
  126. Junio C HamanoFeb 7, 2022
  127. 04/15 merge-tree: implement real mergesElijah Newren via GitGitGadget, Feb 2, 2022
  128. Junio C HamanoFeb 2, 2022
  129. Elijah NewrenFeb 2, 2022
  130. Junio C HamanoFeb 2, 2022
  131. Elijah NewrenFeb 3, 2022
  132. Johannes AltmanningerFeb 3, 2022
  133. Elijah NewrenFeb 3, 2022
  134. Johannes SchindelinFeb 21, 2022
  135. Elijah NewrenFeb 22, 2022
  136. Junio C HamanoFeb 3, 2022
  137. Junio C HamanoFeb 21, 2022
  138. Elijah NewrenFeb 22, 2022
  139. Junio C HamanoFeb 23, 2022
  140. Elijah NewrenFeb 24, 2022
  141. Junio C HamanoFeb 24, 2022
  142. Junio C HamanoFeb 24, 2022
  143. Johannes AltmanningerFeb 27, 2022
  144. Johannes AltmanningerFeb 27, 2022
  145. Johannes SchindelinFeb 22, 2022
  146. Josh SteadmonFeb 4, 2022
  147. Elijah NewrenFeb 4, 2022
  148. 05/15 Introduce a variant of the `warning()` function that takes a `FILE *`Johannes Schindelin via GitGitGadget, Feb 2, 2022
  149. 06/15 diff: allow diff_warn_rename_limit to write somewhere besides stderrJohannes Schindelin via GitGitGadget, Feb 2, 2022
  150. 07/15 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Feb 2, 2022
  151. 08/15 merge-ort: allow update messages to be written to different file streamElijah Newren via GitGitGadget, Feb 2, 2022
  152. Ævar Arnfjörð BjarmasonFeb 3, 2022
  153. Elijah NewrenFeb 3, 2022
  154. Ævar Arnfjörð BjarmasonFeb 3, 2022
  155. Elijah NewrenFeb 3, 2022
  156. Ævar Arnfjörð BjarmasonFeb 3, 2022
  157. Elijah NewrenFeb 3, 2022
  158. Johannes SchindelinFeb 21, 2022
  159. Elijah NewrenFeb 22, 2022
  160. Johannes SchindelinFeb 22, 2022
  161. 09/15 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Feb 2, 2022
  162. 13/15 merge-tree: allow `ls-files -u` style info to be NUL terminatedElijah Newren via GitGitGadget, Feb 2, 2022
  163. 14/15 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Feb 2, 2022
  164. 15/15 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Feb 2, 2022
  165. 10/15 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Feb 2, 2022
  166. 11/15 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Feb 2, 2022
  167. 12/15 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Feb 2, 2022
  168. Ævar Arnfjörð BjarmasonFeb 2, 2022
  169. Elijah NewrenFeb 3, 2022
  170. 00/12 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Feb 12, 2022
  171. 01/12 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Feb 12, 2022
  172. 02/12 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Feb 12, 2022
  173. 03/12 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Feb 12, 2022
  174. 04/12 merge-tree: implement real mergesElijah Newren via GitGitGadget, Feb 12, 2022
  175. Junio C HamanoFeb 14, 2022
  176. Elijah NewrenFeb 15, 2022
  177. Ævar Arnfjörð BjarmasonFeb 15, 2022
  178. 06/12 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Feb 12, 2022
  179. 05/12 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Feb 12, 2022
  180. 07/12 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Feb 12, 2022
  181. 08/12 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Feb 12, 2022
  182. 09/12 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Feb 12, 2022
  183. 12/12 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Feb 12, 2022
  184. 10/12 merge-tree: allow `ls-files -u` style info to be NUL terminatedElijah Newren via GitGitGadget, Feb 12, 2022
  185. 11/12 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Feb 12, 2022
  186. 00/12 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Feb 20, 2022
  187. 01/12 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Feb 20, 2022
  188. 02/12 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Feb 20, 2022
  189. 04/12 merge-tree: implement real mergesElijah Newren via GitGitGadget, Feb 20, 2022
  190. René ScharfeFeb 20, 2022
  191. Johannes SchindelinFeb 21, 2022
  192. Elijah NewrenFeb 22, 2022
  193. Johannes SchindelinFeb 22, 2022
  194. 03/12 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Feb 20, 2022
  195. 05/12 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Feb 20, 2022
  196. 08/12 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Feb 20, 2022
  197. 06/12 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Feb 20, 2022
  198. 07/12 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Feb 20, 2022
  199. 11/12 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Feb 20, 2022
  200. 12/12 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Feb 20, 2022
  201. Johannes SchindelinFeb 22, 2022
  202. 10/12 merge-tree: allow `ls-files -u` style info to be NUL terminatedElijah Newren via GitGitGadget, Feb 20, 2022
  203. 09/12 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Feb 20, 2022
  204. Ævar Arnfjörð BjarmasonFeb 20, 2022
  205. Johannes SchindelinFeb 21, 2022
  206. Elijah NewrenFeb 22, 2022
  207. Ævar Arnfjörð BjarmasonFeb 22, 2022
  208. 00/12 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Feb 23, 2022
  209. 01/12 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Feb 23, 2022
  210. 02/12 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Feb 23, 2022
  211. 03/12 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Feb 23, 2022
  212. 04/12 merge-tree: implement real mergesElijah Newren via GitGitGadget, Feb 23, 2022
  213. 05/12 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Feb 23, 2022
  214. 07/12 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Feb 23, 2022
  215. 06/12 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Feb 23, 2022
  216. 08/12 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Feb 23, 2022
  217. 10/12 merge-tree: allow `ls-files -u` style info to be NUL terminatedElijah Newren via GitGitGadget, Feb 23, 2022
  218. 11/12 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Feb 23, 2022
  219. 09/12 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Feb 23, 2022
  220. 12/12 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Feb 23, 2022
  221. Junio C HamanoFeb 23, 2022
  222. 00/17 In-core git merge-tree ("Server side merges")Elijah Newren via GitGitGadget, Jun 18, 2022
  223. 01/17 merge-tree: rename merge_trees() to trivial_merge_trees()Elijah Newren via GitGitGadget, Jun 18, 2022
  224. 02/17 merge-tree: move logic for existing merge into new functionElijah Newren via GitGitGadget, Jun 18, 2022
  225. 03/17 merge-tree: add option parsing and initial shell for real merge functionElijah Newren via GitGitGadget, Jun 18, 2022
  226. 05/17 merge-ort: split out a separate display_update_messages() functionElijah Newren via GitGitGadget, Jun 18, 2022
  227. 04/17 merge-tree: implement real mergesElijah Newren via GitGitGadget, Jun 18, 2022
  228. 06/17 merge-tree: support including merge messages in outputElijah Newren via GitGitGadget, Jun 18, 2022
  229. 07/17 merge-ort: provide a merge_get_conflicted_files() helper functionElijah Newren via GitGitGadget, Jun 18, 2022
  230. 09/17 merge-tree: provide a list of which files have conflictsElijah Newren via GitGitGadget, Jun 18, 2022
  231. 08/17 merge-ort: remove command-line-centric submodule message from merge-ortElijah Newren via GitGitGadget, Jun 18, 2022
  232. 12/17 merge-ort: make `path_messages` a strmap to a string_listJohannes Schindelin via GitGitGadget, Jun 18, 2022
  233. 15/17 merge-tree: allow `ls-files -u` style info to be NUL terminatedElijah Newren via GitGitGadget, Jun 18, 2022
  234. 16/17 merge-tree: add a --allow-unrelated-histories flagElijah Newren via GitGitGadget, Jun 18, 2022
  235. 17/17 git-merge-tree.txt: add a section on potentional usage mistakesElijah Newren via GitGitGadget, Jun 18, 2022
  236. 14/17 merge-ort: optionally produce machine-readable outputElijah Newren via GitGitGadget, Jun 18, 2022
  237. 13/17 merge-ort: store more specific conflict informationElijah Newren via GitGitGadget, Jun 18, 2022
  238. 11/17 merge-ort: store messages in a list, not in a single strbufJohannes Schindelin via GitGitGadget, Jun 18, 2022
  239. 10/17 merge-tree: provide easy access to `ls-files -u` style infoElijah Newren via GitGitGadget, Jun 18, 2022
  240. Johannes SchindelinFeb 21, 2022

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.