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

[PATCH v2 2/2] merge-ort: do leave Trace2 region even if checkout fails

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 29, 2022, 17:12 UTC
Message-ID
<d2e1af0f922ea5316074dd0867c66650161b0ab5.1659114727.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1307.v2.git.1659114727.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

In 557ac0350d9 (merge-ort: begin performance work; instrument with trace2_region_* calls, 2021-01-23), we added Trace2 instrumentation, but in the error path that returns early, we forgot to tell Trace2 that we're leaving the region. Let's fix that.

Pointed-out-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 merge-ort.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/merge-ort.c b/merge-ort.c
index e820e45a8e8..eb0296902ad 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -3158,6 +3158,7 @@ void merge_switch_to_result(struct merge_options *opt,
 			/* failure to function */
 			result->clean = -1;
 			merge_finalize(opt, result);
+			trace2_region_leave("merge", "checkout", opt->repo);
 			return;
 		}
 		trace2_region_leave("merge", "checkout", opt->repo);
@@ -3169,6 +3170,8 @@ void merge_switch_to_result(struct merge_options *opt,
 			/* failure to function */
 			result->clean = -1;
 			merge_finalize(opt, result);
+			trace2_region_leave("merge", "record_conflicted",
+					    opt->repo);
 			return;
 		}
 		trace2_region_leave("merge", "record_conflicted", opt->repo);
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Elijah Newren
Message 5 of 7 in “merge-ort: clean up after failed merge”
  1. merge-ort: clean up after failed mergeJohannes Schindelin via GitGitGadget, Jul 29, 2022
  2. Elijah NewrenJul 29, 2022
  3. 0/2 merge-ort: clean up after failed mergeJohannes Schindelin via GitGitGadget, Jul 29, 2022
  4. 1/2 merge-ort: clean up after failed mergeJohannes Schindelin via GitGitGadget, Jul 29, 2022
  5. 2/2 merge-ort: do leave Trace2 region even if checkout failsJohannes Schindelin via GitGitGadget, Jul 29, 2022
  6. Elijah NewrenJul 30, 2022
  7. Junio C HamanoJul 31, 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.