From patchwork Fri Mar 7 15:48:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 14006683 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D08E194C78 for ; Fri, 7 Mar 2025 15:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362528; cv=none; b=B+uUaJrAbhLwcMPUHS3BC0BoRNk4NdugzqVmhIM0XQqUXKilKQv8XfE3pNyWv5Z4Z4adAgVaVGfNQ6dKqdSGsVIbR8Ed2gP0bRTFlGq1EaldwQyCeuVpUA5km/xd5knJVfTKqB1VCUFjURyJYULVB0YVhH2naq8IZQp3UgU26vk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362528; c=relaxed/simple; bh=FXavj6SuMPsir2ALulDIh53QPSxD/0S+5YokMkzFRjo=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=lx/mM2sdBbDJksEaQzA8uFqjtmYsJyhD8d2A6Uyj+iCQcTYQG0FQCmgRpOwUHlGWvxftl2czBCyO3IFpbHX3MyM584spLObd6RW89Q+Q27oN+pqpOais35Tt/yECPHCbzSfnxR9T09PQBrs5Nfm4OsAaPVSRAp4oHd3B28Cv+G0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cbf1nw7y; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cbf1nw7y" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5e0813bd105so3296832a12.1 for ; Fri, 07 Mar 2025 07:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741362524; x=1741967324; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=o7FHUVb7xP8d80Y3X2sdMzv1vb1ZsB+MMmKgglvEc6Q=; b=cbf1nw7yi75W2xmLsuLkIAa80ADB1QNFO2/r1lK8i5eBew8QWEAidMWHbIaCj4cZui 6ycwGCAvhGUxV3VqjKT7ahLAORq51dFZduvA7Zoxt5y4WSAc5p5vuK5gyhR2zuyAkRP/ dYPia62AmbxlsUARfECnH8lzof61L5ZR7bjvEe7qLSt7mnA4MPnlhxFhl2cqz3v7pmsz IMVuOuwPNoHEcJ9R5KYT4YhrbelRbCKf3SY1A5woFt0B51HBpNAoz0vK7cPslpQUVH3c n5rWEE3vT1GkAPJ0eAM/DtV7WAH46JAR4FMs6/lb4U7VmscekAhvTliiTGRLrHxfNDey gg+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741362524; x=1741967324; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o7FHUVb7xP8d80Y3X2sdMzv1vb1ZsB+MMmKgglvEc6Q=; b=rAAUyvaPnxKN1WMGdoB1iJjYtNQjC6aOp9J7c7bwENQc30sF3OexABDXX9SPLuvFUt 6Xd8RIHuXvfxiDWF8oxflxaoXUA/cyYHZvby3JOHwxfQKBgIbr4M0ipFNCr65zgtr7b+ E3AmlU/LllQKRevOW+SGtTvE9zHAoqKcJornzbxclpxNKRnhu9PyO6uHuWEwAD4hP/Sx ypDi+yENZxVW+9GZ1eqVyrdZIc52oaYuWDjdRz9+AFn+Ai95sfEHaX3S0agbQjs+forY Pre1DXimhM6YtRIixEgWGLs6OuKiJ7CFD7nL7D8VNop/wHTmSgTdcDqR91bShGKo+zOg Qgyg== X-Gm-Message-State: AOJu0Yy61j4rxM8lb5SPb2JQdQFm3FuuYY1AvC424AfuQtiY3j9/D9/0 3RStpTtRHlnUZK7/snMJCixMOHV5LHHQC7TiQiIDm9Bv/gRJ4e1rLOwxuQ== X-Gm-Gg: ASbGncvwPwIVnNHQekRHDIqQAbY1xercUCyc9yjwcOL8o8KXGHOr8eCPYrtcDTu3o0b 2KlspP/HN0yRK9Xort/BJDcfuiRJ11yQA7pNK2sUBmCdgdL+eBMF5QZ31EuRv6cdAiDhDA7GAOB SP4BhvydSFRIgVvMD1YwfGs75zIqOoIFH3FaMgSdnla87FNICJIkbd9tLybhT3EVMNYApCc9TSS lKpzDHBvUEqv6yEQfour3EQE2r4zzQVlW93gY359aXdE79eUFtMVZfzFS/ExW55YpZWiIRsndeB UmHCgRY1BEi2hyU6DpmFjBL5GFe5nkQGFneT3iwF0lUJ9w== X-Google-Smtp-Source: AGHT+IFaTHe5Pd8UCQY2+yD5fVEKRvxkOYIYkqIfQHUnxBvoAi/zz+0ioPW7iu87yip5WxMg+1Gbig== X-Received: by 2002:a05:6402:4011:b0:5e5:e836:71f3 with SMTP id 4fb4d7f45d1cf-5e5e836730fmr3252271a12.29.1741362524052; Fri, 07 Mar 2025 07:48:44 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e5c768fa17sm2659871a12.72.2025.03.07.07.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 07:48:43 -0800 (PST) Message-Id: <9f73e54224d55b40faeb5d68ebd7ff0c13d69c7b.1741362522.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 07 Mar 2025 15:48:40 +0000 Subject: [PATCH 1/3] merge-ort: add new merge_ort_generic() function Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Elijah Newren From: Elijah Newren From: Elijah Newren merge-recursive.[ch] have three entry points: * merge_trees() * merge_recursive() * merge_recursive_generic() merge-ort*.[ch] only has equivalents for the first two. Add an equivalent for the final entry point, so we can switch callers to use it and remove merge-recursive.[ch]. Signed-off-by: Elijah Newren --- merge-ort-wrappers.c | 64 ++++++++++++++++++++++++++++++++++++++++++++ merge-ort-wrappers.h | 12 +++++++++ merge-ort.c | 17 ++++++++---- merge-ort.h | 5 ++++ 4 files changed, 93 insertions(+), 5 deletions(-) diff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c index d6f61359965..62834c30e9e 100644 --- a/merge-ort-wrappers.c +++ b/merge-ort-wrappers.c @@ -1,9 +1,13 @@ #include "git-compat-util.h" #include "gettext.h" #include "hash.h" +#include "hex.h" +#include "lockfile.h" #include "merge-ort.h" #include "merge-ort-wrappers.h" #include "read-cache-ll.h" +#include "repository.h" +#include "tag.h" #include "tree.h" #include "commit.h" @@ -64,3 +68,63 @@ int merge_ort_recursive(struct merge_options *opt, return tmp.clean; } + +static struct commit *get_ref(struct repository *repo, + const struct object_id *oid, + const char *name) +{ + struct object *object; + + object = deref_tag(repo, parse_object(repo, oid), + name, strlen(name)); + if (!object) + return NULL; + if (object->type == OBJ_TREE) + return make_virtual_commit(repo, (struct tree*)object, name); + if (object->type != OBJ_COMMIT) + return NULL; + if (repo_parse_commit(repo, (struct commit *)object)) + return NULL; + return (struct commit *)object; +} + +int merge_ort_generic(struct merge_options *opt, + const struct object_id *head, + const struct object_id *merge, + int num_merge_bases, + const struct object_id *merge_bases, + struct commit **result) +{ + int clean; + struct lock_file lock = LOCK_INIT; + struct commit *head_commit = get_ref(opt->repo, head, opt->branch1); + struct commit *next_commit = get_ref(opt->repo, merge, opt->branch2); + struct commit_list *ca = NULL; + + if (merge_bases) { + int i; + for (i = 0; i < num_merge_bases; ++i) { + struct commit *base; + if (!(base = get_ref(opt->repo, &merge_bases[i], + oid_to_hex(&merge_bases[i])))) + return error(_("Could not parse object '%s'"), + oid_to_hex(&merge_bases[i])); + commit_list_insert(base, &ca); + } + } + + repo_hold_locked_index(opt->repo, &lock, LOCK_DIE_ON_ERROR); + clean = merge_ort_recursive(opt, head_commit, next_commit, ca, + result); + free_commit_list(ca); + if (clean < 0) { + rollback_lock_file(&lock); + return clean; + } + + if (write_locked_index(opt->repo->index, &lock, + COMMIT_LOCK | SKIP_IF_UNCHANGED)) + return error(_("Unable to write index.")); + + return clean ? 0 : 1; +} diff --git a/merge-ort-wrappers.h b/merge-ort-wrappers.h index 90af1f69c55..aeffa1c87b4 100644 --- a/merge-ort-wrappers.h +++ b/merge-ort-wrappers.h @@ -22,4 +22,16 @@ int merge_ort_recursive(struct merge_options *opt, const struct commit_list *ancestors, struct commit **result); +/* + * rename-detecting three-way merge. num_merge_bases must be at least 1. + * Recursive ancestor consolidation will be performed if num_merge_bases > 1. + * Wrapper mimicking the old merge_recursive_generic() function. + */ +int merge_ort_generic(struct merge_options *opt, + const struct object_id *head, + const struct object_id *merge, + int num_merge_bases, + const struct object_id *merge_bases, + struct commit **result); + #endif diff --git a/merge-ort.c b/merge-ort.c index 46e78c3ffa6..b4ff24403a1 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -4878,9 +4878,9 @@ static inline void set_commit_tree(struct commit *c, struct tree *t) c->maybe_tree = t; } -static struct commit *make_virtual_commit(struct repository *repo, - struct tree *tree, - const char *comment) +struct commit *make_virtual_commit(struct repository *repo, + struct tree *tree, + const char *comment) { struct commit *commit = alloc_commit_node(repo); @@ -5186,6 +5186,8 @@ static void merge_ort_internal(struct merge_options *opt, ancestor_name = "empty tree"; } else if (merge_bases) { ancestor_name = "merged common ancestors"; + } else if (opt->ancestor) { + ancestor_name = opt->ancestor; } else { strbuf_add_unique_abbrev(&merge_base_abbrev, &merged_merge_bases->object.oid, @@ -5275,8 +5277,13 @@ void merge_incore_recursive(struct merge_options *opt, { trace2_region_enter("merge", "incore_recursive", opt->repo); - /* We set the ancestor label based on the merge_bases */ - assert(opt->ancestor == NULL); + /* + * We set the ancestor label based on the merge_bases...but we + * allow one exception through so that builtin/am can override + * with its constructed fake ancestor. + */ + assert(opt->ancestor == NULL || + (merge_bases && !merge_bases->next)); trace2_region_enter("merge", "merge_start", opt->repo); merge_start(opt, result); diff --git a/merge-ort.h b/merge-ort.h index 82f2b3222d2..b63bc5424e7 100644 --- a/merge-ort.h +++ b/merge-ort.h @@ -44,6 +44,11 @@ struct merge_result { unsigned _properly_initialized; }; +/* Mostly internal function also used by merge-ort-wrappers.c */ +struct commit *make_virtual_commit(struct repository *repo, + struct tree *tree, + const char *comment); + /* * rename-detecting three-way merge with recursive ancestor consolidation. * working tree and index are untouched. From patchwork Fri Mar 7 15:48:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 14006684 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1071821D3C0 for ; Fri, 7 Mar 2025 15:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362528; cv=none; b=i/O13wGFri1RjhN+eI8weysqnBsxTOLJK0H9QedpfIHJ0xBz29qnnePt28ZVQjMzsblNuJRfefshG2j/WQhDXA2l0Qfynpb8Cj7ttz/9UCF09jOs0s4XJzmPqQ+5KB317uZZFdiKbUxKBf7CP8Qafsoz6x0+cYjAGRoK52ZAl0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362528; c=relaxed/simple; bh=GFWZYukIn0pMpi5KDSjOlqRzKB0TLFU4e+8Y5Ft/XSU=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=lp1tUgE/cCQqnsG9PMPh3DpZdyc/gZtKNkdiVPouE/Y+vwr+dSL+xvvmovSs746IDq7PfGUBYo5Rg0+kxP9Yvcmr0FIIQ7+NHvauYDSN9U2VpZlPF9aop3g4UsgPivCfhF6yikU1V41Vms0jm/lgfq/jdx6lruqINCfqtw59WZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jfXVcd48; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jfXVcd48" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5e5e22e6ed2so1773203a12.3 for ; Fri, 07 Mar 2025 07:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741362525; x=1741967325; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=voKFxUz5P+yaeVEDGiKP2GDyoLaxJ3SYb2i0Obutydc=; b=jfXVcd48oj2kwcJMW6Xx0OMguWziaXDByIm0/tlpoq4fc+5PMbq74YFKTt2qNqPu84 a0WBfC4pEd6NEdBOKXtvBnhstl4yTRolrdaaHAxsKvt8lGSUsRi71dHNwTBPMi4N3nfd 3xb4cBOoiZcXP3mOzRn2bwyKkTmrOynLD84TrGJhxLYiit8zqzD9jefm/mFkskBKF9zO veq8PWcyLb5ubwe3xa3DvwzCWGsdtUzOLLZrm4sbX9RKYORk8ZoBN5ScvfUTi9122lE+ qK7Wx+PQwvu1Uao0CoK2Ek+NghxqcZ87bF/XYvj7ZzsxFnT/0tw+g1dc3+RYu9kSbqgI VDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741362525; x=1741967325; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=voKFxUz5P+yaeVEDGiKP2GDyoLaxJ3SYb2i0Obutydc=; b=I0GKQavxfJitjMA7f6tQO4uATo8tKNqEUXQozWwr4hcLluN5jHCtX2n4fpQAHVbGrI /G3yZnFmfXXGHdK/fLNA1EG04IKbI8P7rmvCOe5rLwYifEqZPcu1z/Qiwp5r9FqyPfFD Jimxq8S3tfoibVAVDaue+Yx6cTYtbee5eAwhosKKn+A/QmLlbZFKWVsORu/rgds8bKY/ 7RyVtJq5wApAc6dOhKY3/DAsOMx8C/57rz7hUxilZQ6aCP5XsyihxkK6EjSKNr26Vr7G U8bBMHimNkekSyqyI4EQ2ciu0WoSajv1cddyMGKJCahkakOjUS912glO8N8mOWzJt4Wz 3CdQ== X-Gm-Message-State: AOJu0Yzp+xnq8dfKU6tCSjRKwlJzzq2yQTyMO8+GoYbHal24PQjDl7j/ jdu04nGHk7i1kuEovoteTDH5sDe+dQvNbvJseQlkN6seM2osL89iO/yzVg== X-Gm-Gg: ASbGncuHJcldfJWNbTGEsw+Mz6g3QmGy/5eQ+/TwpwgHgGrqkGlJzneElKyBYRyyr76 Xzm7TlUmyfsVfFNXiCY5FMggyO0C926zrDKJOZemsQkEa50V/hc2IGmvVPZjSsvFkS53SjqKCKr tCcCsDip/bVtQcUsHsgY6o3HlbRUTqjEo0QFOX1uZCmDhM6a/Z4/Tdd5dOjwZqThMtZgtcTPKHE Ua4/PEUEkUTY619dxCvbqaoy9SpvZf8SV+RyB0UVC7ueVrFXMkYv9Djw+I6CZSx4EJOUZtR2kD6 ZC6Mqoz1+C25yPycs7RVF9/KjHkuBD2KcKiU1PizXsE5YA== X-Google-Smtp-Source: AGHT+IEUewbHw7wRbd0aIhDDB4uNm9WFziZlRCt2H7ZilubrS3GLK0dAZMLgC7QDuoguzcY2CisM/A== X-Received: by 2002:a17:906:dc8b:b0:ab7:6fa9:b0a9 with SMTP id a640c23a62f3a-ac2525e0417mr431979766b.11.1741362524684; Fri, 07 Mar 2025 07:48:44 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac23948432dsm290080166b.44.2025.03.07.07.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 07:48:44 -0800 (PST) Message-Id: <4292b22723f759c3e0f84ac1000992187a9c7f7c.1741362522.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 07 Mar 2025 15:48:41 +0000 Subject: [PATCH 2/3] merge-ort: allow rename detection to be disabled Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Elijah Newren From: Elijah Newren From: Elijah Newren When merge-ort was written, I did not at first allow rename detection to be disabled, because I suspected that most folks disabling rename detection were doing so solely for performance reasons. Since I put a lot of working into providing dramatic speedups for rename detection performance as used by the merge machinery, I wanted to know if there were still real world repositories where rename detection was problematic from a performance perspective. We have had years now to collect such information, and while we never received one, waiting longer with the option disabled seems unlikely to help surface such issues at this point. Also, there has been at least one request to allow rename detection to be disabled for behavioral rather than performance reasons, so let's start heeding the config and command line settings. Signed-off-by: Elijah Newren --- Documentation/merge-strategies.adoc | 12 ++++++------ merge-ort.c | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Documentation/merge-strategies.adoc b/Documentation/merge-strategies.adoc index 93822ebc4e8..59f5ae36ccb 100644 --- a/Documentation/merge-strategies.adoc +++ b/Documentation/merge-strategies.adoc @@ -82,6 +82,11 @@ find-renames[=];; rename-threshold=;; Deprecated synonym for `find-renames=`. +no-renames;; + Turn off rename detection. This overrides the `merge.renames` + configuration variable. + See also linkgit:git-diff[1] `--no-renames`. + subtree[=];; This option is a more advanced form of 'subtree' strategy, where the strategy makes a guess on how two trees must be shifted to @@ -107,7 +112,7 @@ For a path that is a submodule, the same caution as 'ort' applies to this strategy. + The 'recursive' strategy takes the same options as 'ort'. However, -there are three additional options that 'ort' ignores (not documented +there are two additional options that 'ort' ignores (not documented above) that are potentially useful with the 'recursive' strategy: patience;; @@ -121,11 +126,6 @@ diff-algorithm=[patience|minimal|histogram|myers];; specifically uses `diff-algorithm=histogram`, while `recursive` defaults to the `diff.algorithm` config setting. -no-renames;; - Turn off rename detection. This overrides the `merge.renames` - configuration variable. - See also linkgit:git-diff[1] `--no-renames`. - resolve:: This can only resolve two heads (i.e. the current branch and another branch you pulled from) using a 3-way merge diff --git a/merge-ort.c b/merge-ort.c index b4ff24403a1..a6960b6a1b4 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -3448,6 +3448,11 @@ static int detect_and_process_renames(struct merge_options *opt) if (!possible_renames(renames)) goto cleanup; + if (opt->detect_renames == 0) { + renames->redo_after_renames = 0; + renames->cached_pairs_valid_side = 0; + goto cleanup; + } trace2_region_enter("merge", "regular renames", opt->repo); detection_run |= detect_regular_renames(opt, MERGE_SIDE1); From patchwork Fri Mar 7 15:48:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 14006685 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7973821CFFA for ; Fri, 7 Mar 2025 15:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362529; cv=none; b=BCbtBOVvx8Y2UbNKUfkhqvRuPhNpVGXZmHCS1nP7c5B6GiPsd45hAwrovousdSqtH9tZebtudbwyxxLivKd18Tydl/8J15MkT8uSVfV3manwD50CkwlOP0jkXa+lgX71o1PuPXnEFsu8YWHxb6RIUjauhAwhs3Pfx5xlhqzqgDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741362529; c=relaxed/simple; bh=WAXsQ0J4FFPqz7CmMm5SKdUextXJTaC3nL195j1fLAQ=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=lRiU51nv7+E1ACkohKq+etpIl7EOhzb/426o/gx6abQHz8LVwr4X3Y8RjADZdwjJlgZhPZ978Hezf1wEh4u3EEZ1yzDCqF5cjW3ibxLZNg+MgybzGVRJGFb0npmMBDVF94ZCAV4suTyO97Hr9n5jYzuEeorL5+RaLSAY2HJeHZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OgCKXxy4; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OgCKXxy4" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5e058ca6806so3884940a12.3 for ; Fri, 07 Mar 2025 07:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741362525; x=1741967325; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=jPTLdDJPEjOlD3Zz5xzNgaPFDkpvLBBwzGPAK6iywbY=; b=OgCKXxy4zP6ew7Uivj5ZEwyOMLcELY0OyI/2oCdZ+rV6i4pcecQe3zjU+2b0xexgLR pmLLYSId5nlO8ArpG5OQQ9N4YhLxON9ka6/wp5upuQxCJvDwbyVNT4fmm1BJ3thpgFVw rhGY0Z7tuPpXyne8Ge3OGXBuXsO8H3iQW8pmqGBG8/DXXlOKp3388KpNBIR5Q69Ve9AV qj14S9zaGsFBD24+3ciixxaGtqRr3cnbEY5SdJhadepN6x/K+mU3Z67xctaOuR8C3aPM Ddu/hxTwxR1xc1ezLO4GRacFEP0nf2QafUzRvndKFX+6T7+R8SzvyNA7m4qt2YAhiTG/ Vhaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741362525; x=1741967325; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jPTLdDJPEjOlD3Zz5xzNgaPFDkpvLBBwzGPAK6iywbY=; b=PMLXClQmadBq14s8bIxLzMsxy/mCcWHDuV08WfLs25AhjGtXUm2jUpeYS4yJf0Muyz BwoCeR/PE6EGGZ5Sf/uCgwCw5+En01uejKoysOvtkHjN5nnrGQuYj9X3g1yrz3Mo2fvq p6rcrMK90YAt6WsnlPK+l1zvjcCNY1ZmDa0UA/Nzk1ymU3CF7PbtZjuuWByFSGh72bsh zYrAaGoHmXa0SMCK2DZ7WHuAr2hdkgierVhzU7n2yLj23hDtQiAdmydpFdjtRHaOAPpj 3zc7M8uf3+pX+UEGj/eHrPz0O540gBNvpyBHrSdldfyoDksmAxQzxolNIQVLeleQS4v9 jQ6g== X-Gm-Message-State: AOJu0YxeD185uhWSD6o4zj6k9FPtT7FYmkcGPvmbCq7mnWzWdV1fLNas 7mwOZcS21xh6nJ30TCmZz0pcqCBEDhmb8cOhW0qUbZ0Gqbtiimm13j1jyw== X-Gm-Gg: ASbGncv5Oda865QgyGxqXaz7HQVoKPQsiMRKcr3nX6qB0q5x0YTLCv9LOjq/kVN4bJy 91Y+lzGli3MJnS5z77V2t+QQ/Oi9gQqDJexWrNCjMooXAccQ69q5KCuhTxZBiVUeyhn5X1ceD90 ICr/I2XFt5Ey/1sTT6HPhe+5U8Z8Msfo9L7EqwjN7E3ulxBclc1735VBaDY6JVZ+i82qdyTg/+F J1oQ4vjzODtXDdVaBo6IHbyTdkG7VqLmgdWTeYnD+Av6jvQnCYEawMcMA63BcWiYEPhTAJnhRmK groksrkgVIpT/HwmyHd+wme1EPy83+yBaMb69sNjulQdCA== X-Google-Smtp-Source: AGHT+IEVV4aJu+9BdgJQTv/Iv1ZlzRw19/6BiGGHq4BMfb1fF9CFN2gMmDrg1KWzT6lXySIgnXRIAA== X-Received: by 2002:a05:6402:40cf:b0:5e5:827d:bb1c with SMTP id 4fb4d7f45d1cf-5e5e24a5366mr3843501a12.25.1741362525441; Fri, 07 Mar 2025 07:48:45 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e5c733fcd2sm2696902a12.2.2025.03.07.07.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 07:48:45 -0800 (PST) Message-Id: In-Reply-To: References: Date: Fri, 07 Mar 2025 15:48:42 +0000 Subject: [PATCH 3/3] merge-ort: support having merge verbosity be set to 0 Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , Elijah Newren From: Elijah Newren From: Elijah Newren Various callers such as am & checkout set the merge verbosity to 0 to avoid having conflict messages printed. While this could be achieved by avoiding the wrappers from merge-ort-wrappers and instead passing 0 for display_update_msgs to merge_switch_to_result(), for simplicity of converting callers simply allow them to also achieve this with the merge-ort-wrappers by setting verbosity to 0. Signed-off-by: Elijah Newren --- merge-ort.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/merge-ort.c b/merge-ort.c index a6960b6a1b4..8021083c112 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -799,6 +799,8 @@ static void path_msg(struct merge_options *opt, return; /* Do not record mere hints in headers */ if (opt->priv->call_depth && opt->verbosity < 5) return; /* Ignore messages from inner merges */ + if (!opt->verbosity) + return; /* Ensure path_conflicts (ptr to array of logical_conflict) allocated */ path_conflicts = strmap_get(&opt->priv->conflicts, primary_path);