git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org
Cc: Stefan Beller <sbeller@google.com>
Subject: [PATCH 5/7] diff.c: rename color_moved to markup_moved
Date: Fri,  3 Aug 2018 18:53:15 -0700	[thread overview]
Message-ID: <20180804015317.182683-6-sbeller@google.com> (raw)
In-Reply-To: <20180804015317.182683-1-sbeller@google.com>

This just renames a variable to make the next patch easier to review.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 diff.c | 28 ++++++++++++++--------------
 diff.h |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/diff.c b/diff.c
index 2e711809700..d3829c7d086 100644
--- a/diff.c
+++ b/diff.c
@@ -821,7 +821,7 @@ static int shrink_potential_moved_blocks(struct moved_entry **pmb,
 }
 
 /*
- * If o->color_moved is COLOR_MOVED_PLAIN, this function does nothing.
+ * If o->markup_moved is COLOR_MOVED_PLAIN, this function does nothing.
  *
  * Otherwise, if the last block has fewer alphanumeric characters than
  * COLOR_MOVED_MIN_ALNUM_COUNT, unset DIFF_SYMBOL_MOVED_LINE on all lines in
@@ -836,7 +836,7 @@ static int shrink_potential_moved_blocks(struct moved_entry **pmb,
 static void adjust_last_block(struct diff_options *o, int n, int block_length)
 {
 	int i, alnum_count = 0;
-	if (o->color_moved == COLOR_MOVED_PLAIN)
+	if (o->markup_moved == COLOR_MOVED_PLAIN)
 		return;
 	for (i = 1; i < block_length + 1; i++) {
 		const char *c = o->emitted_symbols->buf[n - i].line;
@@ -895,7 +895,7 @@ static void mark_color_as_moved(struct diff_options *o,
 
 		l->flags |= DIFF_SYMBOL_MOVED_LINE;
 
-		if (o->color_moved == COLOR_MOVED_PLAIN)
+		if (o->markup_moved == COLOR_MOVED_PLAIN)
 			continue;
 
 		/* Check any potential block runs, advance each or nullify */
@@ -4220,7 +4220,7 @@ void diff_setup(struct diff_options *options)
 		options->b_prefix = "b/";
 	}
 
-	options->color_moved = diff_color_moved_default;
+	options->markup_moved = diff_color_moved_default;
 }
 
 void diff_setup_done(struct diff_options *options)
@@ -4333,7 +4333,7 @@ void diff_setup_done(struct diff_options *options)
 		die(_("--follow requires exactly one pathspec"));
 
 	if (!options->use_color || external_diff())
-		options->color_moved = 0;
+		options->markup_moved = 0;
 }
 
 static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
@@ -4796,16 +4796,16 @@ int diff_opt_parse(struct diff_options *options,
 		options->use_color = 0;
 	else if (!strcmp(arg, "--color-moved")) {
 		if (diff_color_moved_default)
-			options->color_moved = diff_color_moved_default;
-		if (options->color_moved == COLOR_MOVED_NO)
-			options->color_moved = COLOR_MOVED_DEFAULT;
+			options->markup_moved = diff_color_moved_default;
+		if (options->markup_moved == COLOR_MOVED_NO)
+			options->markup_moved = COLOR_MOVED_DEFAULT;
 	} else if (!strcmp(arg, "--no-color-moved"))
-		options->color_moved = COLOR_MOVED_NO;
+		options->markup_moved = COLOR_MOVED_NO;
 	else if (skip_prefix(arg, "--color-moved=", &arg)) {
 		int cm = parse_color_moved(arg);
 		if (cm < 0)
 			die("bad --color-moved argument: %s", arg);
-		options->color_moved = cm;
+		options->markup_moved = cm;
 	} else if (skip_to_optional_arg_default(arg, "--color-words", &options->word_regex, NULL)) {
 		options->use_color = 1;
 		options->word_diff = DIFF_WORDS_COLOR;
@@ -5623,7 +5623,7 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
 	if (WSEH_NEW & WS_RULE_MASK)
 		BUG("WS rules bit mask overlaps with diff symbol flags");
 
-	if (o->color_moved)
+	if (o->markup_moved)
 		o->emitted_symbols = &esm;
 
 	for (i = 0; i < q->nr; i++) {
@@ -5633,7 +5633,7 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
 	}
 
 	if (o->emitted_symbols) {
-		if (o->color_moved) {
+		if (o->markup_moved) {
 			struct hashmap add_lines, del_lines;
 
 			hashmap_init(&del_lines,
@@ -5643,7 +5643,7 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
 
 			add_lines_to_move_detection(o, &add_lines, &del_lines);
 			mark_color_as_moved(o, &add_lines, &del_lines);
-			if (o->color_moved == COLOR_MOVED_ZEBRA_DIM)
+			if (o->markup_moved == COLOR_MOVED_ZEBRA_DIM)
 				dim_moved_lines(o);
 
 			hashmap_free(&add_lines, 0);
@@ -5731,7 +5731,7 @@ void diff_flush(struct diff_options *options)
 			fclose(options->file);
 		options->file = xfopen("/dev/null", "w");
 		options->close_file = 1;
-		options->color_moved = 0;
+		options->markup_moved = 0;
 		for (i = 0; i < q->nr; i++) {
 			struct diff_filepair *p = q->queue[i];
 			if (check_pair_status(p))
diff --git a/diff.h b/diff.h
index b8bbe7baeb8..0dd1651dda4 100644
--- a/diff.h
+++ b/diff.h
@@ -217,7 +217,7 @@ struct diff_options {
 		COLOR_MOVED_PLAIN = 1,
 		COLOR_MOVED_ZEBRA = 2,
 		COLOR_MOVED_ZEBRA_DIM = 3,
-	} color_moved;
+	} markup_moved;
 	#define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA
 	#define COLOR_MOVED_MIN_ALNUM_COUNT 20
 };
-- 
2.18.0.597.ga71716f1ad-goog


  parent reply	other threads:[~2018-08-04  1:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04  1:53 [PATCH 0/7] improve range-diffs coloring and [RFC] move detection Stefan Beller
2018-08-04  1:53 ` [PATCH 1/7] diff.c: emit_line_0 to take string instead of first sign Stefan Beller
2018-08-04  1:53 ` [PATCH 2/7] diff.c: add --output-indicator-{new, old, context} Stefan Beller
2018-08-04  1:53 ` [PATCH 3/7] range-diff: make use of different output indicators Stefan Beller
2018-08-04  1:53 ` [PATCH 4/7] range-diff: indent special lines as context Stefan Beller
2018-08-04  1:53 ` Stefan Beller [this message]
2018-08-04  1:53 ` [PATCH 6/7] diff.c: factor determine_line_color out of emit_diff_symbol_from_struct Stefan Beller
2018-08-04  1:53 ` [RFC PATCH 7/7] diff/am: enhance diff format to use */~ for moved lines Stefan Beller
2018-08-04 17:15   ` Junio C Hamano
2018-08-06  6:07     ` Stefan Beller
2018-08-04 16:57 ` [PATCH 0/7] improve range-diffs coloring and [RFC] move detection Junio C Hamano
2018-08-06  6:01   ` Stefan Beller
2018-08-06 20:18     ` Junio C Hamano

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=20180804015317.182683-6-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    /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).