summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Sergey Organov <sorganov@gmail.com>2020-12-21 18:19:37 +0300
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-21 13:47:31 -0800
commit564a4fc8471b41fc05bda16e4bbb02a99b515cbf (patch)
tree6afadc528467d146595b7fe3bd96869cebeb91bc
parentdiff-merges: rename diff_merges_default_to_enable() to match semantics (diff)
downloadtgif-564a4fc8471b41fc05bda16e4bbb02a99b515cbf.tar.xz
diff-merges: re-arrange functions to match the order they are called in
For clarity, define public functions in the order they are called, to make logic inter-dependencies easier to grok. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--diff-merges.c24
-rw-r--r--diff-merges.h5
2 files changed, 16 insertions, 13 deletions
diff --git a/diff-merges.c b/diff-merges.c
index 76c8045797..8325ab8801 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -2,6 +2,10 @@
#include "revision.h"
+/*
+ * Public functions. They are in the order they are called.
+ */
+
void diff_merges_init_revs(struct rev_info *revs)
{
revs->ignore_merges = -1;
@@ -46,16 +50,6 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
return argcount;
}
-void diff_merges_setup_revs(struct rev_info *revs)
-{
- if (revs->combine_merges && revs->ignore_merges < 0)
- revs->ignore_merges = 0;
- if (revs->ignore_merges < 0)
- revs->ignore_merges = 1;
- if (revs->combined_all_paths && !revs->combine_merges)
- die("--combined-all-paths makes no sense without -c or --cc");
-}
-
void diff_merges_default_to_first_parent(struct rev_info *revs)
{
if (revs->ignore_merges < 0) /* No -m */
@@ -72,3 +66,13 @@ void diff_merges_default_to_dense_combined(struct rev_info *revs)
}
}
}
+
+void diff_merges_setup_revs(struct rev_info *revs)
+{
+ if (revs->combine_merges && revs->ignore_merges < 0)
+ revs->ignore_merges = 0;
+ if (revs->ignore_merges < 0)
+ revs->ignore_merges = 1;
+ if (revs->combined_all_paths && !revs->combine_merges)
+ die("--combined-all-paths makes no sense without -c or --cc");
+}
diff --git a/diff-merges.h b/diff-merges.h
index 18861dc548..243ef915c4 100644
--- a/diff-merges.h
+++ b/diff-merges.h
@@ -13,11 +13,10 @@ void diff_merges_init_revs(struct rev_info *revs);
int diff_merges_parse_opts(struct rev_info *revs, const char **argv);
-void diff_merges_setup_revs(struct rev_info *revs);
+void diff_merges_default_to_first_parent(struct rev_info *revs);
void diff_merges_default_to_dense_combined(struct rev_info *revs);
-void diff_merges_default_to_first_parent(struct rev_info *revs);
-
+void diff_merges_setup_revs(struct rev_info *revs);
#endif