From a468f3cefab32eed7d9a12bd6b93719d38ec67a6 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 15 Jan 2026 10:35:33 +0100 Subject: commit: rename `reverse_commit_list()` to conform to coding guidelines Our coding guidelines say that: Functions that operate on `struct S` are named `S_()` 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, `reverse_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 Signed-off-by: Junio C Hamano --- commit.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'commit.h') diff --git a/commit.h b/commit.h index 2faf08cd18..f50d9e5a4a 100644 --- a/commit.h +++ b/commit.h @@ -189,7 +189,7 @@ void commit_list_sort_by_date(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); +struct commit_list *commit_list_reverse(struct commit_list *list); void free_commit_list(struct commit_list *list); @@ -202,6 +202,11 @@ static inline struct commit_list *copy_commit_list(struct commit_list *l) return commit_list_copy(l); } +static inline struct commit_list *reverse_commit_list(struct commit_list *l) +{ + return commit_list_reverse(l); +} + struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ const char *repo_logmsg_reencode(struct repository *r, -- cgit v1.3