git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: "Josh Soref" <gitgitgadget@gmail.com>, git@vger.kernel.org
Cc: "Elijah Newren" <newren@gmail.com>
Subject: Re: [PATCH v3 0/2] merge-tree: add new --dry-run option
Date: Wed, 14 May 2025 17:34:02 +0200	[thread overview]
Message-ID: <be8de818-0e04-442d-9639-d34888df10cf@app.fastmail.com> (raw)
In-Reply-To: <pull.1920.v3.git.1747182287.gitgitgadget@gmail.com>

On Wed, May 14, 2025, at 02:24, Elijah Newren via GitGitGadget wrote:
> Changes since v2:
>
>  * Converted locations missed in v1 in changing --mergeability-only ->
>    --dry-run
>
> Changes since v1:
>
>  * Renamed --mergeability-only flag to --dry-run, as per suggestion from
>    Junio
>  * added some commit message clarifications
>
> This adds a new flag, --dry-run, to git merge-tree, which suppresses all
> output and leaves only the exit status (reflecting successful merge or
> conflict). This is useful for Git Forges in cases where they are only
> interested in whether two branches can be merged, without needing the actual
> merge result or conflict details.
>
> The advantage of the flag is two fold:
>
>  * The merge machinery can exit once it detects a conflict, instead of
>    continuing to compute merge result information
>  * The merge machinery can avoid writing merged blobs and trees to the
>    object store when in the outer layer of the merging process (more details
>    in the first commit message).
>
> Elijah Newren (2):
>   merge-ort: add a new mergeability_only option
>   merge-tree: add a new --dry-run flag

All I can say is that this looks good considering the comments on v2.

Interdiff:

```
diff --git a/Documentation/git-merge-tree.adoc b/Documentation/git-merge-tree.adoc
index 7dcc1780619..74716b91019 100644
--- a/Documentation/git-merge-tree.adoc
+++ b/Documentation/git-merge-tree.adoc
@@ -65,11 +65,11 @@ OPTIONS
 	default is to include these messages if there are merge
 	conflicts, and to omit them otherwise.

---mergeability-only::
+--dry-run::
 	Disable all output from the program.  Useful when you are only
 	interested in the exit status.  Allows merge-tree to exit
-	early on the first conflict it finds, and allows it to avoid
-	writing most objects created by merges.
+	early when it finds a conflict, and allows it to avoid writing
+	most objects created by merges.

 --allow-unrelated-histories::
 	merge-tree will by default error out if the two branches specified
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 579e81d5184..273ec171e98 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -596,13 +596,13 @@ int cmd_merge_tree(int argc,
 	if (dry_run && o.show_messages == -1)
 		o.show_messages = 0;
 	o.merge_options.mergeability_only = dry_run;
-	die_for_incompatible_opt2(dry_run, "--mergeability-only",
+	die_for_incompatible_opt2(dry_run, "--dry-run",
 				  o.show_messages, "--messages");
-	die_for_incompatible_opt2(dry_run, "--mergeability-only",
+	die_for_incompatible_opt2(dry_run, "--dry-run",
 				  o.name_only, "--name-only");
-	die_for_incompatible_opt2(dry_run, "--mergeability-only",
+	die_for_incompatible_opt2(dry_run, "--dry-run",
 				  o.use_stdin, "--stdin");
-	die_for_incompatible_opt2(dry_run, "--mergeability-only",
+	die_for_incompatible_opt2(dry_run, "--dry-run",
 				  !line_termination, "-z");

 	if (xopts.nr && o.mode == MODE_TRIVIAL)
```

  parent reply	other threads:[~2025-05-14 15:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-10 22:02 [PATCH 0/2] merge-tree: add new --mergeability-only option Elijah Newren via GitGitGadget
2025-05-10 22:02 ` [PATCH 1/2] merge-ort: add a new mergeability_only option Elijah Newren via GitGitGadget
2025-05-10 22:02 ` [PATCH 2/2] merge-tree: add a new --mergeability-only flag Elijah Newren via GitGitGadget
2025-05-12 17:04 ` [PATCH 0/2] merge-tree: add new --mergeability-only option Junio C Hamano
2025-05-12 17:41   ` Elijah Newren
2025-05-12 18:27     ` Junio C Hamano
2025-05-12 18:37       ` Elijah Newren
2025-05-12 23:42 ` [PATCH v2 0/2] merge-tree: add new --dry-run option Elijah Newren via GitGitGadget
2025-05-12 23:42   ` [PATCH v2 1/2] merge-ort: add a new mergeability_only option Elijah Newren via GitGitGadget
2025-05-12 23:42   ` [PATCH v2 2/2] merge-tree: add a new --dry-run flag Elijah Newren via GitGitGadget
2025-05-13  7:15     ` Kristoffer Haugsbakk
2025-05-13 15:28       ` Elijah Newren
2025-05-13 13:24     ` Junio C Hamano
2025-05-13 15:30       ` Elijah Newren
2025-05-14 14:08         ` Junio C Hamano
2025-05-14  0:24   ` [PATCH v3 0/2] merge-tree: add new --dry-run option Elijah Newren via GitGitGadget
2025-05-14  0:24     ` [PATCH v3 1/2] merge-ort: add a new mergeability_only option Elijah Newren via GitGitGadget
2025-05-14  0:24     ` [PATCH v3 2/2] merge-tree: add a new --dry-run flag Elijah Newren via GitGitGadget
2025-05-15 13:07       ` Junio C Hamano
2025-05-16 13:18       ` Phillip Wood
2025-05-16 16:03         ` Elijah Newren
2025-05-14 15:34     ` Kristoffer Haugsbakk [this message]
2025-05-16 20:04     ` [PATCH v4 0/2] merge-tree: add new --quiet option Elijah Newren via GitGitGadget
2025-05-16 20:04       ` [PATCH v4 1/2] merge-ort: add a new mergeability_only option Elijah Newren via GitGitGadget
2025-05-16 20:04       ` [PATCH v4 2/2] merge-tree: add a new --quiet flag Elijah Newren via GitGitGadget
2025-05-17 19:52         ` Kristoffer Haugsbakk
2025-05-17 19:57           ` Kristoffer Haugsbakk
2025-05-19  9:05       ` [PATCH v4 0/2] merge-tree: add new --quiet option Phillip Wood
2025-05-19 15:59         ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=be8de818-0e04-442d-9639-d34888df10cf@app.fastmail.com \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).