aboutsummaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-01-15 10:35:32 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-15 05:32:31 -0800
commitff9fb2cfe6efb26b9d25dc5c114ab56126f9003e (patch)
treebe0759c59f6305d03d548da441896a78ab93aff1 /commit.h
parent8745eae506f700657882b9e32b2aa00f234a6fb6 (diff)
downloadgit-ff9fb2cfe6efb26b9d25dc5c114ab56126f9003e.tar.xz
commit: rename `copy_commit_list()` to conform to coding guidelines
Our coding guidelines say that: Functions that operate on `struct S` are named `S_<verb>()` and should generally receive a pointer to `struct S` as first parameter. While most of the functions related to `struct commit_list` already follow that naming schema, `copy_commit_list()` doesn't. Rename the function to address this and adjust all of its callers. Add a compatibility wrapper for the old function name to ease the transition and avoid any semantic conflicts with in-flight patch series. This wrapper will be removed once Git 2.53 has been released. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/commit.h b/commit.h
index 79a761c37d..2faf08cd18 100644
--- a/commit.h
+++ b/commit.h
@@ -186,13 +186,22 @@ struct commit_list *commit_list_insert_by_date(struct commit *item,
void commit_list_sort_by_date(struct commit_list **list);
/* Shallow copy of the input list */
-struct commit_list *copy_commit_list(const struct commit_list *list);
+struct commit_list *commit_list_copy(const struct commit_list *list);
/* Modify list in-place to reverse it, returning new head; list will be tail */
struct commit_list *reverse_commit_list(struct commit_list *list);
void free_commit_list(struct commit_list *list);
+/*
+ * Deprecated compatibility functions for `struct commit_list`, to be removed
+ * once Git 2.53 is released.
+ */
+static inline struct commit_list *copy_commit_list(struct commit_list *l)
+{
+ return commit_list_copy(l);
+}
+
struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
const char *repo_logmsg_reencode(struct repository *r,