Skip to content

Commit

Permalink
Merge 'gvfs/ds/generation-numbers-update'
Browse files Browse the repository at this point in the history
Revert the previous commits involving generation numbers and apply the
commits that are in upstream `next`.
  • Loading branch information
dscho committed Mar 29, 2019
2 parents 8b6f500 + c2a3bef commit 2885646
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
7 changes: 5 additions & 2 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ void commit_list_sort_by_date(struct commit_list **list)
}

struct commit *pop_most_recent_commit(struct commit_list **list,
unsigned int mark)
unsigned int mark,
uint32_t min_generation)
{
struct commit *ret = pop_commit(list);
struct commit_list *parents = ret->parents;
Expand All @@ -599,7 +600,9 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
struct commit *commit = parents->item;
if (!parse_commit(commit) && !(commit->object.flags & mark)) {
commit->object.flags |= mark;
commit_list_insert_by_date(commit, list);

if (commit->generation >= min_generation)
commit_list_insert_by_date(commit, list);
}
parents = parents->next;
}
Expand Down
6 changes: 5 additions & 1 deletion commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,13 @@ extern const char *skip_blank_lines(const char *msg);

/** Removes the first commit from a list sorted by date, and adds all
* of its parents.
*
* The parents are not added if their generation number is strictly
* lower than min_generation.
**/
struct commit *pop_most_recent_commit(struct commit_list **list,
unsigned int mark);
unsigned int mark,
uint32_t min_generation);

struct commit *pop_commit(struct commit_list **stack);

Expand Down
3 changes: 2 additions & 1 deletion fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ static void mark_recent_complete_commits(struct fetch_pack_args *args,
while (complete && cutoff <= complete->item->date) {
print_verbose(args, _("Marking %s as complete"),
oid_to_hex(&complete->item->object.oid));
pop_most_recent_commit(&complete, COMPLETE);
pop_most_recent_commit(&complete, COMPLETE,
GENERATION_NUMBER_ZERO);
}
}

Expand Down
3 changes: 2 additions & 1 deletion sha1-name.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,8 @@ static int get_oid_oneline(const char *prefix, struct object_id *oid,
struct commit *commit;
int matches;

commit = pop_most_recent_commit(&list, ONELINE_SEEN);
commit = pop_most_recent_commit(&list, ONELINE_SEEN,
GENERATION_NUMBER_ZERO);
if (!parse_object(the_repository, &commit->object.oid))
continue;
buf = get_commit_buffer(commit, NULL);
Expand Down
3 changes: 2 additions & 1 deletion walker.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ static int process_commit(struct walker *walker, struct commit *commit)
return -1;

while (complete && complete->item->date >= commit->date) {
pop_most_recent_commit(&complete, COMPLETE);
pop_most_recent_commit(&complete, COMPLETE,
GENERATION_NUMBER_ZERO);
}

if (commit->object.flags & COMPLETE)
Expand Down

0 comments on commit 2885646

Please sign in to comment.