{"thread":{"id":"64808","subject":"[PATCH 0/3] Rename commit list functions to conform to coding guidelines","startedAt":"2026-01-15T09:36:03Z","lastAt":"2026-01-16T16:48:25Z","messageCount":7,"participants":["Patrick Steinhardt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"533917","messageId":"20260115-pks-commit-list-coding-guidelines-v1-0-c58868dbf412@pks.im","threadId":"64808","inReplyTo":null,"subject":"[PATCH 0/3] Rename commit list functions to conform to coding guidelines","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-15T09:35:31Z","receivedAt":"2026-01-15T09:36:03Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nI've been working with commit lists quite often recently, and every\nsingle time I get bitten by the fact that a subset of its functions do\nnot conform to our coding guidelines. While most of the functions start\nwith `commit_list_*()`, three functions don't. This patch series fixes\nthis issue and renames the remaining three functions so that all of them\nstart with `commit_list_*()`.\n\nNote that I'm adding compatibility wrappers for the old prototypes to\nease the transition and not make life hard for any in-flight patch\nseries. I've also dropped all changes that lead to conflicts with\n\"seen\".\n\nThis series is built on top of 8745eae506 (The 17th batch, 2026-01-11).\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (3):\n      commit: rename `copy_commit_list()` to conform to coding guidelines\n      commit: rename `reverse_commit_list()` to conform to coding guidelines\n      commit: rename `free_commit_list()` to conform to coding guidelines\n\n bisect.c                      | 12 ++++++------\n blame.c                       |  2 +-\n builtin/am.c                  |  2 +-\n builtin/commit-tree.c         |  2 +-\n builtin/commit.c              |  4 ++--\n builtin/describe.c            |  2 +-\n builtin/diff-tree.c           |  2 +-\n builtin/gc.c                  |  2 +-\n builtin/log.c                 | 12 ++++++------\n builtin/merge-base.c          | 14 +++++++-------\n builtin/merge-tree.c          |  4 ++--\n builtin/merge.c               | 16 ++++++++--------\n builtin/pull.c                |  8 ++++----\n builtin/rebase.c              |  4 ++--\n builtin/rev-list.c            |  2 +-\n builtin/show-branch.c         |  2 +-\n builtin/stash.c               | 12 ++++++------\n commit-graph.c                |  2 +-\n commit-reach.c                | 30 +++++++++++++++---------------\n commit.c                      | 16 ++++++++--------\n commit.h                      | 25 ++++++++++++++++++++++---\n contrib/coccinelle/free.cocci |  8 ++++----\n diff-lib.c                    |  2 +-\n fmt-merge-msg.c               |  2 +-\n line-log.c                    |  2 +-\n log-tree.c                    |  2 +-\n merge-ort-wrappers.c          |  2 +-\n merge-ort.c                   |  6 +++---\n notes-merge.c                 |  4 ++--\n notes-utils.c                 |  2 +-\n object-name.c                 |  8 ++++----\n pack-bitmap-write.c           |  6 +++---\n ref-filter.c                  |  8 ++++----\n reflog.c                      |  4 ++--\n remote.c                      |  2 +-\n revision.c                    | 36 ++++++++++++++++++------------------\n sequencer.c                   | 20 ++++++++++----------\n shallow.c                     |  4 ++--\n submodule.c                   |  4 ++--\n t/helper/test-reach.c         | 10 +++++-----\n 40 files changed, 163 insertions(+), 144 deletions(-)\n\n\n---\nbase-commit: 8745eae506f700657882b9e32b2aa00f234a6fb6\nchange-id: 20260107-pks-commit-list-coding-guidelines-51d03de0d39d\n\n"},{"id":"533918","messageId":"20260115-pks-commit-list-coding-guidelines-v1-1-c58868dbf412@pks.im","threadId":"64808","inReplyTo":"20260115-pks-commit-list-coding-guidelines-v1-0-c58868dbf412@pks.im","subject":"[PATCH 1/3] commit: rename `copy_commit_list()` to conform to coding guidelines","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-15T09:35:32Z","receivedAt":"2026-01-15T09:36:04Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Our coding guidelines say that:\n\n  Functions that operate on `struct S` are named `S_<verb>()` and should\n  generally receive a pointer to `struct S` as first parameter.\n\nWhile most of the functions related to `struct commit_list` already\nfollow that naming schema, `copy_commit_list()` doesn't.\n\nRename the function to address this and adjust all of its callers. Add a\ncompatibility wrapper for the old function name to ease the transition\nand avoid any semantic conflicts with in-flight patch series. This\nwrapper will be removed once Git 2.53 has been released.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n builtin/commit.c |  2 +-\n commit.c         |  2 +-\n commit.h         | 11 ++++++++++-\n merge-ort.c      |  2 +-\n revision.c       |  4 ++--\n sequencer.c      |  2 +-\n 6 files changed, 16 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 0243f17d53..0aa3690b04 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1849,7 +1849,7 @@ int cmd_commit(int argc,\n \t} else if (amend) {\n \t\tif (!reflog_msg)\n \t\t\treflog_msg = \"commit (amend)\";\n-\t\tparents = copy_commit_list(current_head->parents);\n+\t\tparents = commit_list_copy(current_head->parents);\n \t} else if (whence == FROM_MERGE) {\n \t\tstruct strbuf m = STRBUF_INIT;\n \t\tFILE *fp;\ndiff --git a/commit.c b/commit.c\nindex efd0c02683..c5c66d3a6b 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -680,7 +680,7 @@ unsigned commit_list_count(const struct commit_list *l)\n \treturn c;\n }\n \n-struct commit_list *copy_commit_list(const struct commit_list *list)\n+struct commit_list *commit_list_copy(const struct commit_list *list)\n {\n \tstruct commit_list *head = NULL;\n \tstruct commit_list **pp = &head;\ndiff --git a/commit.h b/commit.h\nindex 79a761c37d..2faf08cd18 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -186,13 +186,22 @@ struct commit_list *commit_list_insert_by_date(struct commit *item,\n void commit_list_sort_by_date(struct commit_list **list);\n \n /* Shallow copy of the input list */\n-struct commit_list *copy_commit_list(const struct commit_list *list);\n+struct commit_list *commit_list_copy(const struct commit_list *list);\n \n /* Modify list in-place to reverse it, returning new head; list will be tail */\n struct commit_list *reverse_commit_list(struct commit_list *list);\n \n void free_commit_list(struct commit_list *list);\n \n+/*\n+ * Deprecated compatibility functions for `struct commit_list`, to be removed\n+ * once Git 2.53 is released.\n+ */\n+static inline struct commit_list *copy_commit_list(struct commit_list *l)\n+{\n+\treturn commit_list_copy(l);\n+}\n+\n struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */\n \n const char *repo_logmsg_reencode(struct repository *r,\ndiff --git a/merge-ort.c b/merge-ort.c\nindex 2b837a58c3..f31754c361 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -5301,7 +5301,7 @@ static void merge_ort_internal(struct merge_options *opt,\n \t\t\t       struct commit *h2,\n \t\t\t       struct merge_result *result)\n {\n-\tstruct commit_list *merge_bases = copy_commit_list(_merge_bases);\n+\tstruct commit_list *merge_bases = commit_list_copy(_merge_bases);\n \tstruct commit *next;\n \tstruct commit *merged_merge_bases;\n \tconst char *ancestor_name;\ndiff --git a/revision.c b/revision.c\nindex 1858e093ee..9f5baceb85 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -4224,7 +4224,7 @@ static void save_parents(struct rev_info *revs, struct commit *commit)\n \tif (*pp)\n \t\treturn;\n \tif (commit->parents)\n-\t\t*pp = copy_commit_list(commit->parents);\n+\t\t*pp = commit_list_copy(commit->parents);\n \telse\n \t\t*pp = EMPTY_PARENT_LIST;\n }\n@@ -4294,7 +4294,7 @@ static void track_linear(struct rev_info *revs, struct commit *commit)\n \t\t\tcommit->object.flags |= TRACK_LINEAR;\n \t}\n \tfree_commit_list(revs->previous_parents);\n-\trevs->previous_parents = copy_commit_list(commit->parents);\n+\trevs->previous_parents = commit_list_copy(commit->parents);\n }\n \n static struct commit *get_revision_1(struct rev_info *revs)\ndiff --git a/sequencer.c b/sequencer.c\nindex 71ed31c774..f38d247b10 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1566,7 +1566,7 @@ static int try_to_commit(struct repository *r,\n \t\t\tres = error(_(\"unable to parse commit author\"));\n \t\t\tgoto out;\n \t\t}\n-\t\tparents = copy_commit_list(current_head->parents);\n+\t\tparents = commit_list_copy(current_head->parents);\n \t\textra = read_commit_extra_headers(current_head, exclude_gpgsig);\n \t} else if (current_head &&\n \t\t   (!(flags & CREATE_ROOT_COMMIT) || (flags & AMEND_MSG))) {\n\n-- \n2.52.0.660.gd05f3a8ea5.dirty\n\n"},{"id":"533919","messageId":"20260115-pks-commit-list-coding-guidelines-v1-2-c58868dbf412@pks.im","threadId":"64808","inReplyTo":"20260115-pks-commit-list-coding-guidelines-v1-0-c58868dbf412@pks.im","subject":"[PATCH 2/3] commit: rename `reverse_commit_list()` to conform to coding guidelines","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-15T09:35:33Z","receivedAt":"2026-01-15T09:36:06Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Our coding guidelines say that:\n\n  Functions that operate on `struct S` are named `S_<verb>()` and should\n  generally receive a pointer to `struct S` as first parameter.\n\nWhile most of the functions related to `struct commit_list` already\nfollow that naming schema, `reverse_commit_list()` doesn't.\n\nRename the function to address this and adjust all of its callers. Add a\ncompatibility wrapper for the old function name to ease the transition\nand avoid any semantic conflicts with in-flight patch series. This\nwrapper will be removed once Git 2.53 has been released.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n builtin/merge-tree.c | 2 +-\n builtin/stash.c      | 2 +-\n commit.c             | 2 +-\n commit.h             | 7 ++++++-\n merge-ort.c          | 2 +-\n sequencer.c          | 2 +-\n 6 files changed, 11 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 1c063d9a41..979a55d3b2 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -483,7 +483,7 @@ static int real_merge(struct merge_tree_options *o,\n \t\t\texit(128);\n \t\tif (!merge_bases && !o->allow_unrelated_histories)\n \t\t\tdie(_(\"refusing to merge unrelated histories\"));\n-\t\tmerge_bases = reverse_commit_list(merge_bases);\n+\t\tmerge_bases = commit_list_reverse(merge_bases);\n \t\tmerge_incore_recursive(&opt, merge_bases, parent1, parent2, &result);\n \t\tfree_commit_list(merge_bases);\n \t}\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 948eba06fb..4cb2351787 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -2308,7 +2308,7 @@ static int do_export_stash(struct repository *r,\n \t * but where their first parents form a chain to our original empty\n \t * base commit.\n \t */\n-\titems = reverse_commit_list(items);\n+\titems = commit_list_reverse(items);\n \tfor (cur = items; cur; cur = cur->next) {\n \t\tstruct commit_list *parents = NULL;\n \t\tstruct commit_list **next = &parents;\ndiff --git a/commit.c b/commit.c\nindex c5c66d3a6b..36f02c96aa 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -691,7 +691,7 @@ struct commit_list *commit_list_copy(const struct commit_list *list)\n \treturn head;\n }\n \n-struct commit_list *reverse_commit_list(struct commit_list *list)\n+struct commit_list *commit_list_reverse(struct commit_list *list)\n {\n \tstruct commit_list *next = NULL, *current, *backup;\n \tfor (current = list; current; current = backup) {\ndiff --git a/commit.h b/commit.h\nindex 2faf08cd18..f50d9e5a4a 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -189,7 +189,7 @@ void commit_list_sort_by_date(struct commit_list **list);\n struct commit_list *commit_list_copy(const struct commit_list *list);\n \n /* Modify list in-place to reverse it, returning new head; list will be tail */\n-struct commit_list *reverse_commit_list(struct commit_list *list);\n+struct commit_list *commit_list_reverse(struct commit_list *list);\n \n void free_commit_list(struct commit_list *list);\n \n@@ -202,6 +202,11 @@ static inline struct commit_list *copy_commit_list(struct commit_list *l)\n \treturn commit_list_copy(l);\n }\n \n+static inline struct commit_list *reverse_commit_list(struct commit_list *l)\n+{\n+\treturn commit_list_reverse(l);\n+}\n+\n struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */\n \n const char *repo_logmsg_reencode(struct repository *r,\ndiff --git a/merge-ort.c b/merge-ort.c\nindex f31754c361..2ddaaffc26 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -5314,7 +5314,7 @@ static void merge_ort_internal(struct merge_options *opt,\n \t\t\tgoto out;\n \t\t}\n \t\t/* See merge-ort.h:merge_incore_recursive() declaration NOTE */\n-\t\tmerge_bases = reverse_commit_list(merge_bases);\n+\t\tmerge_bases = commit_list_reverse(merge_bases);\n \t}\n \n \tmerged_merge_bases = pop_commit(&merge_bases);\ndiff --git a/sequencer.c b/sequencer.c\nindex f38d247b10..e09f8eed55 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -4317,7 +4317,7 @@ static int do_merge(struct repository *r,\n \t\t      git_path_merge_head(r), 0);\n \twrite_message(\"no-ff\", 5, git_path_merge_mode(r), 0);\n \n-\tbases = reverse_commit_list(bases);\n+\tbases = commit_list_reverse(bases);\n \n \trepo_read_index(r);\n \tinit_ui_merge_options(&o, r);\n\n-- \n2.52.0.660.gd05f3a8ea5.dirty\n\n"},{"id":"533920","messageId":"20260115-pks-commit-list-coding-guidelines-v1-3-c58868dbf412@pks.im","threadId":"64808","inReplyTo":"20260115-pks-commit-list-coding-guidelines-v1-0-c58868dbf412@pks.im","subject":"[PATCH 3/3] commit: rename `free_commit_list()` to conform to coding guidelines","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-15T09:35:34Z","receivedAt":"2026-01-15T09:36:09Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Our coding guidelines say that:\n\n  Functions that operate on `struct S` are named `S_<verb>()` and should\n  generally receive a pointer to `struct S` as first parameter.\n\nWhile most of the functions related to `struct commit_list` already\nfollow that naming schema, `free_commit_list()` doesn't.\n\nRename the function to address this and adjust all of its callers. Add a\ncompatibility wrapper for the old function name to ease the transition\nand avoid any semantic conflicts with in-flight patch series. This\nwrapper will be removed once Git 2.53 has been released.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n bisect.c                      | 12 ++++++------\n blame.c                       |  2 +-\n builtin/am.c                  |  2 +-\n builtin/commit-tree.c         |  2 +-\n builtin/commit.c              |  2 +-\n builtin/describe.c            |  2 +-\n builtin/diff-tree.c           |  2 +-\n builtin/gc.c                  |  2 +-\n builtin/log.c                 | 12 ++++++------\n builtin/merge-base.c          | 14 +++++++-------\n builtin/merge-tree.c          |  2 +-\n builtin/merge.c               | 16 ++++++++--------\n builtin/pull.c                |  8 ++++----\n builtin/rebase.c              |  4 ++--\n builtin/rev-list.c            |  2 +-\n builtin/show-branch.c         |  2 +-\n builtin/stash.c               | 10 +++++-----\n commit-graph.c                |  2 +-\n commit-reach.c                | 30 +++++++++++++++---------------\n commit.c                      | 12 ++++++------\n commit.h                      |  7 ++++++-\n contrib/coccinelle/free.cocci |  8 ++++----\n diff-lib.c                    |  2 +-\n fmt-merge-msg.c               |  2 +-\n line-log.c                    |  2 +-\n log-tree.c                    |  2 +-\n merge-ort-wrappers.c          |  2 +-\n merge-ort.c                   |  2 +-\n notes-merge.c                 |  4 ++--\n notes-utils.c                 |  2 +-\n object-name.c                 |  8 ++++----\n pack-bitmap-write.c           |  6 +++---\n ref-filter.c                  |  8 ++++----\n reflog.c                      |  4 ++--\n remote.c                      |  2 +-\n revision.c                    | 32 ++++++++++++++++----------------\n sequencer.c                   | 16 ++++++++--------\n shallow.c                     |  4 ++--\n submodule.c                   |  4 ++--\n t/helper/test-reach.c         | 10 +++++-----\n 40 files changed, 136 insertions(+), 131 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 326b59c0dc..b313f13240 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -257,7 +257,7 @@ static struct commit_list *best_bisection_sorted(struct commit_list *list, int n\n \t\t\tp = p->next;\n \t}\n \tif (p) {\n-\t\tfree_commit_list(p->next);\n+\t\tcommit_list_free(p->next);\n \t\tp->next = NULL;\n \t}\n \tstrbuf_release(&buf);\n@@ -438,7 +438,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,\n \tif (best) {\n \t\tif (!(bisect_flags & FIND_BISECTION_ALL)) {\n \t\t\tlist->item = best->item;\n-\t\t\tfree_commit_list(list->next);\n+\t\t\tcommit_list_free(list->next);\n \t\t\tbest = list;\n \t\t\tbest->next = NULL;\n \t\t}\n@@ -559,8 +559,8 @@ struct commit_list *filter_skipped(struct commit_list *list,\n \t\t} else {\n \t\t\tif (!show_all) {\n \t\t\t\tif (!skipped_first || !*skipped_first) {\n-\t\t\t\t\tfree_commit_list(next);\n-\t\t\t\t\tfree_commit_list(filtered);\n+\t\t\t\t\tcommit_list_free(next);\n+\t\t\t\t\tcommit_list_free(filtered);\n \t\t\t\t\treturn list;\n \t\t\t\t}\n \t\t\t} else if (skipped_first && !*skipped_first) {\n@@ -879,7 +879,7 @@ static enum bisect_error check_merge_bases(size_t rev_nr, struct commit **rev, i\n \t\t}\n \t}\n \n-\tfree_commit_list(result);\n+\tcommit_list_free(result);\n \treturn res;\n }\n \n@@ -1142,7 +1142,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)\n \n \tres = bisect_checkout(bisect_rev, no_checkout);\n cleanup:\n-\tfree_commit_list(tried);\n+\tcommit_list_free(tried);\n \trelease_revisions(&revs);\n \tstrvec_clear(&rev_argv);\n \treturn res;\ndiff --git a/blame.c b/blame.c\nindex cb0b083423..a3c49d132e 100644\n--- a/blame.c\n+++ b/blame.c\n@@ -2368,7 +2368,7 @@ static struct commit_list *first_scapegoat(struct rev_info *revs, struct commit\n \t\tif (revs->first_parent_only &&\n \t\t    commit->parents &&\n \t\t    commit->parents->next) {\n-\t\t\tfree_commit_list(commit->parents->next);\n+\t\t\tcommit_list_free(commit->parents->next);\n \t\t\tcommit->parents->next = NULL;\n \t\t}\n \t\treturn commit->parents;\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 277c2e7937..97a7b1d46a 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -1726,7 +1726,7 @@ static void do_commit(const struct am_state *state)\n \n \trun_hooks(the_repository, \"post-applypatch\");\n \n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/builtin/commit-tree.c b/builtin/commit-tree.c\nindex 5189e685a7..30535db131 100644\n--- a/builtin/commit-tree.c\n+++ b/builtin/commit-tree.c\n@@ -154,7 +154,7 @@ int cmd_commit_tree(int argc,\n \tret = 0;\n \n out:\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tstrbuf_release(&buffer);\n \treturn ret;\n }\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 0aa3690b04..b1315b512b 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1978,7 +1978,7 @@ int cmd_commit(int argc,\n \n cleanup:\n \tfree_commit_extra_headers(extra);\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tstrbuf_release(&author_ident);\n \tstrbuf_release(&err);\n \tstrbuf_release(&sb);\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 989a78d715..abfe3525a5 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -558,7 +558,7 @@ static void process_object(struct object *obj, const char *path, void *data)\n \t\t\tdescribe_commit(pcd->current_commit, pcd->dst);\n \t\t\tstrbuf_addf(pcd->dst, \":%s\", path);\n \t\t}\n-\t\tfree_commit_list(pcd->revs->commits);\n+\t\tcommit_list_free(pcd->revs->commits);\n \t\tpcd->revs->commits = NULL;\n \t}\n }\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex 49dd4d00eb..cd35d1c915 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -33,7 +33,7 @@ static int stdin_diff_commit(struct commit *commit, const char *p)\n \t\tstruct commit *parent = lookup_commit(the_repository, &oid);\n \t\tif (!pptr) {\n \t\t\t/* Free the real parent list */\n-\t\t\tfree_commit_list(commit->parents);\n+\t\t\tcommit_list_free(commit->parents);\n \t\t\tcommit->parents = NULL;\n \t\t\tpptr = &(commit->parents);\n \t\t}\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 92c6e7b954..6c529c429e 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1166,7 +1166,7 @@ static int dfs_on_ref(const struct reference *ref, void *cb_data)\n \t\t}\n \t}\n \n-\tfree_commit_list(stack);\n+\tcommit_list_free(stack);\n \treturn result;\n }\n \ndiff --git a/builtin/log.c b/builtin/log.c\nindex 5c9a8ef363..d43ca693bf 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -424,7 +424,7 @@ static int cmd_log_walk_no_free(struct rev_info *rev)\n \t\t\t */\n \t\t\tfree_commit_buffer(the_repository->parsed_objects,\n \t\t\t\t\t   commit);\n-\t\t\tfree_commit_list(commit->parents);\n+\t\t\tcommit_list_free(commit->parents);\n \t\t\tcommit->parents = NULL;\n \t\t}\n \t\tif (saved_nrl < rev->diffopt.needed_rename_limit)\n@@ -1697,12 +1697,12 @@ static struct commit *get_base_commit(const struct format_config *cfg,\n \t\t\t\tif (die_on_failure) {\n \t\t\t\t\tdie(_(\"could not find exact merge base\"));\n \t\t\t\t} else {\n-\t\t\t\t\tfree_commit_list(base_list);\n+\t\t\t\t\tcommit_list_free(base_list);\n \t\t\t\t\treturn NULL;\n \t\t\t\t}\n \t\t\t}\n \t\t\tbase = base_list->item;\n-\t\t\tfree_commit_list(base_list);\n+\t\t\tcommit_list_free(base_list);\n \t\t} else {\n \t\t\tif (die_on_failure)\n \t\t\t\tdie(_(\"failed to get upstream, if you want to record base commit automatically,\\n\"\n@@ -1732,14 +1732,14 @@ static struct commit *get_base_commit(const struct format_config *cfg,\n \t\t\t\tif (die_on_failure) {\n \t\t\t\t\tdie(_(\"failed to find exact merge base\"));\n \t\t\t\t} else {\n-\t\t\t\t\tfree_commit_list(merge_base);\n+\t\t\t\t\tcommit_list_free(merge_base);\n \t\t\t\t\tfree(rev);\n \t\t\t\t\treturn NULL;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\trev[i] = merge_base->item;\n-\t\t\tfree_commit_list(merge_base);\n+\t\t\tcommit_list_free(merge_base);\n \t\t}\n \n \t\tif (rev_nr % 2)\n@@ -2610,7 +2610,7 @@ int cmd_cherry(int argc,\n \t\tprint_commit(sign, commit, verbose, abbrev, revs.diffopt.file);\n \t}\n \n-\tfree_commit_list(list);\n+\tcommit_list_free(list);\n \tfree_patch_ids(&ids);\n \treturn 0;\n }\ndiff --git a/builtin/merge-base.c b/builtin/merge-base.c\nindex 3f82781245..c7ee97fa6a 100644\n--- a/builtin/merge-base.c\n+++ b/builtin/merge-base.c\n@@ -15,7 +15,7 @@ static int show_merge_base(struct commit **rev, size_t rev_nr, int show_all)\n \n \tif (repo_get_merge_bases_many_dirty(the_repository, rev[0],\n \t\t\t\t\t    rev_nr - 1, rev + 1, &result) < 0) {\n-\t\tfree_commit_list(result);\n+\t\tcommit_list_free(result);\n \t\treturn -1;\n \t}\n \n@@ -28,7 +28,7 @@ static int show_merge_base(struct commit **rev, size_t rev_nr, int show_all)\n \t\t\tbreak;\n \t}\n \n-\tfree_commit_list(result);\n+\tcommit_list_free(result);\n \treturn 0;\n }\n \n@@ -71,7 +71,7 @@ static int handle_independent(int count, const char **args)\n \tfor (rev = revs; rev; rev = rev->next)\n \t\tprintf(\"%s\\n\", oid_to_hex(&rev->item->object.oid));\n \n-\tfree_commit_list(revs);\n+\tcommit_list_free(revs);\n \treturn 0;\n }\n \n@@ -85,11 +85,11 @@ static int handle_octopus(int count, const char **args, int show_all)\n \t\tcommit_list_insert(get_commit_reference(args[i]), &revs);\n \n \tif (get_octopus_merge_bases(revs, &result) < 0) {\n-\t\tfree_commit_list(revs);\n-\t\tfree_commit_list(result);\n+\t\tcommit_list_free(revs);\n+\t\tcommit_list_free(result);\n \t\treturn 128;\n \t}\n-\tfree_commit_list(revs);\n+\tcommit_list_free(revs);\n \treduce_heads_replace(&result);\n \n \tif (!result)\n@@ -101,7 +101,7 @@ static int handle_octopus(int count, const char **args, int show_all)\n \t\t\tbreak;\n \t}\n \n-\tfree_commit_list(result);\n+\tcommit_list_free(result);\n \treturn 0;\n }\n \ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 979a55d3b2..e141fef3ce 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -485,7 +485,7 @@ static int real_merge(struct merge_tree_options *o,\n \t\t\tdie(_(\"refusing to merge unrelated histories\"));\n \t\tmerge_bases = commit_list_reverse(merge_bases);\n \t\tmerge_incore_recursive(&opt, merge_bases, parent1, parent2, &result);\n-\t\tfree_commit_list(merge_bases);\n+\t\tcommit_list_free(merge_bases);\n \t}\n \n \tif (result.clean < 0)\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex c421a11b0b..6a0831a658 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -831,7 +831,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,\n \t\t\t\t       LOCK_DIE_ON_ERROR);\n \t\tclean = merge_ort_recursive(&o, head, remoteheads->item,\n \t\t\t\t\t    reversed, &result);\n-\t\tfree_commit_list(reversed);\n+\t\tcommit_list_free(reversed);\n \t\tstrbuf_release(&o.obuf);\n \n \t\tif (clean < 0) {\n@@ -1006,7 +1006,7 @@ static int merge_trivial(struct commit *head, struct commit_list *remoteheads)\n \tfinish(head, remoteheads, &result_commit, \"In-index merge\");\n \n \tremove_merge_branch_state(the_repository);\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \treturn 0;\n }\n \n@@ -1022,7 +1022,7 @@ static int finish_automerge(struct commit *head,\n \tstruct object_id result_commit;\n \n \twrite_tree_trivial(result_tree);\n-\tfree_commit_list(common);\n+\tcommit_list_free(common);\n \tparents = remoteheads;\n \tif (!head_subsumed || fast_forward == FF_NO)\n \t\tcommit_list_insert(head, &parents);\n@@ -1035,7 +1035,7 @@ static int finish_automerge(struct commit *head,\n \n \tstrbuf_release(&buf);\n \tremove_merge_branch_state(the_repository);\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \treturn 0;\n }\n \n@@ -1197,7 +1197,7 @@ static struct commit_list *reduce_parents(struct commit *head_commit,\n \n \t/* Find what parents to record by checking independent ones. */\n \tparents = reduce_heads(remoteheads);\n-\tfree_commit_list(remoteheads);\n+\tcommit_list_free(remoteheads);\n \n \tremoteheads = NULL;\n \tremotes = &remoteheads;\n@@ -1748,7 +1748,7 @@ int cmd_merge(int argc,\n \t\t\t\texit(128);\n \n \t\t\tcommon_item = common_one->item;\n-\t\t\tfree_commit_list(common_one);\n+\t\t\tcommit_list_free(common_one);\n \t\t\tif (!oideq(&common_item->object.oid, &j->item->object.oid)) {\n \t\t\t\tup_to_date = 0;\n \t\t\t\tbreak;\n@@ -1880,8 +1880,8 @@ int cmd_merge(int argc,\n \n done:\n \tif (!automerge_was_ok) {\n-\t\tfree_commit_list(common);\n-\t\tfree_commit_list(remoteheads);\n+\t\tcommit_list_free(common);\n+\t\tcommit_list_free(remoteheads);\n \t}\n \tstrbuf_release(&buf);\n \tfree(branch_to_free);\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 3ff748e0b3..6ad420ce6f 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -704,14 +704,14 @@ static int get_octopus_merge_base(struct object_id *merge_base,\n \n \tif (get_octopus_merge_bases(revs, &result) < 0)\n \t\texit(128);\n-\tfree_commit_list(revs);\n+\tcommit_list_free(revs);\n \treduce_heads_replace(&result);\n \n \tif (!result)\n \t\treturn 1;\n \n \toidcpy(merge_base, &result->item->object.oid);\n-\tfree_commit_list(result);\n+\tcommit_list_free(result);\n \treturn 0;\n }\n \n@@ -803,7 +803,7 @@ static int get_can_ff(struct object_id *orig_head,\n \tcommit_list_insert(head, &list);\n \tmerge_head = lookup_commit_reference(the_repository, orig_merge_head);\n \tret = repo_is_descendant_of(the_repository, merge_head, list);\n-\tfree_commit_list(list);\n+\tcommit_list_free(list);\n \tif (ret < 0)\n \t\texit(128);\n \treturn ret;\n@@ -828,7 +828,7 @@ static int already_up_to_date(struct object_id *orig_head,\n \t\ttheirs = lookup_commit_reference(the_repository, &merge_heads->oid[i]);\n \t\tcommit_list_insert(theirs, &list);\n \t\tok = repo_is_descendant_of(the_repository, ours, list);\n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t\tif (ok < 0)\n \t\t\texit(128);\n \t\tif (!ok)\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex c468828189..c487e10907 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -912,7 +912,7 @@ static int can_fast_forward(struct commit *onto, struct commit *upstream,\n \tres = 1;\n \n done:\n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n \treturn res && is_linear_history(onto, head);\n }\n \n@@ -929,7 +929,7 @@ static void fill_branch_base(struct rebase_options *options,\n \telse\n \t\toidcpy(branch_base, &merge_bases->item->object.oid);\n \n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n }\n \n static int parse_opt_am(const struct option *opt, const char *arg, int unset)\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 99f876ba85..ddea8aa251 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -216,7 +216,7 @@ static inline void finish_object__ma(struct object *obj, const char *name)\n \n static void finish_commit(struct commit *commit)\n {\n-\tfree_commit_list(commit->parents);\n+\tcommit_list_free(commit->parents);\n \tcommit->parents = NULL;\n \tfree_commit_buffer(the_repository->parsed_objects,\n \t\t\t   commit);\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex f3ebc1d4ea..f02831b085 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -1008,7 +1008,7 @@ int cmd_show_branch(int ac,\n out:\n \tfor (size_t i = 0; i < ARRAY_SIZE(reflog_msg); i++)\n \t\tfree(reflog_msg[i]);\n-\tfree_commit_list(seen);\n+\tcommit_list_free(seen);\n \tclear_prio_queue(&queue);\n \tfree(args_copy);\n \tfree(head);\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 4cb2351787..aea68a16aa 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1495,7 +1495,7 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b\n \t\tgoto done;\n \t}\n \n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tparents = NULL;\n \n \tif (include_untracked) {\n@@ -1564,7 +1564,7 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b\n \tstrbuf_release(&commit_tree_label);\n \tstrbuf_release(&msg);\n \tstrbuf_release(&untracked_files);\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tfree(branch_name_buf);\n \treturn ret;\n }\n@@ -2184,7 +2184,7 @@ static int do_import_stash(struct repository *r, const char *rev)\n out:\n \tif (this && buffer)\n \t\trepo_unuse_commit_buffer(r, this, buffer);\n-\tfree_commit_list(items);\n+\tcommit_list_free(items);\n \tfree(msg);\n \n \treturn res;\n@@ -2318,7 +2318,7 @@ static int do_export_stash(struct repository *r,\n \t\tnext = commit_list_append(prev, next);\n \t\tnext = commit_list_append(stash, next);\n \t\tres = write_commit_with_parents(r, &out, &stash->object.oid, parents);\n-\t\tfree_commit_list(parents);\n+\t\tcommit_list_free(parents);\n \t\tif (res)\n \t\t\tgoto out;\n \t\tprev = lookup_commit_reference(r, &out);\n@@ -2330,7 +2330,7 @@ static int do_export_stash(struct repository *r,\n \t\tputs(oid_to_hex(&prev->object.oid));\n out:\n \tstrbuf_release(&revision);\n-\tfree_commit_list(items);\n+\tcommit_list_free(items);\n \n \treturn res;\n }\ndiff --git a/commit-graph.c b/commit-graph.c\nindex 00e8193adc..ed480c0537 100644\n--- a/commit-graph.c\n+++ b/commit-graph.c\n@@ -965,7 +965,7 @@ static int fill_commit_in_graph(struct commit *item,\n \tdo {\n \t\tif (g->chunk_extra_edges_size / sizeof(uint32_t) <= parent_data_pos) {\n \t\t\terror(_(\"commit-graph extra-edges pointer out of bounds\"));\n-\t\t\tfree_commit_list(item->parents);\n+\t\t\tcommit_list_free(item->parents);\n \t\t\titem->parents = NULL;\n \t\t\titem->object.parsed = 0;\n \t\t\treturn 0;\ndiff --git a/commit-reach.c b/commit-reach.c\nindex e7d9b3208f..9604bbdcce 100644\n--- a/commit-reach.c\n+++ b/commit-reach.c\n@@ -109,7 +109,7 @@ static int paint_down_to_common(struct repository *r,\n \t\t\t\tcontinue;\n \t\t\tif (repo_parse_commit(r, p)) {\n \t\t\t\tclear_prio_queue(&queue);\n-\t\t\t\tfree_commit_list(*result);\n+\t\t\t\tcommit_list_free(*result);\n \t\t\t\t*result = NULL;\n \t\t\t\t/*\n \t\t\t\t * At this stage, we know that the commit is\n@@ -166,7 +166,7 @@ static int merge_bases_many(struct repository *r,\n \t}\n \n \tif (paint_down_to_common(r, one, n, twos, 0, 0, &list)) {\n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t\treturn -1;\n \t}\n \n@@ -195,8 +195,8 @@ int get_octopus_merge_bases(struct commit_list *in, struct commit_list **result)\n \t\t\tstruct commit_list *bases = NULL;\n \t\t\tif (repo_get_merge_bases(the_repository, i->item,\n \t\t\t\t\t\t j->item, &bases) < 0) {\n-\t\t\t\tfree_commit_list(bases);\n-\t\t\t\tfree_commit_list(*result);\n+\t\t\t\tcommit_list_free(bases);\n+\t\t\t\tcommit_list_free(*result);\n \t\t\t\t*result = NULL;\n \t\t\t\treturn -1;\n \t\t\t}\n@@ -207,7 +207,7 @@ int get_octopus_merge_bases(struct commit_list *in, struct commit_list **result)\n \t\t\tfor (k = bases; k; k = k->next)\n \t\t\t\tend = k;\n \t\t}\n-\t\tfree_commit_list(*result);\n+\t\tcommit_list_free(*result);\n \t\t*result = new_commits;\n \t}\n \treturn 0;\n@@ -249,7 +249,7 @@ static int remove_redundant_no_gen(struct repository *r,\n \t\t\t\t\t work, min_generation, 0, &common)) {\n \t\t\tclear_commit_marks(array[i], all_flags);\n \t\t\tclear_commit_marks_many(filled, work, all_flags);\n-\t\t\tfree_commit_list(common);\n+\t\t\tcommit_list_free(common);\n \t\t\tfree(work);\n \t\t\tfree(redundant);\n \t\t\tfree(filled_index);\n@@ -262,7 +262,7 @@ static int remove_redundant_no_gen(struct repository *r,\n \t\t\t\tredundant[filled_index[j]] = 1;\n \t\tclear_commit_marks(array[i], all_flags);\n \t\tclear_commit_marks_many(filled, work, all_flags);\n-\t\tfree_commit_list(common);\n+\t\tcommit_list_free(common);\n \t}\n \n \t/* Now collect the result */\n@@ -374,7 +374,7 @@ static int remove_redundant_with_gen(struct repository *r,\n \t\t\tif (!parents)\n \t\t\t\tpop_commit(&stack);\n \t\t}\n-\t\tfree_commit_list(stack);\n+\t\tcommit_list_free(stack);\n \t}\n \tfree(sorted);\n \n@@ -451,7 +451,7 @@ static int get_merge_bases_many_0(struct repository *r,\n \tCALLOC_ARRAY(rslt, cnt);\n \tfor (list = *result, i = 0; list; list = list->next)\n \t\trslt[i++] = list->item;\n-\tfree_commit_list(*result);\n+\tcommit_list_free(*result);\n \t*result = NULL;\n \n \tclear_commit_marks(one, all_flags);\n@@ -510,7 +510,7 @@ int repo_is_descendant_of(struct repository *r,\n \t\tint result;\n \t\tcommit_list_insert(commit, &from_list);\n \t\tresult = can_all_from_reach(from_list, with_commit, 0);\n-\t\tfree_commit_list(from_list);\n+\t\tcommit_list_free(from_list);\n \t\treturn result;\n \t} else {\n \t\twhile (with_commit) {\n@@ -561,7 +561,7 @@ int repo_in_merge_bases_many(struct repository *r, struct commit *commit,\n \t\tret = 1;\n \tclear_commit_marks(commit, all_flags);\n \tclear_commit_marks_many(nr_reference, reference, all_flags);\n-\tfree_commit_list(bases);\n+\tcommit_list_free(bases);\n \treturn ret;\n }\n \n@@ -578,7 +578,7 @@ int repo_in_merge_bases(struct repository *r,\n \n \tnext = commit_list_append(commit, next);\n \tres = repo_is_descendant_of(r, reference, list);\n-\tfree_commit_list(list);\n+\tcommit_list_free(list);\n \n \treturn res;\n }\n@@ -626,7 +626,7 @@ struct commit_list *reduce_heads(struct commit_list *heads)\n void reduce_heads_replace(struct commit_list **heads)\n {\n \tstruct commit_list *result = reduce_heads(*heads);\n-\tfree_commit_list(*heads);\n+\tcommit_list_free(*heads);\n \t*heads = result;\n }\n \n@@ -661,7 +661,7 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)\n \t\t\t\t    new_commit, old_commit_list);\n \tif (ret < 0)\n \t\texit(128);\n-\tfree_commit_list(old_commit_list);\n+\tcommit_list_free(old_commit_list);\n \treturn ret;\n }\n \n@@ -1236,7 +1236,7 @@ void tips_reachable_from_bases(struct repository *r,\n done:\n \tfree(commits);\n \trepo_clear_commit_marks(r, SEEN);\n-\tfree_commit_list(stack);\n+\tcommit_list_free(stack);\n }\n \n /*\ndiff --git a/commit.c b/commit.c\nindex 36f02c96aa..ddda9ee19d 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -191,7 +191,7 @@ void unparse_commit(struct repository *r, const struct object_id *oid)\n \n \tif (!c->object.parsed)\n \t\treturn;\n-\tfree_commit_list(c->parents);\n+\tcommit_list_free(c->parents);\n \tc->parents = NULL;\n \tc->object.parsed = 0;\n }\n@@ -436,7 +436,7 @@ void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)\n \tset_commit_tree(c, NULL);\n \tfree_commit_buffer(pool, c);\n \tc->index = 0;\n-\tfree_commit_list(c->parents);\n+\tcommit_list_free(c->parents);\n \n \tc->object.parsed = 0;\n }\n@@ -480,7 +480,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b\n \t * same error, but that's good, since it lets our caller know\n \t * the result cannot be trusted.\n \t */\n-\tfree_commit_list(item->parents);\n+\tcommit_list_free(item->parents);\n \titem->parents = NULL;\n \n \ttail += size;\n@@ -702,7 +702,7 @@ struct commit_list *commit_list_reverse(struct commit_list *list)\n \treturn next;\n }\n \n-void free_commit_list(struct commit_list *list)\n+void commit_list_free(struct commit_list *list)\n {\n \twhile (list)\n \t\tpop_commit(&list);\n@@ -977,7 +977,7 @@ void sort_in_topological_order(struct commit_list **list, enum rev_sort_order so\n \t\tprio_queue_reverse(&queue);\n \n \t/* We no longer need the commit list */\n-\tfree_commit_list(orig);\n+\tcommit_list_free(orig);\n \n \tpptr = list;\n \t*list = NULL;\n@@ -1107,7 +1107,7 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)\n \n cleanup_return:\n \tfree(revs.commit);\n-\tfree_commit_list(bases);\n+\tcommit_list_free(bases);\n \tfree(full_refname);\n \treturn ret;\n }\ndiff --git a/commit.h b/commit.h\nindex f50d9e5a4a..1635de418b 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -191,7 +191,7 @@ struct commit_list *commit_list_copy(const struct commit_list *list);\n /* Modify list in-place to reverse it, returning new head; list will be tail */\n struct commit_list *commit_list_reverse(struct commit_list *list);\n \n-void free_commit_list(struct commit_list *list);\n+void commit_list_free(struct commit_list *list);\n \n /*\n  * Deprecated compatibility functions for `struct commit_list`, to be removed\n@@ -207,6 +207,11 @@ static inline struct commit_list *reverse_commit_list(struct commit_list *l)\n \treturn commit_list_reverse(l);\n }\n \n+static inline void free_commit_list(struct commit_list *l)\n+{\n+\tcommit_list_free(l);\n+}\n+\n struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */\n \n const char *repo_logmsg_reencode(struct repository *r,\ndiff --git a/contrib/coccinelle/free.cocci b/contrib/coccinelle/free.cocci\nindex 6fb9eb6e88..03799e1908 100644\n--- a/contrib/coccinelle/free.cocci\n+++ b/contrib/coccinelle/free.cocci\n@@ -5,7 +5,7 @@ expression E;\n (\n   free(E);\n |\n-  free_commit_list(E);\n+  commit_list_free(E);\n )\n \n @@\n@@ -15,7 +15,7 @@ expression E;\n (\n   free(E);\n |\n-  free_commit_list(E);\n+  commit_list_free(E);\n )\n \n @@\n@@ -30,7 +30,7 @@ expression E;\n @@\n - if (E)\n - {\n-  free_commit_list(E);\n+  commit_list_free(E);\n   E = NULL;\n - }\n \n@@ -41,5 +41,5 @@ statement S;\n - if (E) {\n + if (E)\n   S\n-  free_commit_list(E);\n+  commit_list_free(E);\n - }\ndiff --git a/diff-lib.c b/diff-lib.c\nindex 5307390ff3..4772e5a561 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -615,7 +615,7 @@ void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)\n \n \toidcpy(mb, &merge_bases->item->object.oid);\n \n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n }\n \n void run_diff_index(struct rev_info *revs, unsigned int option)\ndiff --git a/fmt-merge-msg.c b/fmt-merge-msg.c\nindex c9085edc40..877a7daed5 100644\n--- a/fmt-merge-msg.c\n+++ b/fmt-merge-msg.c\n@@ -421,7 +421,7 @@ static void shortlog(const char *name,\n \n \tclear_commit_marks((struct commit *)branch, flags);\n \tclear_commit_marks(head, flags);\n-\tfree_commit_list(rev->commits);\n+\tcommit_list_free(rev->commits);\n \trev->commits = NULL;\n \trev->pending.nr = 0;\n \ndiff --git a/line-log.c b/line-log.c\nindex 8bd422148d..eeaf68454e 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -1239,7 +1239,7 @@ static int process_ranges_merge_commit(struct rev_info *rev, struct commit *comm\n \t\t\t * don't follow any other path in history\n \t\t\t */\n \t\t\tadd_line_range(rev, parent, cand[i]);\n-\t\t\tfree_commit_list(commit->parents);\n+\t\t\tcommit_list_free(commit->parents);\n \t\t\tcommit_list_append(parent, &commit->parents);\n \n \t\t\tret = 0;\ndiff --git a/log-tree.c b/log-tree.c\nindex 1729b0c201..7e048701d0 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -1077,7 +1077,7 @@ static int do_remerge_diff(struct rev_info *opt,\n \tlog_tree_diff_flush(opt);\n \n \t/* Cleanup */\n-\tfree_commit_list(bases);\n+\tcommit_list_free(bases);\n \tcleanup_additional_headers(&opt->diffopt);\n \tstrbuf_release(&parent1_desc);\n \tstrbuf_release(&parent2_desc);\ndiff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c\nindex c54d56b344..2110844f53 100644\n--- a/merge-ort-wrappers.c\n+++ b/merge-ort-wrappers.c\n@@ -120,7 +120,7 @@ int merge_ort_generic(struct merge_options *opt,\n \trepo_hold_locked_index(opt->repo, &lock, LOCK_DIE_ON_ERROR);\n \tclean = merge_ort_recursive(opt, head_commit, next_commit, ca,\n \t\t\t\t    result);\n-\tfree_commit_list(ca);\n+\tcommit_list_free(ca);\n \tif (clean < 0) {\n \t\trollback_lock_file(&lock);\n \t\treturn clean;\ndiff --git a/merge-ort.c b/merge-ort.c\nindex 2ddaaffc26..0c755361cd 100644\n--- a/merge-ort.c\n+++ b/merge-ort.c\n@@ -5382,7 +5382,7 @@ static void merge_ort_internal(struct merge_options *opt,\n \topt->ancestor = NULL;  /* avoid accidental re-use of opt->ancestor */\n \n out:\n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n }\n \n void merge_incore_nonrecursive(struct merge_options *opt,\ndiff --git a/notes-merge.c b/notes-merge.c\nindex 586939939f..49d0dadd32 100644\n--- a/notes-merge.c\n+++ b/notes-merge.c\n@@ -668,11 +668,11 @@ int notes_merge(struct notes_merge_options *o,\n \t\tcommit_list_insert(local, &parents);\n \t\tcreate_notes_commit(o->repo, local_tree, parents, o->commit_msg.buf,\n \t\t\t\t    o->commit_msg.len, result_oid);\n-\t\tfree_commit_list(parents);\n+\t\tcommit_list_free(parents);\n \t}\n \n found_result:\n-\tfree_commit_list(bases);\n+\tcommit_list_free(bases);\n \tstrbuf_release(&(o->commit_msg));\n \ttrace_printf(\"notes_merge(): result = %i, result_oid = %.7s\\n\",\n \t       result, oid_to_hex(result_oid));\ndiff --git a/notes-utils.c b/notes-utils.c\nindex 6a50c6d564..5c1c75d5b8 100644\n--- a/notes-utils.c\n+++ b/notes-utils.c\n@@ -40,7 +40,7 @@ void create_notes_commit(struct repository *r,\n \t\t\tNULL))\n \t\tdie(\"Failed to commit notes tree to database\");\n \n-\tfree_commit_list(parents_to_free);\n+\tcommit_list_free(parents_to_free);\n }\n \n void commit_notes(struct repository *r, struct notes_tree *t, const char *msg)\ndiff --git a/object-name.c b/object-name.c\nindex 8b862c124e..e697566423 100644\n--- a/object-name.c\n+++ b/object-name.c\n@@ -1281,7 +1281,7 @@ static int peel_onion(struct repository *r, const char *name, int len,\n \t\tcommit_list_insert((struct commit *)o, &list);\n \t\tret = get_oid_oneline(r, prefix, oid, list);\n \n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t\tfree(prefix);\n \t\treturn ret;\n \t}\n@@ -1623,7 +1623,7 @@ int repo_get_oid_mb(struct repository *r,\n \tif (!two)\n \t\treturn -1;\n \tif (repo_get_merge_bases(r, one, two, &mbs) < 0) {\n-\t\tfree_commit_list(mbs);\n+\t\tcommit_list_free(mbs);\n \t\treturn -1;\n \t}\n \tif (!mbs || mbs->next)\n@@ -1632,7 +1632,7 @@ int repo_get_oid_mb(struct repository *r,\n \t\tst = 0;\n \t\toidcpy(oid, &mbs->item->object.oid);\n \t}\n-\tfree_commit_list(mbs);\n+\tcommit_list_free(mbs);\n \treturn st;\n }\n \n@@ -2052,7 +2052,7 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,\n \t\t\trefs_head_ref(get_main_ref_store(repo), handle_one_ref, &cb);\n \t\t\tret = get_oid_oneline(repo, name + 2, oid, list);\n \n-\t\t\tfree_commit_list(list);\n+\t\t\tcommit_list_free(list);\n \t\t\treturn ret;\n \t\t}\n \t\tif (namelen < 3 ||\ndiff --git a/pack-bitmap-write.c b/pack-bitmap-write.c\nindex bf73ce5710..2e3f1c1530 100644\n--- a/pack-bitmap-write.c\n+++ b/pack-bitmap-write.c\n@@ -306,7 +306,7 @@ struct bb_commit {\n \n static void clear_bb_commit(struct bb_commit *commit)\n {\n-\tfree_commit_list(commit->reverse_edges);\n+\tcommit_list_free(commit->reverse_edges);\n \tbitmap_free(commit->commit_mask);\n \tbitmap_free(commit->bitmap);\n }\n@@ -414,7 +414,7 @@ static void bitmap_builder_init(struct bitmap_builder *bb,\n \t\t\t\tp_ent->maximal = 1;\n \t\t\telse {\n \t\t\t\tp_ent->maximal = 0;\n-\t\t\t\tfree_commit_list(p_ent->reverse_edges);\n+\t\t\t\tcommit_list_free(p_ent->reverse_edges);\n \t\t\t\tp_ent->reverse_edges = NULL;\n \t\t\t}\n \n@@ -445,7 +445,7 @@ static void bitmap_builder_init(struct bitmap_builder *bb,\n \t\t\t   \"num_maximal_commits\", num_maximal);\n \n \trelease_revisions(&revs);\n-\tfree_commit_list(reusable);\n+\tcommit_list_free(reusable);\n }\n \n static void bitmap_builder_clear(struct bitmap_builder *bb)\ndiff --git a/ref-filter.c b/ref-filter.c\nindex c318f9ca0e..3917c4ccd9 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -3782,9 +3782,9 @@ void ref_filter_clear(struct ref_filter *filter)\n {\n \tstrvec_clear(&filter->exclude);\n \toid_array_clear(&filter->points_at);\n-\tfree_commit_list(filter->with_commit);\n-\tfree_commit_list(filter->no_commit);\n-\tfree_commit_list(filter->reachable_from);\n-\tfree_commit_list(filter->unreachable_from);\n+\tcommit_list_free(filter->with_commit);\n+\tcommit_list_free(filter->no_commit);\n+\tcommit_list_free(filter->reachable_from);\n+\tcommit_list_free(filter->unreachable_from);\n \tref_filter_init(filter);\n }\ndiff --git a/reflog.c b/reflog.c\nindex ac87e20c4f..1460ae9d0d 100644\n--- a/reflog.c\n+++ b/reflog.c\n@@ -493,7 +493,7 @@ void reflog_expiry_cleanup(void *cb_data)\n \tcase UE_HEAD:\n \t\tfor (elem = cb->tips; elem; elem = elem->next)\n \t\t\tclear_commit_marks(elem->item, REACHABLE);\n-\t\tfree_commit_list(cb->tips);\n+\t\tcommit_list_free(cb->tips);\n \t\tbreak;\n \tcase UE_NORMAL:\n \t\tclear_commit_marks(cb->tip_commit, REACHABLE);\n@@ -501,7 +501,7 @@ void reflog_expiry_cleanup(void *cb_data)\n \t}\n \tfor (elem = cb->mark_list; elem; elem = elem->next)\n \t\tclear_commit_marks(elem->item, REACHABLE);\n-\tfree_commit_list(cb->mark_list);\n+\tcommit_list_free(cb->mark_list);\n }\n \n int count_reflog_ent(const char *refname UNUSED,\ndiff --git a/remote.c b/remote.c\nindex b756ff6f15..1c8a9f1a88 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1497,7 +1497,7 @@ static void add_missing_tags(struct ref *src, struct ref **dst, struct ref ***ds\n \t\tclear_commit_marks_many(src_commits.nr, src_commits.items,\n \t\t\t\t\treachable_flag);\n \t\tcommit_stack_clear(&src_commits);\n-\t\tfree_commit_list(found_commits);\n+\t\tcommit_list_free(found_commits);\n \t}\n \n \tstring_list_clear(&src_tag, 0);\ndiff --git a/revision.c b/revision.c\nindex 9f5baceb85..6d207c2f23 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1048,7 +1048,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)\n \t\t\t\tcontinue;\n \t\t\t}\n \n-\t\t\tfree_commit_list(parent->next);\n+\t\t\tcommit_list_free(parent->next);\n \t\t\tparent->next = NULL;\n \t\t\twhile (commit->parents != parent)\n \t\t\t\tpop_commit(&commit->parents);\n@@ -1083,7 +1083,7 @@ static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)\n \t\t\t\t\tdie(\"cannot simplify commit %s (invalid %s)\",\n \t\t\t\t\t    oid_to_hex(&commit->object.oid),\n \t\t\t\t\t    oid_to_hex(&p->object.oid));\n-\t\t\t\tfree_commit_list(p->parents);\n+\t\t\t\tcommit_list_free(p->parents);\n \t\t\t\tp->parents = NULL;\n \t\t\t}\n \t\t/* fallthrough */\n@@ -1405,7 +1405,7 @@ static void limit_to_ancestry(struct commit_list *bottoms, struct commit_list *l\n \t\tp->item->object.flags &= ~(TMP_MARK | ANCESTRY_PATH);\n \tfor (p = bottoms; p; p = p->next)\n \t\tp->item->object.flags &= ~(TMP_MARK | ANCESTRY_PATH);\n-\tfree_commit_list(rlist);\n+\tcommit_list_free(rlist);\n }\n \n /*\n@@ -1508,7 +1508,7 @@ static int limit_list(struct rev_info *revs)\n \t\t}\n \t}\n \n-\tfree_commit_list(original_list);\n+\tcommit_list_free(original_list);\n \trevs->commits = newlist;\n \treturn 0;\n }\n@@ -2011,7 +2011,7 @@ static void prepare_show_merge(struct rev_info *revs)\n \t\texit(128);\n \tadd_rev_cmdline_list(revs, bases, REV_CMD_MERGE_BASE, UNINTERESTING | BOTTOM);\n \tadd_pending_commit_list(revs, bases, UNINTERESTING | BOTTOM);\n-\tfree_commit_list(bases);\n+\tcommit_list_free(bases);\n \thead->object.flags |= SYMMETRIC_LEFT;\n \n \tif (!istate->cache_nr)\n@@ -2105,13 +2105,13 @@ static int handle_dotdot_1(const char *arg, char *dotdot,\n \t\t\treturn dotdot_missing(arg, dotdot, revs, symmetric);\n \n \t\tif (repo_get_merge_bases(the_repository, a, b, &exclude) < 0) {\n-\t\t\tfree_commit_list(exclude);\n+\t\t\tcommit_list_free(exclude);\n \t\t\treturn -1;\n \t\t}\n \t\tadd_rev_cmdline_list(revs, exclude, REV_CMD_MERGE_BASE,\n \t\t\t\t     flags_exclude);\n \t\tadd_pending_commit_list(revs, exclude, flags_exclude);\n-\t\tfree_commit_list(exclude);\n+\t\tcommit_list_free(exclude);\n \n \t\tb_flags = flags;\n \t\ta_flags = flags | SYMMETRIC_LEFT;\n@@ -3221,13 +3221,13 @@ static void release_revisions_bloom_keyvecs(struct rev_info *revs)\n \n static void free_void_commit_list(void *list)\n {\n-\tfree_commit_list(list);\n+\tcommit_list_free(list);\n }\n \n void release_revisions(struct rev_info *revs)\n {\n-\tfree_commit_list(revs->commits);\n-\tfree_commit_list(revs->ancestry_path_bottoms);\n+\tcommit_list_free(revs->commits);\n+\tcommit_list_free(revs->ancestry_path_bottoms);\n \trelease_display_notes(&revs->notes_opt);\n \tobject_array_clear(&revs->pending);\n \tobject_array_clear(&revs->boundary_commits);\n@@ -3335,7 +3335,7 @@ static int mark_redundant_parents(struct commit *commit)\n \tif (i != cnt || cnt+marked != orig_cnt)\n \t\tdie(\"mark_redundant_parents %d %d %d %d\", orig_cnt, cnt, i, marked);\n \n-\tfree_commit_list(h);\n+\tcommit_list_free(h);\n \n \treturn marked;\n }\n@@ -4232,7 +4232,7 @@ static void save_parents(struct rev_info *revs, struct commit *commit)\n static void free_saved_parent(struct commit_list **parents)\n {\n \tif (*parents != EMPTY_PARENT_LIST)\n-\t\tfree_commit_list(*parents);\n+\t\tcommit_list_free(*parents);\n }\n \n static void free_saved_parents(struct rev_info *revs)\n@@ -4293,7 +4293,7 @@ static void track_linear(struct rev_info *revs, struct commit *commit)\n \t\tif (revs->linear)\n \t\t\tcommit->object.flags |= TRACK_LINEAR;\n \t}\n-\tfree_commit_list(revs->previous_parents);\n+\tcommit_list_free(revs->previous_parents);\n \trevs->previous_parents = commit_list_copy(commit->parents);\n }\n \n@@ -4382,7 +4382,7 @@ static void create_boundary_commit_list(struct rev_info *revs)\n \t * boundary commits anyway.  (This is what the code has always\n \t * done.)\n \t */\n-\tfree_commit_list(revs->commits);\n+\tcommit_list_free(revs->commits);\n \trevs->commits = NULL;\n \n \t/*\n@@ -4504,7 +4504,7 @@ struct commit *get_revision(struct rev_info *revs)\n \t\treversed = NULL;\n \t\twhile ((c = get_revision_internal(revs)))\n \t\t\tcommit_list_insert(c, &reversed);\n-\t\tfree_commit_list(revs->commits);\n+\t\tcommit_list_free(revs->commits);\n \t\trevs->commits = reversed;\n \t\trevs->reverse = 0;\n \t\trevs->reverse_output_stage = 1;\n@@ -4522,7 +4522,7 @@ struct commit *get_revision(struct rev_info *revs)\n \t\tgraph_update(revs->graph, c);\n \tif (!c) {\n \t\tfree_saved_parents(revs);\n-\t\tfree_commit_list(revs->previous_parents);\n+\t\tcommit_list_free(revs->previous_parents);\n \t\trevs->previous_parents = NULL;\n \t}\n \treturn c;\ndiff --git a/sequencer.c b/sequencer.c\nindex e09f8eed55..f5a6496937 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1698,7 +1698,7 @@ static int try_to_commit(struct repository *r,\n \n out:\n \tfree_commit_extra_headers(extra);\n-\tfree_commit_list(parents);\n+\tcommit_list_free(parents);\n \tstrbuf_release(&err);\n \tstrbuf_release(&commit_msg);\n \tfree(amend_author);\n@@ -2476,8 +2476,8 @@ static int do_pick_commit(struct repository *r,\n \t\tres |= try_merge_command(r, opts->strategy,\n \t\t\t\t\t opts->xopts.nr, opts->xopts.v,\n \t\t\t\t\tcommon, oid_to_hex(&head), remotes);\n-\t\tfree_commit_list(common);\n-\t\tfree_commit_list(remotes);\n+\t\tcommit_list_free(common);\n+\t\tcommit_list_free(remotes);\n \t}\n \n \t/*\n@@ -4381,8 +4381,8 @@ static int do_merge(struct repository *r,\n leave_merge:\n \tstrbuf_release(&ref_name);\n \trollback_lock_file(&lock);\n-\tfree_commit_list(to_merge);\n-\tfree_commit_list(bases);\n+\tcommit_list_free(to_merge);\n+\tcommit_list_free(bases);\n \treturn ret;\n }\n \n@@ -6039,11 +6039,11 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \t\t\toidset_insert(&shown, oid);\n \t\t}\n \n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t}\n \n-\tfree_commit_list(commits);\n-\tfree_commit_list(tips);\n+\tcommit_list_free(commits);\n+\tcommit_list_free(tips);\n \n \tstrbuf_release(&label_from_message);\n \tstrbuf_release(&oneline);\ndiff --git a/shallow.c b/shallow.c\nindex c870efcefc..0409b1354c 100644\n--- a/shallow.c\n+++ b/shallow.c\n@@ -40,7 +40,7 @@ int register_shallow(struct repository *r, const struct object_id *oid)\n \toidcpy(&graft->oid, oid);\n \tgraft->nr_parent = -1;\n \tif (commit && commit->object.parsed) {\n-\t\tfree_commit_list(commit->parents);\n+\t\tcommit_list_free(commit->parents);\n \t\tcommit->parents = NULL;\n \t}\n \treturn register_commit_graft(r, graft, 0);\n@@ -267,7 +267,7 @@ struct commit_list *get_shallow_commits_by_rev_list(struct strvec *argv,\n \t\t\t\tbreak;\n \t\t\t}\n \t}\n-\tfree_commit_list(not_shallow_list);\n+\tcommit_list_free(not_shallow_list);\n \n \t/*\n \t * Now we can clean up NOT_SHALLOW on border commits. Having\ndiff --git a/submodule.c b/submodule.c\nindex 40a5c6fb9d..85e9586e66 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -639,7 +639,7 @@ void show_submodule_diff_summary(struct diff_options *o, const char *path,\n \tprint_submodule_diff_summary(sub, &rev, o);\n \n out:\n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n \trelease_revisions(&rev);\n \tclear_commit_marks(left, ~0);\n \tclear_commit_marks(right, ~0);\n@@ -729,7 +729,7 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,\n \n done:\n \tstrbuf_release(&sb);\n-\tfree_commit_list(merge_bases);\n+\tcommit_list_free(merge_bases);\n \tif (left)\n \t\tclear_commit_marks(left, ~0);\n \tif (right)\ndiff --git a/t/helper/test-reach.c b/t/helper/test-reach.c\nindex feabeb29c2..3131b54a87 100644\n--- a/t/helper/test-reach.c\n+++ b/t/helper/test-reach.c\n@@ -120,12 +120,12 @@ int cmd__reach(int ac, const char **av)\n \t\t\texit(128);\n \t\tprintf(\"%s(A,X):\\n\", av[1]);\n \t\tprint_sorted_commit_ids(list);\n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t} else if (!strcmp(av[1], \"reduce_heads\")) {\n \t\tstruct commit_list *list = reduce_heads(X);\n \t\tprintf(\"%s(X):\\n\", av[1]);\n \t\tprint_sorted_commit_ids(list);\n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t} else if (!strcmp(av[1], \"can_all_from_reach\")) {\n \t\tprintf(\"%s(X,Y):%d\\n\", av[1], can_all_from_reach(X, Y, 1));\n \t} else if (!strcmp(av[1], \"can_all_from_reach_with_flag\")) {\n@@ -172,13 +172,13 @@ int cmd__reach(int ac, const char **av)\n \t\t\tdie(_(\"too many commits marked reachable\"));\n \n \t\tprint_sorted_commit_ids(list);\n-\t\tfree_commit_list(list);\n+\t\tcommit_list_free(list);\n \t}\n \n \tobject_array_clear(&X_obj);\n \tstrbuf_release(&buf);\n-\tfree_commit_list(X);\n-\tfree_commit_list(Y);\n+\tcommit_list_free(X);\n+\tcommit_list_free(Y);\n \tcommit_stack_clear(&X_stack);\n \tcommit_stack_clear(&Y_stack);\n \treturn 0;\n\n-- \n2.52.0.660.gd05f3a8ea5.dirty\n\n"},{"id":"533955","messageId":"xmqqa4yfdmsp.fsf@gitster.g","threadId":"64808","inReplyTo":"20260115-pks-commit-list-coding-guidelines-v1-0-c58868dbf412@pks.im","subject":"Re: [PATCH 0/3] Rename commit list functions to conform to coding guidelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-15T13:32:06Z","receivedAt":"2026-01-15T13:32:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> I've been working with commit lists quite often recently, and every\n> single time I get bitten by the fact that a subset of its functions do\n> not conform to our coding guidelines. While most of the functions start\n> with `commit_list_*()`, three functions don't. This patch series fixes\n> this issue and renames the remaining three functions so that all of them\n> start with `commit_list_*()`.\n\n> Note that I'm adding compatibility wrappers for the old prototypes to\n> ease the transition and not make life hard for any in-flight patch\n> series. I've also dropped all changes that lead to conflicts with\n> \"seen\".\n\nWell, these are quite well established names, and seems to have\ndifferent callers between maint and master, which means that your\ncompatibility wrappers will need to stay there for some time because\nthese three patches will not apply to maint, leaving them in maint\nunder original names, and future fixes that involve maint, when\nmerged up to master and above, will still need these compatibility\nwrappers.\n\nPerhaps the new naming rules were introduced without surveying how\nestablished names that follow different rules are and how often\nthey acquire more calling sites?  Should we instead tone down the\nrules so that it says something like \"when you are introducing new\ntype S, then call functions around it this way using S_ prefix\",\nleaving established names excempt (which is quite different from\nletting sleeping dogs lie---as long as they acquire new callers and\nthe code that uses them change, they are not sleeping)?\n\n"},{"id":"534014","messageId":"aWngu0AZx5Akd_m0@pks.im","threadId":"64808","inReplyTo":"xmqqa4yfdmsp.fsf@gitster.g","subject":"Re: [PATCH 0/3] Rename commit list functions to conform to coding guidelines","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-01-16T06:54:51Z","receivedAt":"2026-01-16T06:54:56Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Jan 15, 2026 at 05:32:06AM -0800, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > I've been working with commit lists quite often recently, and every\n> > single time I get bitten by the fact that a subset of its functions do\n> > not conform to our coding guidelines. While most of the functions start\n> > with `commit_list_*()`, three functions don't. This patch series fixes\n> > this issue and renames the remaining three functions so that all of them\n> > start with `commit_list_*()`.\n> \n> > Note that I'm adding compatibility wrappers for the old prototypes to\n> > ease the transition and not make life hard for any in-flight patch\n> > series. I've also dropped all changes that lead to conflicts with\n> > \"seen\".\n> \n> Well, these are quite well established names, and seems to have\n> different callers between maint and master, which means that your\n> compatibility wrappers will need to stay there for some time because\n> these three patches will not apply to maint, leaving them in maint\n> under original names, and future fixes that involve maint, when\n> merged up to master and above, will still need these compatibility\n> wrappers.\n\nFair.\n\n> Perhaps the new naming rules were introduced without surveying how\n> established names that follow different rules are and how often\n> they acquire more calling sites?  Should we instead tone down the\n> rules so that it says something like \"when you are introducing new\n> type S, then call functions around it this way using S_ prefix\",\n> leaving established names excempt (which is quite different from\n> letting sleeping dogs lie---as long as they acquire new callers and\n> the code that uses them change, they are not sleeping)?\n\nI dunno. I myself prefer converging towards a consistent coding style,\nand part of that is to also adapt existing callers over time. One should\nfor sure be careful in this context and not go on a holy crusade against\nall violations of our coding guidelines, but I still think there's a\npoint to be made that a slow trickle of changes of sleeping code is\nfine.\n\nIn the case of these functions here I only did it because I was very\nannoyed eventually. There is this mix where most of the functions\nrelated to commit lists follow our guidelines, and only three of them\ndon't. The consequence is that you need to know by heart what the\nexceptions are, and I got this wrong every second time and that\neventually made me write this small patch series.\n\nIf it's considered to be too invasive that's fine, then I'll drop it. I\nthink there's value though (well, obviously, otherwise I wouldn't have\nsent the series :) ).\n\nThanks!\n\nPatrick\n"},{"id":"534054","messageId":"xmqqikd1a4h5.fsf@gitster.g","threadId":"64808","inReplyTo":"aWngu0AZx5Akd_m0@pks.im","subject":"Re: [PATCH 0/3] Rename commit list functions to conform to coding guidelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-16T16:48:22Z","receivedAt":"2026-01-16T16:48:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> I dunno. I myself prefer converging towards a consistent coding style,\n> and part of that is to also adapt existing callers over time. One should\n> for sure be careful in this context and not go on a holy crusade against\n> all violations of our coding guidelines, but I still think there's a\n> point to be made that a slow trickle of changes of sleeping code is\n> fine.\n\nI do not think there is any disagreement here.\n\n> If it's considered to be too invasive that's fine, then I'll drop it. I\n> think there's value though (well, obviously, otherwise I wouldn't have\n> sent the series :) ).\n\nSure, if there were not other activities in the codebase, we can aim\nfor perfection, but unfortunately we do not live in such an\nidealized world.  Among the three patches, the first two that\nweighed only around 100 lines in fewer than 10 hunks are not bad at\nall, but the other one was a bit too much.\n\nThe linked list of commits is handy but not particularly performant\ndata structure; instead of renaming component functions in the API,\nrewriting its users to use a better data structure might be a more\nproductive way to achieve the same goal.  There was a topic that\ngained quite a nice performance boost by rewriting code based on\ncommit_list to use prio_queue, for example, in the recent past.\n"}]}