Re: [PATCH v5 01/24] refs.h: add forward declaration for structs used in this file
From: Duy Nguyen <hidden>
Date: 2017-02-23 09:35:36
On Thu, Feb 23, 2017 at 1:18 AM, Stefan Beller [off-list ref] wrote:
On Wed, Feb 22, 2017 at 6:04 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:quoted
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- refs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)diff --git a/refs.h b/refs.h index 9fbff90e7..c494b641a 100644 --- a/refs.h +++ b/refs.h@@ -1,6 +1,11 @@ #ifndef REFS_H #define REFS_H +struct object_id; +struct ref_transaction; +struct strbuf; +struct string_list; + /* * Resolve a reference, recursively following symbolic refererences. *@@ -144,7 +149,6 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **ref); * `ref_transaction_commit` is called. So `ref_transaction_verify` * won't report a verification failure until the commit is attempted. */ -struct ref_transaction;Leaving the detailed comment about ref_transaction dangling? I can understand if you don't want to move it with the declaration, as you want all declarations terse in a few lines. Maybe move the comment to be part of the first large comment (The one that you can see in the first hunk, starting with " * Resolve a reference, recursively following")
I thought the comment block covered the following declarations too, not just ref_transaction. But on second read it's not that. Transaction functions are way down below. I'll probably move ref_transaction back where it was. -- Duy