Skip to content

Commit 716958c

Browse files
committed
Merge branch 'tf/commit-list-prefix'
* tf/commit-list-prefix: commit: Add commit_list prefix in two function names. Conflicts: sha1_name.c
2 parents 853563d + 47e44ed commit 716958c

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
@@ -218,7 +218,7 @@ static unsigned long finish_depth_computation(
218218
struct commit *p = parents->item;
219219
parse_commit(p);
220220
if (!(p->object.flags & SEEN))
221-
insert_by_date(p, list);
221+
commit_list_insert_by_date(p, list);
222222
p->object.flags |= c->object.flags;
223223
parents = parents->next;
224224
}
@@ -334,7 +334,7 @@ static void describe(const char *arg, int last_one)
334334
struct commit *p = parents->item;
335335
parse_commit(p);
336336
if (!(p->object.flags & SEEN))
337-
insert_by_date(p, &list);
337+
commit_list_insert_by_date(p, &list);
338338
p->object.flags |= c->object.flags;
339339
parents = parents->next;
340340
}
@@ -362,7 +362,7 @@ static void describe(const char *arg, int last_one)
362362
qsort(all_matches, match_cnt, sizeof(all_matches[0]), compare_pt);
363363

364364
if (gave_up_on) {
365-
insert_by_date(gave_up_on, &list);
365+
commit_list_insert_by_date(gave_up_on, &list);
366366
seen_commits--;
367367
}
368368
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
@@ -374,7 +374,7 @@ void free_commit_list(struct commit_list *list)
374374
}
375375
}
376376

377-
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list)
377+
struct commit_list * commit_list_insert_by_date(struct commit *item, struct commit_list **list)
378378
{
379379
struct commit_list **pp = list;
380380
struct commit_list *p;
@@ -388,11 +388,11 @@ struct commit_list * insert_by_date(struct commit *item, struct commit_list **li
388388
}
389389

390390

391-
void sort_by_date(struct commit_list **list)
391+
void commit_list_sort_by_date(struct commit_list **list)
392392
{
393393
struct commit_list *ret = NULL;
394394
while (*list) {
395-
insert_by_date((*list)->item, &ret);
395+
commit_list_insert_by_date((*list)->item, &ret);
396396
*list = (*list)->next;
397397
}
398398
*list = ret;
@@ -412,7 +412,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
412412
struct commit *commit = parents->item;
413413
if (!parse_commit(commit) && !(commit->object.flags & mark)) {
414414
commit->object.flags |= mark;
415-
insert_by_date(commit, list);
415+
commit_list_insert_by_date(commit, list);
416416
}
417417
parents = parents->next;
418418
}
@@ -501,7 +501,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
501501

502502
/* process the list in topological order */
503503
if (!lifo)
504-
sort_by_date(&work);
504+
commit_list_sort_by_date(&work);
505505

506506
pptr = list;
507507
*list = NULL;
@@ -527,7 +527,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
527527
*/
528528
if (--parent->indegree == 1) {
529529
if (!lifo)
530-
insert_by_date(parent, &work);
530+
commit_list_insert_by_date(parent, &work);
531531
else
532532
commit_list_insert(parent, &work);
533533
}
@@ -587,10 +587,10 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
587587
}
588588

589589
one->object.flags |= PARENT1;
590-
insert_by_date(one, &list);
590+
commit_list_insert_by_date(one, &list);
591591
for (i = 0; i < n; i++) {
592592
twos[i]->object.flags |= PARENT2;
593-
insert_by_date(twos[i], &list);
593+
commit_list_insert_by_date(twos[i], &list);
594594
}
595595

596596
while (interesting(list)) {
@@ -608,7 +608,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
608608
if (flags == (PARENT1 | PARENT2)) {
609609
if (!(commit->object.flags & RESULT)) {
610610
commit->object.flags |= RESULT;
611-
insert_by_date(commit, &result);
611+
commit_list_insert_by_date(commit, &result);
612612
}
613613
/* Mark parents of a found merge stale */
614614
flags |= STALE;
@@ -622,7 +622,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
622622
if (parse_commit(p))
623623
return NULL;
624624
p->object.flags |= flags;
625-
insert_by_date(p, &list);
625+
commit_list_insert_by_date(p, &list);
626626
}
627627
}
628628

@@ -632,7 +632,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
632632
while (list) {
633633
struct commit_list *next = list->next;
634634
if (!(list->item->object.flags & STALE))
635-
insert_by_date(list->item, &result);
635+
commit_list_insert_by_date(list->item, &result);
636636
free(list);
637637
list = next;
638638
}
@@ -725,7 +725,7 @@ struct commit_list *get_merge_bases_many(struct commit *one,
725725
result = NULL;
726726
for (i = 0; i < cnt; i++) {
727727
if (rslt[i])
728-
insert_by_date(rslt[i], &result);
728+
commit_list_insert_by_date(rslt[i], &result);
729729
}
730730
free(rslt);
731731
return result;

commit.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
3939
struct commit *lookup_commit_reference_by_name(const char *name);
4040

4141
int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
42-
4342
int parse_commit(struct commit *item);
4443

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

48-
struct commit_list * commit_list_insert(struct commit *item, struct commit_list **list_p);
47+
struct commit_list *commit_list_insert(struct commit *item,
48+
struct commit_list **list);
4949
unsigned commit_list_count(const struct commit_list *l);
50-
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list);
50+
struct commit_list *commit_list_insert_by_date(struct commit *item,
51+
struct commit_list **list);
52+
void commit_list_sort_by_date(struct commit_list **list);
5153

5254
void free_commit_list(struct commit_list *list);
5355

54-
void sort_by_date(struct commit_list **list);
55-
5656
/* Commit formats */
5757
enum cmit_fmt {
5858
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
@@ -707,7 +707,7 @@ static int handle_one_ref(const char *path,
707707
}
708708
if (object->type != OBJ_COMMIT)
709709
return 0;
710-
insert_by_date((struct commit *)object, list);
710+
commit_list_insert_by_date((struct commit *)object, list);
711711
return 0;
712712
}
713713

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)