summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Sergey Organov <sorganov@gmail.com>2020-12-21 18:19:34 +0300
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-21 13:47:30 -0800
commit18f09473bf8685a1f8db254cff915d4c31e86406 (patch)
tree699884da0486d3cb3b3b4c25388f6059457e8f3f
parentrevision: move diff merges functions to its own diff-merges.c (diff)
downloadtgif-18f09473bf8685a1f8db254cff915d4c31e86406.tar.xz
diff-merges: rename all functions to have common prefix
Use the same "diff_merges" prefix for all the diff merges function names. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/log.c4
-rw-r--r--diff-merges.c10
-rw-r--r--diff-merges.h15
-rw-r--r--revision.c6
4 files changed, 20 insertions, 15 deletions
diff --git a/builtin/log.c b/builtin/log.c
index ad3092fdd8..77a7bba543 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -599,7 +599,7 @@ static int show_tree_object(const struct object_id *oid,
static void show_setup_revisions_tweak(struct rev_info *rev,
struct setup_revision_opt *opt)
{
- rev_diff_merges_default_to_dense_combined(rev);
+ diff_merges_default_to_dense_combined(rev);
if (!rev->diffopt.output_format)
rev->diffopt.output_format = DIFF_FORMAT_PATCH;
}
@@ -724,7 +724,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
if (!rev->diffopt.output_format && rev->combine_merges)
rev->diffopt.output_format = DIFF_FORMAT_PATCH;
- rev_diff_merges_first_parent_defaults_to_enable(rev);
+ diff_merges_first_parent_defaults_to_enable(rev);
}
int cmd_log(int argc, const char **argv, const char *prefix)
diff --git a/diff-merges.c b/diff-merges.c
index 0204292aa9..9286dbbd4d 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -2,12 +2,12 @@
#include "revision.h"
-void init_diff_merge_revs(struct rev_info *revs)
+void diff_merges_init_revs(struct rev_info *revs)
{
revs->ignore_merges = -1;
}
-int parse_diff_merge_opts(struct rev_info *revs, const char **argv)
+int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
{
int argcount = 1;
const char *optarg;
@@ -46,7 +46,7 @@ int parse_diff_merge_opts(struct rev_info *revs, const char **argv)
return argcount;
}
-void setup_diff_merges_revs(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;
@@ -56,13 +56,13 @@ void setup_diff_merges_revs(struct rev_info *revs)
die("--combined-all-paths makes no sense without -c or --cc");
}
-void rev_diff_merges_first_parent_defaults_to_enable(struct rev_info *revs)
+void diff_merges_first_parent_defaults_to_enable(struct rev_info *revs)
{
if (revs->first_parent_only && revs->ignore_merges < 0)
revs->ignore_merges = 0;
}
-void rev_diff_merges_default_to_dense_combined(struct rev_info *revs)
+void diff_merges_default_to_dense_combined(struct rev_info *revs)
{
if (revs->ignore_merges < 0) {
/* There was no "-m" variant on the command line */
diff --git a/diff-merges.h b/diff-merges.h
index 7e970b266c..4ced909b79 100644
--- a/diff-merges.h
+++ b/diff-merges.h
@@ -9,10 +9,15 @@
struct rev_info;
-void init_diff_merge_revs(struct rev_info *revs);
-int parse_diff_merge_opts(struct rev_info *revs, const char **argv);
-void setup_diff_merges_revs(struct rev_info *revs);
-void rev_diff_merges_default_to_dense_combined(struct rev_info *revs);
-void rev_diff_merges_first_parent_defaults_to_enable(struct rev_info *revs);
+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_dense_combined(struct rev_info *revs);
+
+void diff_merges_first_parent_defaults_to_enable(struct rev_info *revs);
+
#endif
diff --git a/revision.c b/revision.c
index 4bc14a08a6..5a0e3d6ad5 100644
--- a/revision.c
+++ b/revision.c
@@ -1814,7 +1814,7 @@ void repo_init_revisions(struct repository *r,
revs->repo = r;
revs->abbrev = DEFAULT_ABBREV;
- init_diff_merge_revs(revs);
+ diff_merges_init_revs(revs);
revs->simplify_history = 1;
revs->pruning.repo = r;
revs->pruning.flags.recursive = 1;
@@ -2350,7 +2350,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->diff = 1;
revs->diffopt.flags.recursive = 1;
revs->diffopt.flags.tree_in_recursive = 1;
- } else if ((argcount = parse_diff_merge_opts(revs, argv))) {
+ } else if ((argcount = diff_merges_parse_opts(revs, argv))) {
return argcount;
} else if (!strcmp(arg, "-v")) {
revs->verbose_header = 1;
@@ -2849,7 +2849,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
&revs->prune_data);
}
- setup_diff_merges_revs(revs);
+ diff_merges_setup_revs(revs);
revs->diffopt.abbrev = revs->abbrev;