From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>, Elijah Newren <newren@gmail.com>
Subject: [PATCH 5/7] merge-ort: add function grouping comments
Date: Thu, 03 Dec 2020 15:59:44 +0000 [thread overview]
Message-ID: <181627c30cc1995b66eb5659e54737d05964f8a1.1607011187.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.803.git.1607011187.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
Commit b658536f59 ("merge-ort: add some high-level algorithm structure",
2020-10-27) added high-level structure of the ort merge algorithm. As
we have added more and more functions, that high-level structure has
been slightly obscured. Since functions are still grouped according to
this high-level structure, add comments denoting sections where all the
functions are specifically tied to a piece of the high-level structure.
This function groupings include a few sub-divisions of the original
high-level structure, including some sub-divisions that are yet to be
submitted. Each has (or will have) several functions all serving as
helpers to one or two main functions for each section.
As an added bonus, the comments will serve to provide a small textual
separation between nearby sections and allow the next three patch series
to be submitted independently and merge cleanly.
Signed-off-by: Elijah Newren <newren@gmail.com>
---
merge-ort.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/merge-ort.c b/merge-ort.c
index 89b9fdb04a..e653ba35ea 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -183,6 +183,8 @@ struct conflict_info {
unsigned match_mask:3;
};
+/*** Function Grouping: various utility functions ***/
+
/*
* For the next three macros, see warning for conflict_info.merged.
*
@@ -263,6 +265,8 @@ static int err(struct merge_options *opt, const char *err, ...)
return -1;
}
+/*** Function Grouping: functions related to collect_merge_info() ***/
+
static void setup_path_info(struct merge_options *opt,
struct string_list_item *result,
const char *current_dir_name,
@@ -517,6 +521,15 @@ static int collect_merge_info(struct merge_options *opt,
return ret;
}
+/*** Function Grouping: functions related to threeway content merges ***/
+
+/*** Function Grouping: functions related to detect_and_process_renames(), ***
+ *** which are split into directory and regular rename detection sections. ***/
+
+/*** Function Grouping: functions related to directory rename detection ***/
+
+/*** Function Grouping: functions related to regular rename detection ***/
+
static int detect_and_process_renames(struct merge_options *opt,
struct tree *merge_base,
struct tree *side1,
@@ -534,6 +547,8 @@ static int detect_and_process_renames(struct merge_options *opt,
return clean;
}
+/*** Function Grouping: functions related to process_entries() ***/
+
static int string_list_df_name_compare(const char *one, const char *two)
{
int onelen = strlen(one);
@@ -1001,6 +1016,8 @@ static void process_entries(struct merge_options *opt,
string_list_clear(&dir_metadata.offsets, 0);
}
+/*** Function Grouping: functions related to merge_switch_to_result() ***/
+
static int checkout(struct merge_options *opt,
struct tree *prev,
struct tree *next)
@@ -1189,6 +1206,8 @@ void merge_finalize(struct merge_options *opt,
FREE_AND_NULL(opti);
}
+/*** Function Grouping: helper functions for merge_incore_*() ***/
+
static void merge_start(struct merge_options *opt, struct merge_result *result)
{
/* Sanity checks on opt */
@@ -1239,6 +1258,8 @@ static void merge_start(struct merge_options *opt, struct merge_result *result)
string_list_init(&opt->priv->paths_to_free, 0);
}
+/*** Function Grouping: merge_incore_*() and their internal variants ***/
+
/*
* Originally from merge_trees_internal(); heavily adapted, though.
*/
--
gitgitgadget
next prev parent reply other threads:[~2020-12-03 16:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 15:59 [PATCH 0/7] merge-ort: some groundwork for further implementation Elijah Newren via GitGitGadget
2020-12-03 15:59 ` [PATCH 1/7] merge-ort: add a few includes Elijah Newren via GitGitGadget
2020-12-03 15:59 ` [PATCH 2/7] merge-ort: add a clear_internal_opts helper Elijah Newren via GitGitGadget
2020-12-03 17:00 ` Derrick Stolee
2020-12-03 15:59 ` [PATCH 3/7] merge-ort: add a path_conflict field to merge_options_internal Elijah Newren via GitGitGadget
2020-12-03 15:59 ` [PATCH 4/7] merge-ort: add a paths_to_free " Elijah Newren via GitGitGadget
2020-12-03 15:59 ` Elijah Newren via GitGitGadget [this message]
2020-12-03 15:59 ` [PATCH 6/7] merge-ort: add die-not-implemented stub handle_content_merge() function Elijah Newren via GitGitGadget
2020-12-03 18:40 ` Derrick Stolee
2020-12-03 19:56 ` Elijah Newren
2020-12-03 15:59 ` [PATCH 7/7] merge-ort: add modify/delete handling and delayed output processing Elijah Newren via GitGitGadget
2020-12-04 17:26 ` [PATCH 0/7] merge-ort: some groundwork for further implementation Derrick Stolee
2020-12-04 18:40 ` Elijah Newren
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=181627c30cc1995b66eb5659e54737d05964f8a1.1607011187.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--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.
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).