Re: [PATCH v5 01/24] refs.h: add forward declaration for structs used in this file
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 22, 2017, 18:18 UTC
- Message-ID
- <CAGZ79kZTr924RrvG6RsasmhT1yswN875XShtmrrcJ8ztaAGJUw@mail.gmail.com>
- In-Reply-To
- <20170222140450.30886-2-pclouds@gmail.com>
On Wed, Feb 22, 2017 at 6:04 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 26 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > 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")
Maybe Michael has a better idea how to make this comment more accessible to the casual refs-reader.
Thanks, Stefan