git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up)
@ 2024-03-09 14:09 Johannes Schindelin via GitGitGadget
  2024-03-09 14:09 ` [PATCH 1/2] merge-recursive: prepare for `merge_submodule()` to report errors Johannes Schindelin via GitGitGadget
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-03-09 14:09 UTC (permalink / raw
  To: git; +Cc: Patrick Steinhardt, Dirk Gouders, Jeff King, Johannes Schindelin

Jeff King reported that Coverity pointed out a problem in the patch series
"The merge-base logic vs missing commit objects" (which made it into the
next branch already): The return value of merge_submodules() is assigned to
an unsigned, single-bit variable, which as a consequence is not able to hold
a negative value indicating a non-recoverable error.

I looked into this issue and am happy to report that there are no other
instances of the same issue in that patch series. The first patch in this
here patch series addresses that issue.

While looking into this issue I also noticed that the merge_submodule()
function did not even return negative values! This was an oversight on my
part (which I attribute with a large amount of self-compassion to my utter
lack of enthusiasm for submodules as a Git feature), and the second patch in
this here patch series addresses that.

This is a follow-up for
https://lore.kernel.org/git/pull.1657.v4.git.1709113457.gitgitgadget@gmail.com/,
based on the js/merge-base-with-missing-commit branch.

Johannes Schindelin (2):
  merge-recursive: prepare for `merge_submodule()` to report errors
  merge-ort/merge-recursive: do report errors in `merge_submodule()`

 merge-ort.c       |  5 +++++
 merge-recursive.c | 21 +++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)


base-commit: caaf1a2942c25c1f1a15818b718c9f641e52beef
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1686%2Fdscho%2Fmerge-base-and-missing-objects-followup-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1686/dscho/merge-base-and-missing-objects-followup-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1686
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] merge-recursive: prepare for `merge_submodule()` to report errors
  2024-03-09 14:09 [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Johannes Schindelin via GitGitGadget
@ 2024-03-09 14:09 ` Johannes Schindelin via GitGitGadget
  2024-03-09 14:09 ` [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()` Johannes Schindelin via GitGitGadget
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-03-09 14:09 UTC (permalink / raw
  To: git
  Cc: Patrick Steinhardt, Dirk Gouders, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

The `merge_submodule()` function returns an integer that indicates
whether the merge was clean (returning 1) or unclean (returning 0).

Like the version in `merge-ort.c`, the version in `merge-recursive.c`
does not report any errors (such as repository corruption) by returning
-1 as of time of writing, even if the callers in `merge-ort.c` are
prepared for exactly such errors.

However, we want to teach (both variants of) the `merge_submodule()`
function that trick: to report errors by returning -1. Therefore,
prepare the caller in `merge-recursive.c` to handle that scenario.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 merge-recursive.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index 32e9d6665de..f3132a9ecae 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1426,13 +1426,14 @@ static int merge_mode_and_contents(struct merge_options *opt,
 			/* FIXME: bug, what if modes didn't match? */
 			result->clean = (merge_status == 0);
 		} else if (S_ISGITLINK(a->mode)) {
-			result->clean = merge_submodule(opt, &result->blob.oid,
-							o->path,
-							&o->oid,
-							&a->oid,
-							&b->oid);
-			if (result->clean < 0)
+			int clean = merge_submodule(opt, &result->blob.oid,
+						    o->path,
+						    &o->oid,
+						    &a->oid,
+						    &b->oid);
+			if (clean < 0)
 				return -1;
+			result->clean = clean;
 		} else if (S_ISLNK(a->mode)) {
 			switch (opt->recursive_variant) {
 			case MERGE_VARIANT_NORMAL:
-- 
gitgitgadget



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()`
  2024-03-09 14:09 [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Johannes Schindelin via GitGitGadget
  2024-03-09 14:09 ` [PATCH 1/2] merge-recursive: prepare for `merge_submodule()` to report errors Johannes Schindelin via GitGitGadget
@ 2024-03-09 14:09 ` Johannes Schindelin via GitGitGadget
  2024-03-09 17:56   ` Junio C Hamano
  2024-03-09 16:51 ` [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Elijah Newren
  2024-03-09 17:45 ` Junio C Hamano
  3 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-03-09 14:09 UTC (permalink / raw
  To: git
  Cc: Patrick Steinhardt, Dirk Gouders, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In 24876ebf68b (commit-reach(repo_in_merge_bases_many): report missing
commits, 2024-02-28), I taught `merge_submodule()` to handle errors
reported by `repo_in_merge_bases_many()`.

However, those errors were not passed through to the callers. That was
unintentional, and this commit remedies that.

Note that `find_first_merges()` can now also return -1 (because it
passes through that return value from `repo_in_merge_bases()`), and this
commit also adds the forgotten handling for that scenario.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 merge-ort.c       | 5 +++++
 merge-recursive.c | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/merge-ort.c b/merge-ort.c
index 033c4348e2d..5d36c04f509 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -1819,6 +1819,7 @@ static int merge_submodule(struct merge_options *opt,
 			 _("Failed to merge submodule %s "
 			   "(repository corrupt)"),
 			 path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2 > 0)
@@ -1829,6 +1830,7 @@ static int merge_submodule(struct merge_options *opt,
 			 _("Failed to merge submodule %s "
 			   "(repository corrupt)"),
 			 path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (!ret2) {
@@ -1848,6 +1850,7 @@ static int merge_submodule(struct merge_options *opt,
 			 _("Failed to merge submodule %s "
 			   "(repository corrupt)"),
 			 path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2 > 0) {
@@ -1866,6 +1869,7 @@ static int merge_submodule(struct merge_options *opt,
 			 _("Failed to merge submodule %s "
 			   "(repository corrupt)"),
 			 path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2 > 0) {
@@ -1899,6 +1903,7 @@ static int merge_submodule(struct merge_options *opt,
 			 _("Failed to merge submodule %s "
 			   "(repository corrupt)"),
 			 path);
+		ret = -1;
 		break;
 	case 0:
 		path_msg(opt, CONFLICT_SUBMODULE_FAILED_TO_MERGE, 0,
diff --git a/merge-recursive.c b/merge-recursive.c
index f3132a9ecae..fc772c2b113 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1246,12 +1246,14 @@ static int merge_submodule(struct merge_options *opt,
 	ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_a);
 	if (ret2 < 0) {
 		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2 > 0)
 		ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_b);
 	if (ret2 < 0) {
 		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (!ret2) {
@@ -1263,6 +1265,7 @@ static int merge_submodule(struct merge_options *opt,
 	ret2 = repo_in_merge_bases(&subrepo, commit_a, commit_b);
 	if (ret2 < 0) {
 		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2) {
@@ -1281,6 +1284,7 @@ static int merge_submodule(struct merge_options *opt,
 	ret2 = repo_in_merge_bases(&subrepo, commit_b, commit_a);
 	if (ret2 < 0) {
 		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
+		ret = -1;
 		goto cleanup;
 	}
 	if (ret2) {
@@ -1312,6 +1316,10 @@ static int merge_submodule(struct merge_options *opt,
 	parent_count = find_first_merges(&subrepo, &merges, path,
 					 commit_a, commit_b);
 	switch (parent_count) {
+	case -1:
+		output(opt, 1,_("Failed to merge submodule %s (repository corrupt)"), path);
+		ret = -1;
+		break;
 	case 0:
 		output(opt, 1, _("Failed to merge submodule %s (merge following commits not found)"), path);
 		break;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up)
  2024-03-09 14:09 [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Johannes Schindelin via GitGitGadget
  2024-03-09 14:09 ` [PATCH 1/2] merge-recursive: prepare for `merge_submodule()` to report errors Johannes Schindelin via GitGitGadget
  2024-03-09 14:09 ` [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()` Johannes Schindelin via GitGitGadget
@ 2024-03-09 16:51 ` Elijah Newren
  2024-03-09 17:56   ` Junio C Hamano
  2024-03-09 17:45 ` Junio C Hamano
  3 siblings, 1 reply; 9+ messages in thread
From: Elijah Newren @ 2024-03-09 16:51 UTC (permalink / raw
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Patrick Steinhardt, Dirk Gouders, Jeff King,
	Johannes Schindelin

On Sat, Mar 9, 2024 at 6:10 AM Johannes Schindelin via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> Jeff King reported that Coverity pointed out a problem in the patch series
> "The merge-base logic vs missing commit objects" (which made it into the
> next branch already): The return value of merge_submodules() is assigned to
> an unsigned, single-bit variable, which as a consequence is not able to hold
> a negative value indicating a non-recoverable error.
>
> I looked into this issue and am happy to report that there are no other
> instances of the same issue in that patch series. The first patch in this
> here patch series addresses that issue.
>
> While looking into this issue I also noticed that the merge_submodule()
> function did not even return negative values! This was an oversight on my
> part (which I attribute with a large amount of self-compassion to my utter
> lack of enthusiasm for submodules as a Git feature), and the second patch in
> this here patch series addresses that.
>
> This is a follow-up for
> https://lore.kernel.org/git/pull.1657.v4.git.1709113457.gitgitgadget@gmail.com/,
> based on the js/merge-base-with-missing-commit branch.

This series looks good to me; thanks.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up)
  2024-03-09 14:09 [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Johannes Schindelin via GitGitGadget
                   ` (2 preceding siblings ...)
  2024-03-09 16:51 ` [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Elijah Newren
@ 2024-03-09 17:45 ` Junio C Hamano
  3 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2024-03-09 17:45 UTC (permalink / raw
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Patrick Steinhardt, Dirk Gouders, Jeff King,
	Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> Jeff King reported that Coverity pointed out a problem in the patch series
> "The merge-base logic vs missing commit objects" (which made it into the
> next branch already): The return value of merge_submodules() is assigned to
> an unsigned, single-bit variable, which as a consequence is not able to hold
> a negative value indicating a non-recoverable error.
>
> I looked into this issue and am happy to report that there are no other
> instances of the same issue in that patch series. The first patch in this
> here patch series addresses that issue.
>
> While looking into this issue I also noticed that the merge_submodule()
> function did not even return negative values! This was an oversight on my
> part (which I attribute with a large amount of self-compassion to my utter
> lack of enthusiasm for submodules as a Git feature), and the second patch in
> this here patch series addresses that.
>
> This is a follow-up for
> https://lore.kernel.org/git/pull.1657.v4.git.1709113457.gitgitgadget@gmail.com/,
> based on the js/merge-base-with-missing-commit branch.

Thanks.

>
> Johannes Schindelin (2):
>   merge-recursive: prepare for `merge_submodule()` to report errors
>   merge-ort/merge-recursive: do report errors in `merge_submodule()`
>
>  merge-ort.c       |  5 +++++
>  merge-recursive.c | 21 +++++++++++++++------
>  2 files changed, 20 insertions(+), 6 deletions(-)
>
>
> base-commit: caaf1a2942c25c1f1a15818b718c9f641e52beef
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1686%2Fdscho%2Fmerge-base-and-missing-objects-followup-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1686/dscho/merge-base-and-missing-objects-followup-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1686


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()`
  2024-03-09 14:09 ` [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()` Johannes Schindelin via GitGitGadget
@ 2024-03-09 17:56   ` Junio C Hamano
  2024-03-09 20:46     ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2024-03-09 17:56 UTC (permalink / raw
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Patrick Steinhardt, Dirk Gouders, Jeff King,
	Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In 24876ebf68b (commit-reach(repo_in_merge_bases_many): report missing
> commits, 2024-02-28), I taught `merge_submodule()` to handle errors
> reported by `repo_in_merge_bases_many()`.
>
> However, those errors were not passed through to the callers. That was
> unintentional, and this commit remedies that.
>
> Note that `find_first_merges()` can now also return -1 (because it
> passes through that return value from `repo_in_merge_bases()`), and this
> commit also adds the forgotten handling for that scenario.

Good clean-up.  But this "oops, we did not check for errors" makes
me wonder if we are better off adopting "by default we assume an
error, until we are sure we are good" pattern, i.e.

        func()
        {
                int ret = -1; /* assume worst */

                do stuff;
                if (...) {
                        error(_("this is bad"));
                        goto cleanup;
                }
                do stuff;
                if (...) {
                        error(_("this is bad, too"));
                        goto cleanup;
                }

                /* ok we are happy */
                ret = 0;

        cleanup:
                release resources;
                return ret;
        }

The patch to both functions do make it appear that they are good
candidates for application of the pattern to me.

Thanks.

> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  merge-ort.c       | 5 +++++
>  merge-recursive.c | 8 ++++++++
>  2 files changed, 13 insertions(+)
>
> diff --git a/merge-ort.c b/merge-ort.c
> index 033c4348e2d..5d36c04f509 100644
> --- a/merge-ort.c
> +++ b/merge-ort.c
> @@ -1819,6 +1819,7 @@ static int merge_submodule(struct merge_options *opt,
>  			 _("Failed to merge submodule %s "
>  			   "(repository corrupt)"),
>  			 path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2 > 0)
> @@ -1829,6 +1830,7 @@ static int merge_submodule(struct merge_options *opt,
>  			 _("Failed to merge submodule %s "
>  			   "(repository corrupt)"),
>  			 path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (!ret2) {
> @@ -1848,6 +1850,7 @@ static int merge_submodule(struct merge_options *opt,
>  			 _("Failed to merge submodule %s "
>  			   "(repository corrupt)"),
>  			 path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2 > 0) {
> @@ -1866,6 +1869,7 @@ static int merge_submodule(struct merge_options *opt,
>  			 _("Failed to merge submodule %s "
>  			   "(repository corrupt)"),
>  			 path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2 > 0) {
> @@ -1899,6 +1903,7 @@ static int merge_submodule(struct merge_options *opt,
>  			 _("Failed to merge submodule %s "
>  			   "(repository corrupt)"),
>  			 path);
> +		ret = -1;
>  		break;
>  	case 0:
>  		path_msg(opt, CONFLICT_SUBMODULE_FAILED_TO_MERGE, 0,
> diff --git a/merge-recursive.c b/merge-recursive.c
> index f3132a9ecae..fc772c2b113 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -1246,12 +1246,14 @@ static int merge_submodule(struct merge_options *opt,
>  	ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_a);
>  	if (ret2 < 0) {
>  		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2 > 0)
>  		ret2 = repo_in_merge_bases(&subrepo, commit_base, commit_b);
>  	if (ret2 < 0) {
>  		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (!ret2) {
> @@ -1263,6 +1265,7 @@ static int merge_submodule(struct merge_options *opt,
>  	ret2 = repo_in_merge_bases(&subrepo, commit_a, commit_b);
>  	if (ret2 < 0) {
>  		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2) {
> @@ -1281,6 +1284,7 @@ static int merge_submodule(struct merge_options *opt,
>  	ret2 = repo_in_merge_bases(&subrepo, commit_b, commit_a);
>  	if (ret2 < 0) {
>  		output(opt, 1, _("Failed to merge submodule %s (repository corrupt)"), path);
> +		ret = -1;
>  		goto cleanup;
>  	}
>  	if (ret2) {
> @@ -1312,6 +1316,10 @@ static int merge_submodule(struct merge_options *opt,
>  	parent_count = find_first_merges(&subrepo, &merges, path,
>  					 commit_a, commit_b);
>  	switch (parent_count) {
> +	case -1:
> +		output(opt, 1,_("Failed to merge submodule %s (repository corrupt)"), path);
> +		ret = -1;
> +		break;
>  	case 0:
>  		output(opt, 1, _("Failed to merge submodule %s (merge following commits not found)"), path);
>  		break;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up)
  2024-03-09 16:51 ` [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Elijah Newren
@ 2024-03-09 17:56   ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2024-03-09 17:56 UTC (permalink / raw
  To: Elijah Newren
  Cc: Johannes Schindelin via GitGitGadget, git, Patrick Steinhardt,
	Dirk Gouders, Jeff King, Johannes Schindelin

Elijah Newren <newren@gmail.com> writes:

>> This is a follow-up for
>> https://lore.kernel.org/git/pull.1657.v4.git.1709113457.gitgitgadget@gmail.com/,
>> based on the js/merge-base-with-missing-commit branch.
>
> This series looks good to me; thanks.

Thanks, both.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()`
  2024-03-09 17:56   ` Junio C Hamano
@ 2024-03-09 20:46     ` Johannes Schindelin
  2024-03-09 23:18       ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2024-03-09 20:46 UTC (permalink / raw
  To: Junio C Hamano
  Cc: Johannes Schindelin via GitGitGadget, git, Patrick Steinhardt,
	Dirk Gouders, Jeff King

Hi Junio,

On Sat, 9 Mar 2024, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > In 24876ebf68b (commit-reach(repo_in_merge_bases_many): report missing
> > commits, 2024-02-28), I taught `merge_submodule()` to handle errors
> > reported by `repo_in_merge_bases_many()`.
> >
> > However, those errors were not passed through to the callers. That was
> > unintentional, and this commit remedies that.
> >
> > Note that `find_first_merges()` can now also return -1 (because it
> > passes through that return value from `repo_in_merge_bases()`), and this
> > commit also adds the forgotten handling for that scenario.
>
> Good clean-up.  But this "oops, we did not check for errors" makes
> me wonder if we are better off adopting "by default we assume an
> error, until we are sure we are good" pattern, i.e.
>
>         func()
>         {
>                 int ret = -1; /* assume worst */
>
>                 do stuff;
>                 if (...) {
>                         error(_("this is bad"));
>                         goto cleanup;
>                 }
>                 do stuff;
>                 if (...) {
>                         error(_("this is bad, too"));
>                         goto cleanup;
>                 }
>
>                 /* ok we are happy */
>                 ret = 0;
>
>         cleanup:
>                 release resources;
>                 return ret;
>         }
>
> The patch to both functions do make it appear that they are good
> candidates for application of the pattern to me.

This is a very fitting pattern here, and it is in fact used already! It is
used with `ret = 0`, though, to indicate unclean merges.

This makes sense, as most of the specifically-handled cases have that
outcome. By my counting, 5 of the handled cases result in ret = -1, i.e.
non-recoverable errors, but 8 of the cases result in ret = 0, i.e. unclean
merges, whereas only 2 cases return 1, i.e. clean merges.

Those numbers are for the `merge_submodule()` variant in `merge-ort.c`. In
`merge-recursive.c`, by my counting there are 10 instead of 8 `ret = 0`
cases, the other two numbers are the same.

Ciao,
Johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()`
  2024-03-09 20:46     ` Johannes Schindelin
@ 2024-03-09 23:18       ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2024-03-09 23:18 UTC (permalink / raw
  To: Johannes Schindelin
  Cc: Johannes Schindelin via GitGitGadget, git, Patrick Steinhardt,
	Dirk Gouders, Jeff King

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> By my counting, 5 of the handled cases result in ret = -1, i.e.
> non-recoverable errors, but 8 of the cases result in ret = 0,
> i.e. unclean merges, whereas only 2 cases return 1, i.e. clean
> merges.

Sounds good.  Thanks.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-09 23:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-09 14:09 [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Johannes Schindelin via GitGitGadget
2024-03-09 14:09 ` [PATCH 1/2] merge-recursive: prepare for `merge_submodule()` to report errors Johannes Schindelin via GitGitGadget
2024-03-09 14:09 ` [PATCH 2/2] merge-ort/merge-recursive: do report errors in `merge_submodule()` Johannes Schindelin via GitGitGadget
2024-03-09 17:56   ` Junio C Hamano
2024-03-09 20:46     ` Johannes Schindelin
2024-03-09 23:18       ` Junio C Hamano
2024-03-09 16:51 ` [PATCH 0/2] The merge-base logic vs missing commit objects (follow-up) Elijah Newren
2024-03-09 17:56   ` Junio C Hamano
2024-03-09 17:45 ` Junio C Hamano

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