Thread (234 messages) 234 messages, 5 authors, 2017-04-07

Re: [PATCH v5 01/24] refs.h: add forward declaration for structs used in this file

From: Stefan Beller <hidden>
Date: 2017-02-22 18:18:23

On Wed, Feb 22, 2017 at 6:04 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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")

Maybe Michael has a better idea how to make this comment
more accessible to the casual refs-reader.

Thanks,
Stefan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help