Skip to content

Commit 47e44ed

Browse files
tfarinagitster
authored andcommitted
commit: Add commit_list prefix in two function names.
Add commit_list prefix to insert_by_date function and to sort_by_date, so it's clear that these functions refer to commit_list structure. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7d43de9 commit 47e44ed

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

builtin/describe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static unsigned long finish_depth_computation(
189189
struct commit *p = parents->item;
190190
parse_commit(p);
191191
if (!(p->object.flags & SEEN))
192-
insert_by_date(p, list);
192+
commit_list_insert_by_date(p, list);
193193
p->object.flags |= c->object.flags;
194194
parents = parents->next;
195195
}
@@ -300,7 +300,7 @@ static void describe(const char *arg, int last_one)
300300
struct commit *p = parents->item;
301301
parse_commit(p);
302302
if (!(p->object.flags & SEEN))
303-
insert_by_date(p, &list);
303+
commit_list_insert_by_date(p, &list);
304304
p->object.flags |= c->object.flags;
305305
parents = parents->next;
306306
}
@@ -328,7 +328,7 @@ static void describe(const char *arg, int last_one)
328328
qsort(all_matches, match_cnt, sizeof(all_matches[0]), compare_pt);
329329

330330
if (gave_up_on) {
331-
insert_by_date(gave_up_on, &list);
331+
commit_list_insert_by_date(gave_up_on, &list);
332332
seen_commits--;
333333
}
334334
seen_commits += finish_depth_computation(&list, &all_matches[0]);

builtin/fetch-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void rev_list_push(struct commit *commit, int mark)
4747
if (parse_commit(commit))
4848
return;
4949

50-
insert_by_date(commit, &rev_list);
50+
commit_list_insert_by_date(commit, &rev_list);
5151

5252
if (!(commit->object.flags & COMMON))
5353
non_common_revs++;
@@ -436,7 +436,7 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
436436
if (o && o->type == OBJ_COMMIT) {
437437
struct commit *commit = (struct commit *)o;
438438
commit->object.flags |= COMPLETE;
439-
insert_by_date(commit, &complete);
439+
commit_list_insert_by_date(commit, &complete);
440440
}
441441
return 0;
442442
}

builtin/show-branch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void join_revs(struct commit_list **list_p,
243243
if (mark_seen(p, seen_p) && !still_interesting)
244244
extra--;
245245
p->object.flags |= flags;
246-
insert_by_date(p, list_p);
246+
commit_list_insert_by_date(p, list_p);
247247
}
248248
}
249249

@@ -859,7 +859,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
859859
*/
860860
commit->object.flags |= flag;
861861
if (commit->object.flags == flag)
862-
insert_by_date(commit, &list);
862+
commit_list_insert_by_date(commit, &list);
863863
rev[num_rev] = commit;
864864
}
865865
for (i = 0; i < num_rev; i++)
@@ -868,7 +868,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
868868
if (0 <= extra)
869869
join_revs(&list, &seen, num_rev, extra);
870870

871-
sort_by_date(&seen);
871+
commit_list_sort_by_date(&seen);
872872

873873
if (merge_base)
874874
return show_merge_base(seen, num_rev);

commit.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void free_commit_list(struct commit_list *list)
360360
}
361361
}
362362

363-
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list)
363+
struct commit_list * commit_list_insert_by_date(struct commit *item, struct commit_list **list)
364364
{
365365
struct commit_list **pp = list;
366366
struct commit_list *p;
@@ -374,11 +374,11 @@ struct commit_list * insert_by_date(struct commit *item, struct commit_list **li
374374
}
375375

376376

377-
void sort_by_date(struct commit_list **list)
377+
void commit_list_sort_by_date(struct commit_list **list)
378378
{
379379
struct commit_list *ret = NULL;
380380
while (*list) {
381-
insert_by_date((*list)->item, &ret);
381+
commit_list_insert_by_date((*list)->item, &ret);
382382
*list = (*list)->next;
383383
}
384384
*list = ret;
@@ -398,7 +398,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
398398
struct commit *commit = parents->item;
399399
if (!parse_commit(commit) && !(commit->object.flags & mark)) {
400400
commit->object.flags |= mark;
401-
insert_by_date(commit, list);
401+
commit_list_insert_by_date(commit, list);
402402
}
403403
parents = parents->next;
404404
}
@@ -487,7 +487,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
487487

488488
/* process the list in topological order */
489489
if (!lifo)
490-
sort_by_date(&work);
490+
commit_list_sort_by_date(&work);
491491

492492
pptr = list;
493493
*list = NULL;
@@ -513,7 +513,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
513513
*/
514514
if (--parent->indegree == 1) {
515515
if (!lifo)
516-
insert_by_date(parent, &work);
516+
commit_list_insert_by_date(parent, &work);
517517
else
518518
commit_list_insert(parent, &work);
519519
}
@@ -573,10 +573,10 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
573573
}
574574

575575
one->object.flags |= PARENT1;
576-
insert_by_date(one, &list);
576+
commit_list_insert_by_date(one, &list);
577577
for (i = 0; i < n; i++) {
578578
twos[i]->object.flags |= PARENT2;
579-
insert_by_date(twos[i], &list);
579+
commit_list_insert_by_date(twos[i], &list);
580580
}
581581

582582
while (interesting(list)) {
@@ -594,7 +594,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
594594
if (flags == (PARENT1 | PARENT2)) {
595595
if (!(commit->object.flags & RESULT)) {
596596
commit->object.flags |= RESULT;
597-
insert_by_date(commit, &result);
597+
commit_list_insert_by_date(commit, &result);
598598
}
599599
/* Mark parents of a found merge stale */
600600
flags |= STALE;
@@ -608,7 +608,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
608608
if (parse_commit(p))
609609
return NULL;
610610
p->object.flags |= flags;
611-
insert_by_date(p, &list);
611+
commit_list_insert_by_date(p, &list);
612612
}
613613
}
614614

@@ -618,7 +618,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
618618
while (list) {
619619
struct commit_list *next = list->next;
620620
if (!(list->item->object.flags & STALE))
621-
insert_by_date(list->item, &result);
621+
commit_list_insert_by_date(list->item, &result);
622622
free(list);
623623
list = next;
624624
}
@@ -711,7 +711,7 @@ struct commit_list *get_merge_bases_many(struct commit *one,
711711
result = NULL;
712712
for (i = 0; i < cnt; i++) {
713713
if (rslt[i])
714-
insert_by_date(rslt[i], &result);
714+
commit_list_insert_by_date(rslt[i], &result);
715715
}
716716
free(rslt);
717717
return result;

commit.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
3838
int quiet);
3939

4040
int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
41-
4241
int parse_commit(struct commit *item);
4342

4443
/* Find beginning and length of commit subject. */
4544
int find_commit_subject(const char *commit_buffer, const char **subject);
4645

47-
struct commit_list * commit_list_insert(struct commit *item, struct commit_list **list_p);
46+
struct commit_list *commit_list_insert(struct commit *item,
47+
struct commit_list **list);
4848
unsigned commit_list_count(const struct commit_list *l);
49-
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list);
49+
struct commit_list *commit_list_insert_by_date(struct commit *item,
50+
struct commit_list **list);
51+
void commit_list_sort_by_date(struct commit_list **list);
5052

5153
void free_commit_list(struct commit_list *list);
5254

53-
void sort_by_date(struct commit_list **list);
54-
5555
/* Commit formats */
5656
enum cmit_fmt {
5757
CMIT_FMT_RAW,

revision.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,15 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)
444444
commit->object.flags |= TREESAME;
445445
}
446446

447-
static void insert_by_date_cached(struct commit *p, struct commit_list **head,
447+
static void commit_list_insert_by_date_cached(struct commit *p, struct commit_list **head,
448448
struct commit_list *cached_base, struct commit_list **cache)
449449
{
450450
struct commit_list *new_entry;
451451

452452
if (cached_base && p->date < cached_base->item->date)
453-
new_entry = insert_by_date(p, &cached_base->next);
453+
new_entry = commit_list_insert_by_date(p, &cached_base->next);
454454
else
455-
new_entry = insert_by_date(p, head);
455+
new_entry = commit_list_insert_by_date(p, head);
456456

457457
if (cache && (!*cache || p->date < (*cache)->item->date))
458458
*cache = new_entry;
@@ -494,7 +494,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
494494
if (p->object.flags & SEEN)
495495
continue;
496496
p->object.flags |= SEEN;
497-
insert_by_date_cached(p, list, cached_base, cache_ptr);
497+
commit_list_insert_by_date_cached(p, list, cached_base, cache_ptr);
498498
}
499499
return 0;
500500
}
@@ -521,7 +521,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
521521
p->object.flags |= left_flag;
522522
if (!(p->object.flags & SEEN)) {
523523
p->object.flags |= SEEN;
524-
insert_by_date_cached(p, list, cached_base, cache_ptr);
524+
commit_list_insert_by_date_cached(p, list, cached_base, cache_ptr);
525525
}
526526
if (revs->first_parent_only)
527527
break;
@@ -1891,7 +1891,7 @@ int prepare_revision_walk(struct rev_info *revs)
18911891
if (commit) {
18921892
if (!(commit->object.flags & SEEN)) {
18931893
commit->object.flags |= SEEN;
1894-
insert_by_date(commit, &revs->commits);
1894+
commit_list_insert_by_date(commit, &revs->commits);
18951895
}
18961896
}
18971897
e++;

sha1_name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static int handle_one_ref(const char *path,
683683
}
684684
if (object->type != OBJ_COMMIT)
685685
return 0;
686-
insert_by_date((struct commit *)object, list);
686+
commit_list_insert_by_date((struct commit *)object, list);
687687
object->flags |= ONELINE_SEEN;
688688
return 0;
689689
}

upload-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static int reachable(struct commit *want)
366366
{
367367
struct commit_list *work = NULL;
368368

369-
insert_by_date(want, &work);
369+
commit_list_insert_by_date(want, &work);
370370
while (work) {
371371
struct commit_list *list = work->next;
372372
struct commit *commit = work->item;
@@ -387,7 +387,7 @@ static int reachable(struct commit *want)
387387
for (list = commit->parents; list; list = list->next) {
388388
struct commit *parent = list->item;
389389
if (!(parent->object.flags & REACHABLE))
390-
insert_by_date(parent, &work);
390+
commit_list_insert_by_date(parent, &work);
391391
}
392392
}
393393
want->object.flags |= REACHABLE;

walker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
207207
struct commit *commit = lookup_commit_reference_gently(sha1, 1);
208208
if (commit) {
209209
commit->object.flags |= COMPLETE;
210-
insert_by_date(commit, &complete);
210+
commit_list_insert_by_date(commit, &complete);
211211
}
212212
return 0;
213213
}

0 commit comments

Comments
 (0)