commit 98297eed5b9082b66f6397a0921c8d90df72cca1 from: Stefan Sperling date: Wed Mar 27 10:59:27 2024 UTC rename got_commit_graph_iter_start() to got_commit_graph_bfsort() This function begins a breadth-first traversal. The new name makes it easier to distinguish from got_commit_graph_toposort(). commit - 371457e66c4c0ce1ae8880e2346336a14ad6cf6d commit + 98297eed5b9082b66f6397a0921c8d90df72cca1 blob - 93b12cd6d160b9b15d26706c00de377d49219f15 blob + 38191d6109e5f5caf08654969f4f3af3d9fb2c70 --- cvg/cvg.c +++ cvg/cvg.c @@ -2121,7 +2121,7 @@ check_same_branch(struct got_object_id *commit_id, if (err) goto done; - err = got_commit_graph_iter_start(graph, head_commit_id, repo, + err = got_commit_graph_bfsort(graph, head_commit_id, repo, check_cancelled, NULL); if (err) goto done; @@ -3785,7 +3785,7 @@ print_commits(struct got_object_id *root_id, struct go err = got_commit_graph_open(&graph, path, !log_branches); if (err) return err; - err = got_commit_graph_iter_start(graph, root_id, repo, + err = got_commit_graph_bfsort(graph, root_id, repo, check_cancelled, NULL); if (err) goto done; blob - 3ccb50b750cbf5628d56d7f361fdd88e54426fd6 blob + eb068e10c4f52020498b05f1af70fa1d2f6d5ee8 --- got/got.c +++ got/got.c @@ -2946,7 +2946,7 @@ check_same_branch(struct got_object_id *commit_id, if (err) goto done; - err = got_commit_graph_iter_start(graph, head_commit_id, repo, + err = got_commit_graph_bfsort(graph, head_commit_id, repo, check_cancelled, NULL); if (err) goto done; @@ -4485,7 +4485,7 @@ print_commits(struct got_object_id *root_id, struct go err = got_commit_graph_toposort(graph, root_id, repo, check_cancelled, NULL); } else { - err = got_commit_graph_iter_start(graph, root_id, repo, + err = got_commit_graph_bfsort(graph, root_id, repo, check_cancelled, NULL); } if (err) @@ -10874,7 +10874,7 @@ collect_commits(struct got_object_id_queue *commits, if (err) return err; - err = got_commit_graph_iter_start(graph, iter_start_id, repo, + err = got_commit_graph_bfsort(graph, iter_start_id, repo, check_cancelled, NULL); if (err) goto done; @@ -11266,7 +11266,7 @@ find_merge_commit_yca(struct got_object_id **new_yca_i if (err) return err; - err = got_commit_graph_iter_start(graph, base_commit_id, + err = got_commit_graph_bfsort(graph, base_commit_id, repo, check_cancelled, NULL); if (err) goto done; blob - fc27cb994aba584eae60004e96e635c5e0f04af6 blob + dd5804164e193d9d006dc88c88420ec33fee5b0d --- gotd/repo_write.c +++ gotd/repo_write.c @@ -1923,7 +1923,7 @@ print_commits(struct got_object_id *root_id, struct go err = got_commit_graph_open(&graph, "/", 1); if (err) return err; - err = got_commit_graph_iter_start(graph, root_id, repo, + err = got_commit_graph_bfsort(graph, root_id, repo, check_cancelled, NULL); if (err) goto done; blob - c9ba8e6ff4b8c298080a89dcbc845342b7d0cd88 blob + bd3939fbbae66ba3fc54ef4ac319959561b56a2c --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -383,7 +383,7 @@ got_get_repo_commits(struct request *c, size_t limit) goto done; } - error = got_commit_graph_iter_start(graph, id, repo, NULL, NULL); + error = got_commit_graph_bfsort(graph, id, repo, NULL, NULL); if (error) goto done; blob - a425d8d817ab860cb50f4d849945ba8fe207c0fd blob + 2ae96c907d138e8c9851d99c54375d81566eda8f --- include/got_commit_graph.h +++ include/got_commit_graph.h @@ -20,7 +20,7 @@ const struct got_error *got_commit_graph_open(struct g const char *, int); void got_commit_graph_close(struct got_commit_graph *); -const struct got_error *got_commit_graph_iter_start( +const struct got_error *got_commit_graph_bfsort( struct got_commit_graph *, struct got_object_id *, struct got_repository *, got_cancel_cb, void *); const struct got_error *got_commit_graph_toposort(struct got_commit_graph *, blob - 19f4c5d3e50e52a062526f9f1fb0872e5a87fa2d blob + ee01a5c028702fdcfa183487d08b0d679cf20893 --- lib/blame.c +++ lib/blame.c @@ -580,7 +580,7 @@ blame_open(struct got_blame **blamep, const char *path if (err) goto done; - err = got_commit_graph_iter_start(graph, start_commit_id, repo, + err = got_commit_graph_bfsort(graph, start_commit_id, repo, cancel_cb, cancel_arg); if (err) goto done; blob - f6ce43f7eb967dc51755b7f7e21c267c85a87e14 blob + 31a952259533a6860e070a48fc3dfe2eed787c4f --- lib/commit_graph.c +++ lib/commit_graph.c @@ -583,7 +583,7 @@ remove_branch_tip(struct got_object_id *commit_id, voi } const struct got_error * -got_commit_graph_iter_start(struct got_commit_graph *graph, +got_commit_graph_bfsort(struct got_commit_graph *graph, struct got_object_id *id, struct got_repository *repo, got_cancel_cb cancel_cb, void *cancel_arg) { @@ -740,12 +740,12 @@ got_commit_graph_find_youngest_common_ancestor(struct if (err) goto done; } else { - err = got_commit_graph_iter_start(graph, commit_id, repo, + err = got_commit_graph_bfsort(graph, commit_id, repo, cancel_cb, cancel_arg); if (err) goto done; - err = got_commit_graph_iter_start(graph2, commit_id2, repo, + err = got_commit_graph_bfsort(graph2, commit_id2, repo, cancel_cb, cancel_arg); if (err) goto done; @@ -836,7 +836,7 @@ got_commit_graph_toposort(struct got_commit_graph *gra STAILQ_INIT(&commits); if (graph->flags & GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL) - return got_commit_graph_iter_start(graph, id, repo, + return got_commit_graph_bfsort(graph, id, repo, cancel_cb, cancel_arg); /* Clear left-over state from previous iteration attempts. */ blob - f639075dadbb90313b88ab456af852512a3432ba blob + 08a0f4ac92decfd0d37ff6054e208dd4aded93ba --- lib/keyword.c +++ lib/keyword.c @@ -197,7 +197,7 @@ got_keyword_to_idstr(char **ret, const char *keyword, if (err) goto done; - err = got_commit_graph_iter_start(graph, + err = got_commit_graph_bfsort(graph, head_id != NULL ? head_id : kwid, repo, NULL, NULL); if (err) goto done; blob - 1d2d2883f6f459ee2e81334d5953c0559d5de275 blob + 49be7dc0e431407602c4dba0ac7030028d5a567e --- tog/tog.c +++ tog/tog.c @@ -3874,7 +3874,7 @@ open_log_view(struct tog_view *view, struct got_object !s->log_branches); if (err) goto done; - err = got_commit_graph_iter_start(thread_graph, s->start_id, + err = got_commit_graph_bfsort(thread_graph, s->start_id, s->repo, NULL, NULL); if (err) goto done; @@ -4330,7 +4330,7 @@ input_log_view(struct tog_view **new_view, struct tog_ s->in_repo_path, !s->log_branches); if (err) return err; - err = got_commit_graph_iter_start(s->thread_args.graph, + err = got_commit_graph_bfsort(s->thread_args.graph, s->start_id, s->repo, NULL, NULL); if (err) return err;