@matheusbsbs / matheus-bagliano / commits / 47e44ed1dc
Fork 0

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>

Thiago Farina committed Nov 26, 2010 at 23:58 UTC 47e44ed1dc17d3a94ec4bf8dd29810ab7882041c
9 files changed +35 -35
builtin/describe.c
+3 -3
@@ -189,7 +189,7 @@ static unsigned long finish_depth_computation(
189 struct commit *p = parents->item;
190 parse_commit(p);
191 if (!(p->object.flags & SEEN))
192 - insert_by_date(p, list);
192 + commit_list_insert_by_date(p, list);
193 p->object.flags |= c->object.flags;
194 parents = parents->next;
195 }
@@ -300,7 +300,7 @@ static void describe(const char *arg, int last_one)
300 struct commit *p = parents->item;
301 parse_commit(p);
302 if (!(p->object.flags & SEEN))
303 - insert_by_date(p, &list);
303 + commit_list_insert_by_date(p, &list);
304 p->object.flags |= c->object.flags;
305 parents = parents->next;
306 }
@@ -328,7 +328,7 @@ static void describe(const char *arg, int last_one)
328 qsort(all_matches, match_cnt, sizeof(all_matches[0]), compare_pt);
329
330 if (gave_up_on) {
331 - insert_by_date(gave_up_on, &list);
331 + commit_list_insert_by_date(gave_up_on, &list);
332 seen_commits--;
333 }
334 seen_commits += finish_depth_computation(&list, &all_matches[0]);
builtin/fetch-pack.c
+2 -2
@@ -47,7 +47,7 @@ static void rev_list_push(struct commit *commit, int mark)
47 if (parse_commit(commit))
48 return;
49
50 - insert_by_date(commit, &rev_list);
50 + commit_list_insert_by_date(commit, &rev_list);
51
52 if (!(commit->object.flags & COMMON))
53 non_common_revs++;
@@ -436,7 +436,7 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
436 if (o && o->type == OBJ_COMMIT) {
437 struct commit *commit = (struct commit *)o;
438 commit->object.flags |= COMPLETE;
439 - insert_by_date(commit, &complete);
439 + commit_list_insert_by_date(commit, &complete);
440 }
441 return 0;
442 }
builtin/show-branch.c
+3 -3
@@ -243,7 +243,7 @@ static void join_revs(struct commit_list **list_p,
243 if (mark_seen(p, seen_p) && !still_interesting)
244 extra--;
245 p->object.flags |= flags;
246 - insert_by_date(p, list_p);
246 + commit_list_insert_by_date(p, list_p);
247 }
248 }
249
@@ -859,7 +859,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
859 */
860 commit->object.flags |= flag;
861 if (commit->object.flags == flag)
862 - insert_by_date(commit, &list);
862 + commit_list_insert_by_date(commit, &list);
863 rev[num_rev] = commit;
864 }
865 for (i = 0; i < num_rev; i++)
@@ -868,7 +868,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
868 if (0 <= extra)
869 join_revs(&list, &seen, num_rev, extra);
870
871 - sort_by_date(&seen);
871 + commit_list_sort_by_date(&seen);
872
873 if (merge_base)
874 return show_merge_base(seen, num_rev);
commit.c
+12 -12
@@ -360,7 +360,7 @@ void free_commit_list(struct commit_list *list)
360 }
361 }
362
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)
364 {
365 struct commit_list **pp = list;
366 struct commit_list *p;
@@ -374,11 +374,11 @@ struct commit_list * insert_by_date(struct commit *item, struct commit_list **li
374 }
375
376
377 -void sort_by_date(struct commit_list **list)
377 +void commit_list_sort_by_date(struct commit_list **list)
378 {
379 struct commit_list *ret = NULL;
380 while (*list) {
381 - insert_by_date((*list)->item, &ret);
381 + commit_list_insert_by_date((*list)->item, &ret);
382 *list = (*list)->next;
383 }
384 *list = ret;
@@ -398,7 +398,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
398 struct commit *commit = parents->item;
399 if (!parse_commit(commit) && !(commit->object.flags & mark)) {
400 commit->object.flags |= mark;
401 - insert_by_date(commit, list);
401 + commit_list_insert_by_date(commit, list);
402 }
403 parents = parents->next;
404 }
@@ -487,7 +487,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
487
488 /* process the list in topological order */
489 if (!lifo)
490 - sort_by_date(&work);
490 + commit_list_sort_by_date(&work);
491
492 pptr = list;
493 *list = NULL;
@@ -513,7 +513,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
513 */
514 if (--parent->indegree == 1) {
515 if (!lifo)
516 - insert_by_date(parent, &work);
516 + commit_list_insert_by_date(parent, &work);
517 else
518 commit_list_insert(parent, &work);
519 }
@@ -573,10 +573,10 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
573 }
574
575 one->object.flags |= PARENT1;
576 - insert_by_date(one, &list);
576 + commit_list_insert_by_date(one, &list);
577 for (i = 0; i < n; i++) {
578 twos[i]->object.flags |= PARENT2;
579 - insert_by_date(twos[i], &list);
579 + commit_list_insert_by_date(twos[i], &list);
580 }
581
582 while (interesting(list)) {
@@ -594,7 +594,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
594 if (flags == (PARENT1 | PARENT2)) {
595 if (!(commit->object.flags & RESULT)) {
596 commit->object.flags |= RESULT;
597 - insert_by_date(commit, &result);
597 + commit_list_insert_by_date(commit, &result);
598 }
599 /* Mark parents of a found merge stale */
600 flags |= STALE;
@@ -608,7 +608,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
608 if (parse_commit(p))
609 return NULL;
610 p->object.flags |= flags;
611 - insert_by_date(p, &list);
611 + commit_list_insert_by_date(p, &list);
612 }
613 }
614
@@ -618,7 +618,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
618 while (list) {
619 struct commit_list *next = list->next;
620 if (!(list->item->object.flags & STALE))
621 - insert_by_date(list->item, &result);
621 + commit_list_insert_by_date(list->item, &result);
622 free(list);
623 list = next;
624 }
@@ -711,7 +711,7 @@ struct commit_list *get_merge_bases_many(struct commit *one,
711 result = NULL;
712 for (i = 0; i < cnt; i++) {
713 if (rslt[i])
714 - insert_by_date(rslt[i], &result);
714 + commit_list_insert_by_date(rslt[i], &result);
715 }
716 free(rslt);
717 return result;
commit.h
+5 -5
@@ -38,20 +38,20 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
38 int quiet);
39
40 int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
41 -
41 int parse_commit(struct commit *item);
42
43 /* Find beginning and length of commit subject. */
44 int find_commit_subject(const char *commit_buffer, const char **subject);
45
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);
48 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);
52
53 void free_commit_list(struct commit_list *list);
54
53 -void sort_by_date(struct commit_list **list);
54 -
55 /* Commit formats */
56 enum cmit_fmt {
57 CMIT_FMT_RAW,
revision.c
+6 -6
@@ -444,15 +444,15 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)
444 commit->object.flags |= TREESAME;
445 }
446
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,
448 struct commit_list *cached_base, struct commit_list **cache)
449 {
450 struct commit_list *new_entry;
451
452 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);
454 else
455 - new_entry = insert_by_date(p, head);
455 + new_entry = commit_list_insert_by_date(p, head);
456
457 if (cache && (!*cache || p->date < (*cache)->item->date))
458 *cache = new_entry;
@@ -494,7 +494,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
494 if (p->object.flags & SEEN)
495 continue;
496 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);
498 }
499 return 0;
500 }
@@ -521,7 +521,7 @@ static int add_parents_to_list(struct rev_info *revs, struct commit *commit,
521 p->object.flags |= left_flag;
522 if (!(p->object.flags & SEEN)) {
523 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);
525 }
526 if (revs->first_parent_only)
527 break;
@@ -1891,7 +1891,7 @@ int prepare_revision_walk(struct rev_info *revs)
1891 if (commit) {
1892 if (!(commit->object.flags & SEEN)) {
1893 commit->object.flags |= SEEN;
1894 - insert_by_date(commit, &revs->commits);
1894 + commit_list_insert_by_date(commit, &revs->commits);
1895 }
1896 }
1897 e++;
sha1_name.c
+1 -1
@@ -683,7 +683,7 @@ static int handle_one_ref(const char *path,
683 }
684 if (object->type != OBJ_COMMIT)
685 return 0;
686 - insert_by_date((struct commit *)object, list);
686 + commit_list_insert_by_date((struct commit *)object, list);
687 object->flags |= ONELINE_SEEN;
688 return 0;
689 }
upload-pack.c
+2 -2
@@ -366,7 +366,7 @@ static int reachable(struct commit *want)
366 {
367 struct commit_list *work = NULL;
368
369 - insert_by_date(want, &work);
369 + commit_list_insert_by_date(want, &work);
370 while (work) {
371 struct commit_list *list = work->next;
372 struct commit *commit = work->item;
@@ -387,7 +387,7 @@ static int reachable(struct commit *want)
387 for (list = commit->parents; list; list = list->next) {
388 struct commit *parent = list->item;
389 if (!(parent->object.flags & REACHABLE))
390 - insert_by_date(parent, &work);
390 + commit_list_insert_by_date(parent, &work);
391 }
392 }
393 want->object.flags |= REACHABLE;
walker.c
+1 -1
@@ -207,7 +207,7 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
207 struct commit *commit = lookup_commit_reference_gently(sha1, 1);
208 if (commit) {
209 commit->object.flags |= COMPLETE;
210 - insert_by_date(commit, &complete);
210 + commit_list_insert_by_date(commit, &complete);
211 }
212 return 0;
213 }