10 static char *path_name(struct name_path
*path
, const char *name
)
14 int nlen
= strlen(name
);
17 for (p
= path
; p
; p
= p
->up
) {
19 len
+= p
->elem_len
+ 1;
22 m
= n
+ len
- (nlen
+ 1);
24 for (p
= path
; p
; p
= p
->up
) {
27 memcpy(m
, p
->elem
, p
->elem_len
);
34 struct object_list
**add_object(struct object
*obj
,
35 struct object_list
**p
,
36 struct name_path
*path
,
39 struct object_list
*entry
= xmalloc(sizeof(*entry
));
42 entry
->name
= path_name(path
, name
);
47 static void mark_blob_uninteresting(struct blob
*blob
)
49 if (blob
->object
.flags
& UNINTERESTING
)
51 blob
->object
.flags
|= UNINTERESTING
;
54 void mark_tree_uninteresting(struct tree
*tree
)
56 struct tree_desc desc
;
57 struct object
*obj
= &tree
->object
;
59 if (obj
->flags
& UNINTERESTING
)
61 obj
->flags
|= UNINTERESTING
;
62 if (!has_sha1_file(obj
->sha1
))
64 if (parse_tree(tree
) < 0)
65 die("bad tree %s", sha1_to_hex(obj
->sha1
));
67 desc
.buf
= tree
->buffer
;
68 desc
.size
= tree
->size
;
72 const unsigned char *sha1
;
74 sha1
= tree_entry_extract(&desc
, &name
, &mode
);
75 update_tree_entry(&desc
);
78 mark_tree_uninteresting(lookup_tree(sha1
));
80 mark_blob_uninteresting(lookup_blob(sha1
));
84 * We don't care about the tree any more
85 * after it has been marked uninteresting.
91 void mark_parents_uninteresting(struct commit
*commit
)
93 struct commit_list
*parents
= commit
->parents
;
96 struct commit
*commit
= parents
->item
;
97 if (!(commit
->object
.flags
& UNINTERESTING
)) {
98 commit
->object
.flags
|= UNINTERESTING
;
101 * Normally we haven't parsed the parent
102 * yet, so we won't have a parent of a parent
103 * here. However, it may turn out that we've
104 * reached this commit some other way (where it
105 * wasn't uninteresting), in which case we need
106 * to mark its parents recursively too..
109 mark_parents_uninteresting(commit
);
113 * A missing commit is ok iff its parent is marked
116 * We just mark such a thing parsed, so that when
117 * it is popped next time around, we won't be trying
118 * to parse it and get an error.
120 if (!has_sha1_file(commit
->object
.sha1
))
121 commit
->object
.parsed
= 1;
122 parents
= parents
->next
;
126 static void add_pending_object(struct rev_info
*revs
, struct object
*obj
, const char *name
)
128 add_object(obj
, &revs
->pending_objects
, NULL
, name
);
131 static struct object
*get_reference(struct rev_info
*revs
, const char *name
, const unsigned char *sha1
, unsigned int flags
)
133 struct object
*object
;
135 object
= parse_object(sha1
);
137 die("bad object %s", name
);
138 object
->flags
|= flags
;
142 static struct commit
*handle_commit(struct rev_info
*revs
, struct object
*object
, const char *name
)
144 unsigned long flags
= object
->flags
;
147 * Tag object? Look what it points to..
149 while (object
->type
== tag_type
) {
150 struct tag
*tag
= (struct tag
*) object
;
151 if (revs
->tag_objects
&& !(flags
& UNINTERESTING
))
152 add_pending_object(revs
, object
, tag
->tag
);
153 object
= parse_object(tag
->tagged
->sha1
);
155 die("bad object %s", sha1_to_hex(tag
->tagged
->sha1
));
159 * Commit object? Just return it, we'll do all the complex
162 if (object
->type
== commit_type
) {
163 struct commit
*commit
= (struct commit
*)object
;
164 if (parse_commit(commit
) < 0)
165 die("unable to parse commit %s", name
);
166 if (flags
& UNINTERESTING
) {
167 commit
->object
.flags
|= UNINTERESTING
;
168 mark_parents_uninteresting(commit
);
175 * Tree object? Either mark it uniniteresting, or add it
176 * to the list of objects to look at later..
178 if (object
->type
== tree_type
) {
179 struct tree
*tree
= (struct tree
*)object
;
180 if (!revs
->tree_objects
)
182 if (flags
& UNINTERESTING
) {
183 mark_tree_uninteresting(tree
);
186 add_pending_object(revs
, object
, "");
191 * Blob object? You know the drill by now..
193 if (object
->type
== blob_type
) {
194 struct blob
*blob
= (struct blob
*)object
;
195 if (!revs
->blob_objects
)
197 if (flags
& UNINTERESTING
) {
198 mark_blob_uninteresting(blob
);
201 add_pending_object(revs
, object
, "");
204 die("%s is unknown object", name
);
207 static int everybody_uninteresting(struct commit_list
*orig
)
209 struct commit_list
*list
= orig
;
211 struct commit
*commit
= list
->item
;
213 if (commit
->object
.flags
& UNINTERESTING
)
220 static int tree_difference
= REV_TREE_SAME
;
222 static void file_add_remove(struct diff_options
*options
,
223 int addremove
, unsigned mode
,
224 const unsigned char *sha1
,
225 const char *base
, const char *path
)
227 int diff
= REV_TREE_DIFFERENT
;
230 * Is it an add of a new file? It means that the old tree
231 * didn't have it at all, so we will turn "REV_TREE_SAME" ->
232 * "REV_TREE_NEW", but leave any "REV_TREE_DIFFERENT" alone
233 * (and if it already was "REV_TREE_NEW", we'll keep it
234 * "REV_TREE_NEW" of course).
236 if (addremove
== '+') {
237 diff
= tree_difference
;
238 if (diff
!= REV_TREE_SAME
)
242 tree_difference
= diff
;
245 static void file_change(struct diff_options
*options
,
246 unsigned old_mode
, unsigned new_mode
,
247 const unsigned char *old_sha1
,
248 const unsigned char *new_sha1
,
249 const char *base
, const char *path
)
251 tree_difference
= REV_TREE_DIFFERENT
;
254 int rev_compare_tree(struct rev_info
*revs
, struct tree
*t1
, struct tree
*t2
)
259 return REV_TREE_DIFFERENT
;
260 tree_difference
= REV_TREE_SAME
;
261 if (diff_tree_sha1(t1
->object
.sha1
, t2
->object
.sha1
, "",
263 return REV_TREE_DIFFERENT
;
264 return tree_difference
;
267 int rev_same_tree_as_empty(struct rev_info
*revs
, struct tree
*t1
)
271 struct tree_desc empty
, real
;
276 tree
= read_object_with_reference(t1
->object
.sha1
, tree_type
, &real
.size
, NULL
);
285 retval
= diff_tree(&empty
, &real
, "", &revs
->pruning
);
288 return retval
>= 0 && !tree_difference
;
291 static void try_to_simplify_commit(struct rev_info
*revs
, struct commit
*commit
)
293 struct commit_list
**pp
, *parent
;
294 int tree_changed
= 0;
299 if (!commit
->parents
) {
300 if (!rev_same_tree_as_empty(revs
, commit
->tree
))
301 commit
->object
.flags
|= TREECHANGE
;
305 pp
= &commit
->parents
;
306 while ((parent
= *pp
) != NULL
) {
307 struct commit
*p
= parent
->item
;
310 switch (rev_compare_tree(revs
, p
->tree
, commit
->tree
)) {
312 if (p
->object
.flags
& UNINTERESTING
) {
313 /* Even if a merge with an uninteresting
314 * side branch brought the entire change
315 * we are interested in, we do not want
316 * to lose the other branches of this
317 * merge, so we just keep going.
323 commit
->parents
= parent
;
327 if (revs
->remove_empty_trees
&&
328 rev_same_tree_as_empty(revs
, p
->tree
)) {
329 /* We are adding all the specified
330 * paths from this parent, so the
331 * history beyond this parent is not
332 * interesting. Remove its parents
333 * (they are grandparents for us).
334 * IOW, we pretend this parent is a
341 case REV_TREE_DIFFERENT
:
346 die("bad tree compare for commit %s", sha1_to_hex(commit
->object
.sha1
));
349 commit
->object
.flags
|= TREECHANGE
;
352 static void add_parents_to_list(struct rev_info
*revs
, struct commit
*commit
, struct commit_list
**list
)
354 struct commit_list
*parent
= commit
->parents
;
356 if (commit
->object
.flags
& ADDED
)
358 commit
->object
.flags
|= ADDED
;
361 * If the commit is uninteresting, don't try to
362 * prune parents - we want the maximal uninteresting
365 * Normally we haven't parsed the parent
366 * yet, so we won't have a parent of a parent
367 * here. However, it may turn out that we've
368 * reached this commit some other way (where it
369 * wasn't uninteresting), in which case we need
370 * to mark its parents recursively too..
372 if (commit
->object
.flags
& UNINTERESTING
) {
374 struct commit
*p
= parent
->item
;
375 parent
= parent
->next
;
377 p
->object
.flags
|= UNINTERESTING
;
379 mark_parents_uninteresting(p
);
380 if (p
->object
.flags
& SEEN
)
382 p
->object
.flags
|= SEEN
;
383 insert_by_date(p
, list
);
389 * Ok, the commit wasn't uninteresting. Try to
390 * simplify the commit history and find the parent
391 * that has no differences in the path set if one exists.
394 revs
->prune_fn(revs
, commit
);
399 parent
= commit
->parents
;
401 struct commit
*p
= parent
->item
;
403 parent
= parent
->next
;
406 if (p
->object
.flags
& SEEN
)
408 p
->object
.flags
|= SEEN
;
409 insert_by_date(p
, list
);
413 static void limit_list(struct rev_info
*revs
)
415 struct commit_list
*list
= revs
->commits
;
416 struct commit_list
*newlist
= NULL
;
417 struct commit_list
**p
= &newlist
;
420 struct commit_list
*entry
= list
;
421 struct commit
*commit
= list
->item
;
422 struct object
*obj
= &commit
->object
;
427 if (revs
->max_age
!= -1 && (commit
->date
< revs
->max_age
))
428 obj
->flags
|= UNINTERESTING
;
429 if (revs
->unpacked
&& has_sha1_pack(obj
->sha1
))
430 obj
->flags
|= UNINTERESTING
;
431 add_parents_to_list(revs
, commit
, &list
);
432 if (obj
->flags
& UNINTERESTING
) {
433 mark_parents_uninteresting(commit
);
434 if (everybody_uninteresting(list
))
438 if (revs
->min_age
!= -1 && (commit
->date
> revs
->min_age
))
440 p
= &commit_list_insert(commit
, p
)->next
;
442 if (revs
->boundary
) {
443 /* mark the ones that are on the result list first */
444 for (list
= newlist
; list
; list
= list
->next
) {
445 struct commit
*commit
= list
->item
;
446 commit
->object
.flags
|= TMP_MARK
;
448 for (list
= newlist
; list
; list
= list
->next
) {
449 struct commit
*commit
= list
->item
;
450 struct object
*obj
= &commit
->object
;
451 struct commit_list
*parent
;
452 if (obj
->flags
& UNINTERESTING
)
454 for (parent
= commit
->parents
;
456 parent
= parent
->next
) {
457 struct commit
*pcommit
= parent
->item
;
458 if (!(pcommit
->object
.flags
& UNINTERESTING
))
460 pcommit
->object
.flags
|= BOUNDARY
;
461 if (pcommit
->object
.flags
& TMP_MARK
)
463 pcommit
->object
.flags
|= TMP_MARK
;
464 p
= &commit_list_insert(pcommit
, p
)->next
;
467 for (list
= newlist
; list
; list
= list
->next
) {
468 struct commit
*commit
= list
->item
;
469 commit
->object
.flags
&= ~TMP_MARK
;
472 revs
->commits
= newlist
;
475 static int all_flags
;
476 static struct rev_info
*all_revs
;
478 static int handle_one_ref(const char *path
, const unsigned char *sha1
)
480 struct object
*object
= get_reference(all_revs
, path
, sha1
, all_flags
);
481 add_pending_object(all_revs
, object
, "");
485 static void handle_all(struct rev_info
*revs
, unsigned flags
)
489 for_each_ref(handle_one_ref
);
492 static int add_parents_only(struct rev_info
*revs
, const char *arg
, int flags
)
494 unsigned char sha1
[20];
496 struct commit
*commit
;
497 struct commit_list
*parents
;
500 flags
^= UNINTERESTING
;
503 if (get_sha1(arg
, sha1
))
506 it
= get_reference(revs
, arg
, sha1
, 0);
507 if (strcmp(it
->type
, tag_type
))
509 memcpy(sha1
, ((struct tag
*)it
)->tagged
->sha1
, 20);
511 if (strcmp(it
->type
, commit_type
))
513 commit
= (struct commit
*)it
;
514 for (parents
= commit
->parents
; parents
; parents
= parents
->next
) {
515 it
= &parents
->item
->object
;
517 add_pending_object(revs
, it
, arg
);
522 void init_revisions(struct rev_info
*revs
)
524 memset(revs
, 0, sizeof(*revs
));
526 revs
->abbrev
= DEFAULT_ABBREV
;
527 revs
->ignore_merges
= 1;
528 revs
->pruning
.recursive
= 1;
529 revs
->pruning
.add_remove
= file_add_remove
;
530 revs
->pruning
.change
= file_change
;
533 revs
->prefix
= setup_git_directory();
536 revs
->max_count
= -1;
538 revs
->prune_fn
= NULL
;
539 revs
->prune_data
= NULL
;
541 revs
->topo_setter
= topo_sort_default_setter
;
542 revs
->topo_getter
= topo_sort_default_getter
;
544 revs
->commit_format
= CMIT_FMT_DEFAULT
;
546 diff_setup(&revs
->diffopt
);
550 * Parse revision information, filling in the "rev_info" structure,
551 * and removing the used arguments from the argument list.
553 * Returns the number of arguments left that weren't recognized
554 * (which are also moved to the head of the argument list)
556 int setup_revisions(int argc
, const char **argv
, struct rev_info
*revs
, const char *def
)
558 int i
, flags
, seen_dashdash
;
559 const char **unrecognized
= argv
+ 1;
562 /* First, search for "--" */
564 for (i
= 1; i
< argc
; i
++) {
565 const char *arg
= argv
[i
];
566 if (strcmp(arg
, "--"))
570 revs
->prune_data
= get_pathspec(revs
->prefix
, argv
+ i
+ 1);
576 for (i
= 1; i
< argc
; i
++) {
577 struct object
*object
;
578 const char *arg
= argv
[i
];
579 unsigned char sha1
[20];
585 if (!strncmp(arg
, "--max-count=", 12)) {
586 revs
->max_count
= atoi(arg
+ 12);
589 /* accept -<digit>, like traditional "head" */
590 if ((*arg
== '-') && isdigit(arg
[1])) {
591 revs
->max_count
= atoi(arg
+ 1);
594 if (!strcmp(arg
, "-n")) {
596 die("-n requires an argument");
597 revs
->max_count
= atoi(argv
[++i
]);
600 if (!strncmp(arg
,"-n",2)) {
601 revs
->max_count
= atoi(arg
+ 2);
604 if (!strncmp(arg
, "--max-age=", 10)) {
605 revs
->max_age
= atoi(arg
+ 10);
608 if (!strncmp(arg
, "--since=", 8)) {
609 revs
->max_age
= approxidate(arg
+ 8);
612 if (!strncmp(arg
, "--after=", 8)) {
613 revs
->max_age
= approxidate(arg
+ 8);
616 if (!strncmp(arg
, "--min-age=", 10)) {
617 revs
->min_age
= atoi(arg
+ 10);
620 if (!strncmp(arg
, "--before=", 9)) {
621 revs
->min_age
= approxidate(arg
+ 9);
624 if (!strncmp(arg
, "--until=", 8)) {
625 revs
->min_age
= approxidate(arg
+ 8);
628 if (!strcmp(arg
, "--all")) {
629 handle_all(revs
, flags
);
632 if (!strcmp(arg
, "--not")) {
633 flags
^= UNINTERESTING
;
636 if (!strcmp(arg
, "--default")) {
638 die("bad --default argument");
642 if (!strcmp(arg
, "--topo-order")) {
643 revs
->topo_order
= 1;
646 if (!strcmp(arg
, "--date-order")) {
648 revs
->topo_order
= 1;
651 if (!strcmp(arg
, "--parents")) {
655 if (!strcmp(arg
, "--dense")) {
659 if (!strcmp(arg
, "--sparse")) {
663 if (!strcmp(arg
, "--remove-empty")) {
664 revs
->remove_empty_trees
= 1;
667 if (!strcmp(arg
, "--no-merges")) {
671 if (!strcmp(arg
, "--boundary")) {
675 if (!strcmp(arg
, "--objects")) {
676 revs
->tag_objects
= 1;
677 revs
->tree_objects
= 1;
678 revs
->blob_objects
= 1;
681 if (!strcmp(arg
, "--objects-edge")) {
682 revs
->tag_objects
= 1;
683 revs
->tree_objects
= 1;
684 revs
->blob_objects
= 1;
688 if (!strcmp(arg
, "--unpacked")) {
692 if (!strcmp(arg
, "-r")) {
694 revs
->diffopt
.recursive
= 1;
697 if (!strcmp(arg
, "-t")) {
699 revs
->diffopt
.recursive
= 1;
700 revs
->diffopt
.tree_in_recursive
= 1;
703 if (!strcmp(arg
, "-m")) {
704 revs
->ignore_merges
= 0;
707 if (!strcmp(arg
, "-c")) {
709 revs
->dense_combined_merges
= 0;
710 revs
->combine_merges
= 1;
713 if (!strcmp(arg
, "--cc")) {
715 revs
->dense_combined_merges
= 1;
716 revs
->combine_merges
= 1;
719 if (!strcmp(arg
, "-v")) {
720 revs
->verbose_header
= 1;
723 if (!strncmp(arg
, "--pretty", 8)) {
724 revs
->verbose_header
= 1;
725 revs
->commit_format
= get_commit_format(arg
+8);
728 if (!strcmp(arg
, "--root")) {
729 revs
->show_root_diff
= 1;
732 if (!strcmp(arg
, "--no-commit-id")) {
733 revs
->no_commit_id
= 1;
736 if (!strcmp(arg
, "--always")) {
737 revs
->always_show_header
= 1;
740 if (!strcmp(arg
, "--no-abbrev")) {
744 if (!strcmp(arg
, "--abbrev")) {
745 revs
->abbrev
= DEFAULT_ABBREV
;
748 if (!strncmp(arg
, "--abbrev=", 9)) {
749 revs
->abbrev
= strtoul(arg
+ 9, NULL
, 10);
750 if (revs
->abbrev
< MINIMUM_ABBREV
)
751 revs
->abbrev
= MINIMUM_ABBREV
;
752 else if (revs
->abbrev
> 40)
756 if (!strcmp(arg
, "--abbrev-commit")) {
757 revs
->abbrev_commit
= 1;
760 if (!strcmp(arg
, "--full-diff")) {
765 opts
= diff_opt_parse(&revs
->diffopt
, argv
+i
, argc
-i
);
771 *unrecognized
++ = arg
;
775 dotdot
= strstr(arg
, "..");
777 unsigned char from_sha1
[20];
778 const char *next
= dotdot
+ 2;
779 const char *this = arg
;
785 if (!get_sha1(this, from_sha1
) &&
786 !get_sha1(next
, sha1
)) {
787 struct object
*exclude
;
788 struct object
*include
;
790 exclude
= get_reference(revs
, this, from_sha1
, flags
^ UNINTERESTING
);
791 include
= get_reference(revs
, next
, sha1
, flags
);
792 if (!exclude
|| !include
)
793 die("Invalid revision range %s..%s", arg
, next
);
795 if (!seen_dashdash
) {
797 verify_non_filename(revs
->prefix
, arg
);
799 add_pending_object(revs
, exclude
, this);
800 add_pending_object(revs
, include
, next
);
805 dotdot
= strstr(arg
, "^@");
806 if (dotdot
&& !dotdot
[2]) {
808 if (add_parents_only(revs
, arg
, flags
))
814 local_flags
= UNINTERESTING
;
817 if (get_sha1(arg
, sha1
)) {
820 if (seen_dashdash
|| local_flags
)
821 die("bad revision '%s'", arg
);
823 /* If we didn't have a "--":
824 * (1) all filenames must exist;
825 * (2) all rev-args must not be interpretable
826 * as a valid filename.
827 * but the latter we have checked in the main loop.
829 for (j
= i
; j
< argc
; j
++)
830 verify_filename(revs
->prefix
, argv
[j
]);
832 revs
->prune_data
= get_pathspec(revs
->prefix
, argv
+ i
);
836 verify_non_filename(revs
->prefix
, arg
);
837 object
= get_reference(revs
, arg
, sha1
, flags
^ local_flags
);
838 add_pending_object(revs
, object
, arg
);
840 if (def
&& !revs
->pending_objects
) {
841 unsigned char sha1
[20];
842 struct object
*object
;
843 if (get_sha1(def
, sha1
))
844 die("bad default revision '%s'", def
);
845 object
= get_reference(revs
, def
, sha1
, 0);
846 add_pending_object(revs
, object
, def
);
849 if (revs
->topo_order
|| revs
->unpacked
)
852 if (revs
->prune_data
) {
853 diff_tree_setup_paths(revs
->prune_data
, &revs
->pruning
);
854 revs
->prune_fn
= try_to_simplify_commit
;
855 if (!revs
->full_diff
)
856 diff_tree_setup_paths(revs
->prune_data
, &revs
->diffopt
);
858 if (revs
->combine_merges
) {
859 revs
->ignore_merges
= 0;
860 if (revs
->dense_combined_merges
&&
861 (revs
->diffopt
.output_format
!= DIFF_FORMAT_DIFFSTAT
))
862 revs
->diffopt
.output_format
= DIFF_FORMAT_PATCH
;
864 revs
->diffopt
.abbrev
= revs
->abbrev
;
865 diff_setup_done(&revs
->diffopt
);
870 void prepare_revision_walk(struct rev_info
*revs
)
872 struct object_list
*list
;
874 list
= revs
->pending_objects
;
875 revs
->pending_objects
= NULL
;
877 struct commit
*commit
= handle_commit(revs
, list
->item
, list
->name
);
879 if (!(commit
->object
.flags
& SEEN
)) {
880 commit
->object
.flags
|= SEEN
;
881 insert_by_date(commit
, &revs
->commits
);
891 if (revs
->topo_order
)
892 sort_in_topological_order_fn(&revs
->commits
, revs
->lifo
,
897 static int rewrite_one(struct rev_info
*revs
, struct commit
**pp
)
900 struct commit
*p
= *pp
;
902 add_parents_to_list(revs
, p
, &revs
->commits
);
903 if (p
->object
.flags
& (TREECHANGE
| UNINTERESTING
))
907 *pp
= p
->parents
->item
;
911 static void rewrite_parents(struct rev_info
*revs
, struct commit
*commit
)
913 struct commit_list
**pp
= &commit
->parents
;
915 struct commit_list
*parent
= *pp
;
916 if (rewrite_one(revs
, &parent
->item
) < 0) {
924 static void mark_boundary_to_show(struct commit
*commit
)
926 struct commit_list
*p
= commit
->parents
;
930 if (commit
->object
.flags
& BOUNDARY
)
931 commit
->object
.flags
|= BOUNDARY_SHOW
;
935 struct commit
*get_revision(struct rev_info
*revs
)
937 struct commit_list
*list
= revs
->commits
;
942 /* Check the max_count ... */
943 switch (revs
->max_count
) {
953 struct commit
*commit
= revs
->commits
->item
;
955 revs
->commits
= revs
->commits
->next
;
958 * If we haven't done the list limiting, we need to look at
959 * the parents here. We also need to do the date-based limiting
960 * that we'd otherwise have done in limit_list().
962 if (!revs
->limited
) {
963 if ((revs
->unpacked
&&
964 has_sha1_pack(commit
->object
.sha1
)) ||
965 (revs
->max_age
!= -1 &&
966 (commit
->date
< revs
->max_age
)))
968 add_parents_to_list(revs
, commit
, &revs
->commits
);
970 if (commit
->object
.flags
& SHOWN
)
973 /* We want to show boundary commits only when their
974 * children are shown. When path-limiter is in effect,
975 * rewrite_parents() drops some commits from getting shown,
976 * and there is no point showing boundary parents that
977 * are not shown. After rewrite_parents() rewrites the
978 * parents of a commit that is shown, we mark the boundary
979 * parents with BOUNDARY_SHOW.
981 if (commit
->object
.flags
& BOUNDARY_SHOW
) {
982 commit
->object
.flags
|= SHOWN
;
985 if (commit
->object
.flags
& UNINTERESTING
)
987 if (revs
->min_age
!= -1 && (commit
->date
> revs
->min_age
))
989 if (revs
->no_merges
&&
990 commit
->parents
&& commit
->parents
->next
)
992 if (revs
->prune_fn
&& revs
->dense
) {
993 if (!(commit
->object
.flags
& TREECHANGE
))
996 rewrite_parents(revs
, commit
);
999 mark_boundary_to_show(commit
);
1000 commit
->object
.flags
|= SHOWN
;
1002 } while (revs
->commits
);