]> git.ipfire.org Git - thirdparty/git.git/blobdiff - merge-ort.h
scalar-diagnose: add directory to archiver more gently
[thirdparty/git.git] / merge-ort.h
index c011864ffeb115b43a26940a8f0b24d33c8e8182..a994c9a5fcdb040b3ecb80db0489a50c1394ac75 100644 (file)
@@ -2,9 +2,11 @@
 #define MERGE_ORT_H
 
 #include "merge-recursive.h"
+#include "hash.h"
 
 struct commit;
 struct tree;
+struct strmap;
 
 struct merge_result {
        /*
@@ -23,6 +25,15 @@ struct merge_result {
         */
        struct tree *tree;
 
+       /*
+        * Special messages and conflict notices for various paths
+        *
+        * This is a map of pathnames to a string_list. It contains various
+        * warning/conflict/notice messages (possibly multiple per path)
+        * that callers may want to use.
+        */
+       struct strmap *path_messages;
+
        /*
         * Additional metadata used by merge_switch_to_result() or future calls
         * to merge_incore_*().  Includes data needed to update the index (if
@@ -70,6 +81,35 @@ void merge_switch_to_result(struct merge_options *opt,
                            int update_worktree_and_index,
                            int display_update_msgs);
 
+/*
+ * Display messages about conflicts and which files were 3-way merged.
+ * Automatically called by merge_switch_to_result() with stream == stdout,
+ * so only call this when bypassing merge_switch_to_result().
+ */
+void merge_display_update_messages(struct merge_options *opt,
+                                  int detailed,
+                                  struct merge_result *result);
+
+struct stage_info {
+       struct object_id oid;
+       int mode;
+       int stage;
+};
+
+/*
+ * Provide a list of path -> {struct stage_info*} mappings for
+ * all conflicted files.  Note that each path could appear up to three
+ * times in the list, corresponding to 3 different stage entries.  In short,
+ * this basically provides the info that would be printed by `ls-files -u`.
+ *
+ * result should have been populated by a call to
+ * one of the merge_incore_[non]recursive() functions.
+ *
+ * conflicted_files should be empty before calling this function.
+ */
+void merge_get_conflicted_files(struct merge_result *result,
+                               struct string_list *conflicted_files);
+
 /* Do needed cleanup when not calling merge_switch_to_result() */
 void merge_finalize(struct merge_options *opt,
                    struct merge_result *result);