Skip to content

Commit 9807b3d

Browse files
whydoubtgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f84afb9 commit 9807b3d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

builtin/blame.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int compare_commits_by_reverse_commit_date(const void *a,
353353
/*
354354
* The current state of the blame assignment.
355355
*/
356-
struct scoreboard {
356+
struct blame_scoreboard {
357357
/* the final commit (i.e. where we started digging from) */
358358
struct commit *final;
359359
/* Priority queue for commits with unassigned blame records */
@@ -377,14 +377,14 @@ struct scoreboard {
377377
int *lineno;
378378
};
379379

380-
static void sanity_check_refcnt(struct scoreboard *);
380+
static void sanity_check_refcnt(struct blame_scoreboard *);
381381

382382
/*
383383
* If two blame entries that are next to each other came from
384384
* contiguous lines in the same origin (i.e. <commit, path> pair),
385385
* merge them together.
386386
*/
387-
static void coalesce(struct scoreboard *sb)
387+
static void coalesce(struct blame_scoreboard *sb)
388388
{
389389
struct blame_entry *ent, *next;
390390

@@ -410,7 +410,7 @@ static void coalesce(struct scoreboard *sb)
410410
* the commit priority queue of the score board.
411411
*/
412412

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,
414414
struct blame_entry *sorted)
415415
{
416416
if (porigin->suspects)
@@ -653,14 +653,14 @@ static void dup_entry(struct blame_entry ***queue,
653653
*queue = &dst->next;
654654
}
655655

656-
static const char *nth_line(struct scoreboard *sb, long lno)
656+
static const char *nth_line(struct blame_scoreboard *sb, long lno)
657657
{
658658
return sb->final_buf + sb->lineno[lno];
659659
}
660660

661661
static const char *nth_line_cb(void *data, long lno)
662662
{
663-
return nth_line((struct scoreboard *)data, lno);
663+
return nth_line((struct blame_scoreboard *)data, lno);
664664
}
665665

666666
/*
@@ -919,7 +919,7 @@ static int blame_chunk_cb(long start_a, long count_a,
919919
* for the lines it is suspected to its parent. Run diff to find
920920
* which lines came from parent and pass blame for them.
921921
*/
922-
static void pass_blame_to_parent(struct scoreboard *sb,
922+
static void pass_blame_to_parent(struct blame_scoreboard *sb,
923923
struct blame_origin *target,
924924
struct blame_origin *parent)
925925
{
@@ -959,7 +959,7 @@ static void pass_blame_to_parent(struct scoreboard *sb,
959959
*
960960
* Compute how trivial the lines in the blame_entry are.
961961
*/
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)
963963
{
964964
unsigned score;
965965
const char *cp, *ep;
@@ -986,7 +986,7 @@ static unsigned ent_score(struct scoreboard *sb, struct blame_entry *e)
986986
* so far, by comparing this and best_so_far and copying this into
987987
* bst_so_far as needed.
988988
*/
989-
static void copy_split_if_better(struct scoreboard *sb,
989+
static void copy_split_if_better(struct blame_scoreboard *sb,
990990
struct blame_entry *best_so_far,
991991
struct blame_entry *this)
992992
{
@@ -1020,7 +1020,7 @@ static void copy_split_if_better(struct scoreboard *sb,
10201020
*
10211021
* All line numbers are 0-based.
10221022
*/
1023-
static void handle_split(struct scoreboard *sb,
1023+
static void handle_split(struct blame_scoreboard *sb,
10241024
struct blame_entry *ent,
10251025
int tlno, int plno, int same,
10261026
struct blame_origin *parent,
@@ -1039,7 +1039,7 @@ static void handle_split(struct scoreboard *sb,
10391039
}
10401040

10411041
struct handle_split_cb_data {
1042-
struct scoreboard *sb;
1042+
struct blame_scoreboard *sb;
10431043
struct blame_entry *ent;
10441044
struct blame_origin *parent;
10451045
struct blame_entry *split;
@@ -1063,7 +1063,7 @@ static int handle_split_cb(long start_a, long count_a,
10631063
* we can pass blames to it. file_p has the blob contents for
10641064
* the parent.
10651065
*/
1066-
static void find_copy_in_blob(struct scoreboard *sb,
1066+
static void find_copy_in_blob(struct blame_scoreboard *sb,
10671067
struct blame_entry *ent,
10681068
struct blame_origin *parent,
10691069
struct blame_entry *split,
@@ -1099,7 +1099,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
10991099
* Returns a pointer to the link pointing to the old head of the small list.
11001100
*/
11011101

1102-
static struct blame_entry **filter_small(struct scoreboard *sb,
1102+
static struct blame_entry **filter_small(struct blame_scoreboard *sb,
11031103
struct blame_entry **small,
11041104
struct blame_entry **source,
11051105
unsigned score_min)
@@ -1126,7 +1126,7 @@ static struct blame_entry **filter_small(struct scoreboard *sb,
11261126
* See if lines currently target is suspected for can be attributed to
11271127
* parent.
11281128
*/
1129-
static void find_move_in_parent(struct scoreboard *sb,
1129+
static void find_move_in_parent(struct blame_scoreboard *sb,
11301130
struct blame_entry ***blamed,
11311131
struct blame_entry **toosmall,
11321132
struct blame_origin *target,
@@ -1202,7 +1202,7 @@ static struct blame_list *setup_blame_list(struct blame_entry *unblamed,
12021202
* across file boundary from the parent commit. porigin is the path
12031203
* in the parent we already tried.
12041204
*/
1205-
static void find_copy_in_parent(struct scoreboard *sb,
1205+
static void find_copy_in_parent(struct blame_scoreboard *sb,
12061206
struct blame_entry ***blamed,
12071207
struct blame_entry **toosmall,
12081208
struct blame_origin *target,
@@ -1308,7 +1308,7 @@ static void find_copy_in_parent(struct scoreboard *sb,
13081308
* The blobs of origin and porigin exactly match, so everything
13091309
* origin is suspected for can be blamed on the parent.
13101310
*/
1311-
static void pass_whole_blame(struct scoreboard *sb,
1311+
static void pass_whole_blame(struct blame_scoreboard *sb,
13121312
struct blame_origin *origin, struct blame_origin *porigin)
13131313
{
13141314
struct blame_entry *e, *suspects;
@@ -1356,7 +1356,7 @@ static int num_scapegoats(struct rev_info *revs, struct commit *commit)
13561356
/* Distribute collected unsorted blames to the respected sorted lists
13571357
* in the various origins.
13581358
*/
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)
13601360
{
13611361
blamed = blame_sort(blamed, compare_blame_suspect);
13621362
while (blamed)
@@ -1376,7 +1376,7 @@ static void distribute_blame(struct scoreboard *sb, struct blame_entry *blamed)
13761376

13771377
#define MAXSG 16
13781378

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)
13801380
{
13811381
struct rev_info *revs = sb->revs;
13821382
int i, pass, num_sg;
@@ -1733,7 +1733,7 @@ static void found_guilty_entry(struct blame_entry *ent,
17331733
* The main loop -- while we have blobs with lines whose true origin
17341734
* is still unknown, pick one blob, and allow its lines to pass blames
17351735
* to its parents. */
1736-
static void assign_blame(struct scoreboard *sb, int opt)
1736+
static void assign_blame(struct blame_scoreboard *sb, int opt)
17371737
{
17381738
struct rev_info *revs = sb->revs;
17391739
struct commit *commit = prio_queue_get(&sb->commits);
@@ -1849,7 +1849,7 @@ static void emit_porcelain_details(struct blame_origin *suspect, int repeat)
18491849
write_filename_info(suspect);
18501850
}
18511851

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,
18531853
int opt)
18541854
{
18551855
int repeat = opt & OUTPUT_LINE_PORCELAIN;
@@ -1888,7 +1888,7 @@ static void emit_porcelain(struct scoreboard *sb, struct blame_entry *ent,
18881888
putchar('\n');
18891889
}
18901890

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)
18921892
{
18931893
int cnt;
18941894
const char *cp;
@@ -1967,7 +1967,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
19671967
commit_info_destroy(&ci);
19681968
}
19691969

1970-
static void output(struct scoreboard *sb, int option)
1970+
static void output(struct blame_scoreboard *sb, int option)
19711971
{
19721972
struct blame_entry *ent;
19731973

@@ -2006,7 +2006,7 @@ static const char *get_next_line(const char *start, const char *end)
20062006
* To allow quick access to the contents of nth line in the
20072007
* final image, prepare an index in the scoreboard.
20082008
*/
2009-
static int prepare_lines(struct scoreboard *sb)
2009+
static int prepare_lines(struct blame_scoreboard *sb)
20102010
{
20112011
const char *buf = sb->final_buf;
20122012
unsigned long len = sb->final_buf_size;
@@ -2066,7 +2066,7 @@ static int update_auto_abbrev(int auto_abbrev, struct blame_origin *suspect)
20662066
* How many columns do we need to show line numbers, authors,
20672067
* and filenames?
20682068
*/
2069-
static void find_alignment(struct scoreboard *sb, int *option)
2069+
static void find_alignment(struct blame_scoreboard *sb, int *option)
20702070
{
20712071
int longest_src_lines = 0;
20722072
int longest_dst_lines = 0;
@@ -2120,7 +2120,7 @@ static void find_alignment(struct scoreboard *sb, int *option)
21202120
* For debugging -- origin is refcounted, and this asserts that
21212121
* we do not underflow.
21222122
*/
2123-
static void sanity_check_refcnt(struct scoreboard *sb)
2123+
static void sanity_check_refcnt(struct blame_scoreboard *sb)
21242124
{
21252125
int baa = 0;
21262126
struct blame_entry *ent;
@@ -2411,14 +2411,14 @@ static struct commit *find_single_final(struct rev_info *revs,
24112411
return found;
24122412
}
24132413

2414-
static char *prepare_final(struct scoreboard *sb)
2414+
static char *prepare_final(struct blame_scoreboard *sb)
24152415
{
24162416
const char *name;
24172417
sb->final = find_single_final(sb->revs, &name);
24182418
return xstrdup_or_null(name);
24192419
}
24202420

2421-
static const char *dwim_reverse_initial(struct scoreboard *sb)
2421+
static const char *dwim_reverse_initial(struct blame_scoreboard *sb)
24222422
{
24232423
/*
24242424
* DWIM "git blame --reverse ONE -- PATH" as
@@ -2453,7 +2453,7 @@ static const char *dwim_reverse_initial(struct scoreboard *sb)
24532453
return sb->revs->pending.objects[0].name;
24542454
}
24552455

2456-
static char *prepare_initial(struct scoreboard *sb)
2456+
static char *prepare_initial(struct blame_scoreboard *sb)
24572457
{
24582458
int i;
24592459
const char *final_commit_name = NULL;
@@ -2522,7 +2522,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
25222522
{
25232523
struct rev_info revs;
25242524
const char *path;
2525-
struct scoreboard sb;
2525+
struct blame_scoreboard sb;
25262526
struct blame_origin *o;
25272527
struct blame_entry *ent = NULL;
25282528
long dashdash_pos, lno;

0 commit comments

Comments
 (0)