blame: rename scoreboard structure to blame_scoreboard

The scoreboard structure is core to the blame interface. Since scoreboard will become more exposed, rename it to blame_scoreboard to clarify what it is a part of. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Smith committed May 24, 2017 at 00:15 UTC 9807b3d65d3789ed7916ffc98dbdf7ed89634ca3
1 file changed +29 -29
builtin/blame.c
+29 -29
@@ -353,7 +353,7 @@ static int compare_commits_by_reverse_commit_date(const void *a,
353 /*
354 * The current state of the blame assignment.
355 */
356 -struct scoreboard {
356 +struct blame_scoreboard {
357 /* the final commit (i.e. where we started digging from) */
358 struct commit *final;
359 /* Priority queue for commits with unassigned blame records */
@@ -377,14 +377,14 @@ struct scoreboard {
377 int *lineno;
378 };
379
380 -static void sanity_check_refcnt(struct scoreboard *);
380 +static void sanity_check_refcnt(struct blame_scoreboard *);
381
382 /*
383 * If two blame entries that are next to each other came from
384 * contiguous lines in the same origin (i.e. <commit, path> pair),
385 * merge them together.
386 */
387 -static void coalesce(struct scoreboard *sb)
387 +static void coalesce(struct blame_scoreboard *sb)
388 {
389 struct blame_entry *ent, *next;
390
@@ -410,7 +410,7 @@ static void coalesce(struct scoreboard *sb)
410 * the commit priority queue of the score board.
411 */
412
413 -static void queue_blames(struct scoreboard *sb, struct blame_origin *porigin,
413 +static void queue_blames(struct blame_scoreboard *sb, struct blame_origin *porigin,
414 struct blame_entry *sorted)
415 {
416 if (porigin->suspects)
@@ -653,14 +653,14 @@ static void dup_entry(struct blame_entry ***queue,
653 *queue = &dst->next;
654 }
655
656 -static const char *nth_line(struct scoreboard *sb, long lno)
656 +static const char *nth_line(struct blame_scoreboard *sb, long lno)
657 {
658 return sb->final_buf + sb->lineno[lno];
659 }
660
661 static const char *nth_line_cb(void *data, long lno)
662 {
663 - return nth_line((struct scoreboard *)data, lno);
663 + return nth_line((struct blame_scoreboard *)data, lno);
664 }
665
666 /*
@@ -919,7 +919,7 @@ static int blame_chunk_cb(long start_a, long count_a,
919 * for the lines it is suspected to its parent. Run diff to find
920 * which lines came from parent and pass blame for them.
921 */
922 -static void pass_blame_to_parent(struct scoreboard *sb,
922 +static void pass_blame_to_parent(struct blame_scoreboard *sb,
923 struct blame_origin *target,
924 struct blame_origin *parent)
925 {
@@ -959,7 +959,7 @@ static void pass_blame_to_parent(struct scoreboard *sb,
959 *
960 * Compute how trivial the lines in the blame_entry are.
961 */
962 -static unsigned ent_score(struct scoreboard *sb, struct blame_entry *e)
962 +static unsigned ent_score(struct blame_scoreboard *sb, struct blame_entry *e)
963 {
964 unsigned score;
965 const char *cp, *ep;
@@ -986,7 +986,7 @@ static unsigned ent_score(struct scoreboard *sb, struct blame_entry *e)
986 * so far, by comparing this and best_so_far and copying this into
987 * bst_so_far as needed.
988 */
989 -static void copy_split_if_better(struct scoreboard *sb,
989 +static void copy_split_if_better(struct blame_scoreboard *sb,
990 struct blame_entry *best_so_far,
991 struct blame_entry *this)
992 {
@@ -1020,7 +1020,7 @@ static void copy_split_if_better(struct scoreboard *sb,
1020 *
1021 * All line numbers are 0-based.
1022 */
1023 -static void handle_split(struct scoreboard *sb,
1023 +static void handle_split(struct blame_scoreboard *sb,
1024 struct blame_entry *ent,
1025 int tlno, int plno, int same,
1026 struct blame_origin *parent,
@@ -1039,7 +1039,7 @@ static void handle_split(struct scoreboard *sb,
1039 }
1040
1041 struct handle_split_cb_data {
1042 - struct scoreboard *sb;
1042 + struct blame_scoreboard *sb;
1043 struct blame_entry *ent;
1044 struct blame_origin *parent;
1045 struct blame_entry *split;
@@ -1063,7 +1063,7 @@ static int handle_split_cb(long start_a, long count_a,
1063 * we can pass blames to it. file_p has the blob contents for
1064 * the parent.
1065 */
1066 -static void find_copy_in_blob(struct scoreboard *sb,
1066 +static void find_copy_in_blob(struct blame_scoreboard *sb,
1067 struct blame_entry *ent,
1068 struct blame_origin *parent,
1069 struct blame_entry *split,
@@ -1099,7 +1099,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
1099 * Returns a pointer to the link pointing to the old head of the small list.
1100 */
1101
1102 -static struct blame_entry **filter_small(struct scoreboard *sb,
1102 +static struct blame_entry **filter_small(struct blame_scoreboard *sb,
1103 struct blame_entry **small,
1104 struct blame_entry **source,
1105 unsigned score_min)
@@ -1126,7 +1126,7 @@ static struct blame_entry **filter_small(struct scoreboard *sb,
1126 * See if lines currently target is suspected for can be attributed to
1127 * parent.
1128 */
1129 -static void find_move_in_parent(struct scoreboard *sb,
1129 +static void find_move_in_parent(struct blame_scoreboard *sb,
1130 struct blame_entry ***blamed,
1131 struct blame_entry **toosmall,
1132 struct blame_origin *target,
@@ -1202,7 +1202,7 @@ static struct blame_list *setup_blame_list(struct blame_entry *unblamed,
1202 * across file boundary from the parent commit. porigin is the path
1203 * in the parent we already tried.
1204 */
1205 -static void find_copy_in_parent(struct scoreboard *sb,
1205 +static void find_copy_in_parent(struct blame_scoreboard *sb,
1206 struct blame_entry ***blamed,
1207 struct blame_entry **toosmall,
1208 struct blame_origin *target,
@@ -1308,7 +1308,7 @@ static void find_copy_in_parent(struct scoreboard *sb,
1308 * The blobs of origin and porigin exactly match, so everything
1309 * origin is suspected for can be blamed on the parent.
1310 */
1311 -static void pass_whole_blame(struct scoreboard *sb,
1311 +static void pass_whole_blame(struct blame_scoreboard *sb,
1312 struct blame_origin *origin, struct blame_origin *porigin)
1313 {
1314 struct blame_entry *e, *suspects;
@@ -1356,7 +1356,7 @@ static int num_scapegoats(struct rev_info *revs, struct commit *commit)
1356 /* Distribute collected unsorted blames to the respected sorted lists
1357 * in the various origins.
1358 */
1359 -static void distribute_blame(struct scoreboard *sb, struct blame_entry *blamed)
1359 +static void distribute_blame(struct blame_scoreboard *sb, struct blame_entry *blamed)
1360 {
1361 blamed = blame_sort(blamed, compare_blame_suspect);
1362 while (blamed)
@@ -1376,7 +1376,7 @@ static void distribute_blame(struct scoreboard *sb, struct blame_entry *blamed)
1376
1377 #define MAXSG 16
1378
1379 -static void pass_blame(struct scoreboard *sb, struct blame_origin *origin, int opt)
1379 +static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin, int opt)
1380 {
1381 struct rev_info *revs = sb->revs;
1382 int i, pass, num_sg;
@@ -1733,7 +1733,7 @@ static void found_guilty_entry(struct blame_entry *ent,
1733 * The main loop -- while we have blobs with lines whose true origin
1734 * is still unknown, pick one blob, and allow its lines to pass blames
1735 * to its parents. */
1736 -static void assign_blame(struct scoreboard *sb, int opt)
1736 +static void assign_blame(struct blame_scoreboard *sb, int opt)
1737 {
1738 struct rev_info *revs = sb->revs;
1739 struct commit *commit = prio_queue_get(&sb->commits);
@@ -1849,7 +1849,7 @@ static void emit_porcelain_details(struct blame_origin *suspect, int repeat)
1849 write_filename_info(suspect);
1850 }
1851
1852 -static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
1852 +static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent,
1853 int opt)
1854 {
1855 int repeat = opt & OUTPUT_LINE_PORCELAIN;
@@ -1888,7 +1888,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
1888 putchar('\n');
1889 }
1890
1891 -static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
1891 +static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int opt)
1892 {
1893 int cnt;
1894 const char *cp;
@@ -1967,7 +1967,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
1967 commit_info_destroy(&ci);
1968 }
1969
1970 -static void output(struct scoreboard *sb, int option)
1970 +static void output(struct blame_scoreboard *sb, int option)
1971 {
1972 struct blame_entry *ent;
1973
@@ -2006,7 +2006,7 @@ static const char *get_next_line(const char *start, const char *end)
2006 * To allow quick access to the contents of nth line in the
2007 * final image, prepare an index in the scoreboard.
2008 */
2009 -static int prepare_lines(struct scoreboard *sb)
2009 +static int prepare_lines(struct blame_scoreboard *sb)
2010 {
2011 const char *buf = sb->final_buf;
2012 unsigned long len = sb->final_buf_size;
@@ -2066,7 +2066,7 @@ static int update_auto_abbrev(int auto_abbrev, struct blame_origin *suspect)
2066 * How many columns do we need to show line numbers, authors,
2067 * and filenames?
2068 */
2069 -static void find_alignment(struct scoreboard *sb, int *option)
2069 +static void find_alignment(struct blame_scoreboard *sb, int *option)
2070 {
2071 int longest_src_lines = 0;
2072 int longest_dst_lines = 0;
@@ -2120,7 +2120,7 @@ static void find_alignment(struct scoreboard *sb, int *option)
2120 * For debugging -- origin is refcounted, and this asserts that
2121 * we do not underflow.
2122 */
2123 -static void sanity_check_refcnt(struct scoreboard *sb)
2123 +static void sanity_check_refcnt(struct blame_scoreboard *sb)
2124 {
2125 int baa = 0;
2126 struct blame_entry *ent;
@@ -2411,14 +2411,14 @@ static struct commit *find_single_final(struct rev_info *revs,
2411 return found;
2412 }
2413
2414 -static char *prepare_final(struct scoreboard *sb)
2414 +static char *prepare_final(struct blame_scoreboard *sb)
2415 {
2416 const char *name;
2417 sb->final = find_single_final(sb->revs, &name);
2418 return xstrdup_or_null(name);
2419 }
2420
2421 -static const char *dwim_reverse_initial(struct scoreboard *sb)
2421 +static const char *dwim_reverse_initial(struct blame_scoreboard *sb)
2422 {
2423 /*
2424 * DWIM "git blame --reverse ONE -- PATH" as
@@ -2453,7 +2453,7 @@ static const char *dwim_reverse_initial(struct scoreboard *sb)
2453 return sb->revs->pending.objects[0].name;
2454 }
2455
2456 -static char *prepare_initial(struct scoreboard *sb)
2456 +static char *prepare_initial(struct blame_scoreboard *sb)
2457 {
2458 int i;
2459 const char *final_commit_name = NULL;
@@ -2522,7 +2522,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2522 {
2523 struct rev_info revs;
2524 const char *path;
2525 - struct scoreboard sb;
2525 + struct blame_scoreboard sb;
2526 struct blame_origin *o;
2527 struct blame_entry *ent = NULL;
2528 long dashdash_pos, lno;