Re: [RFCv2 06/16] remote.h: add new struct for options

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFCv2 06/16] remote.h: add new struct for options

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:06

Stefan Beller [off-list ref] writes:
Signed-off-by: Stefan Beller <redacted>
---
Why?
quoted hunk
 remote.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/remote.h b/remote.h
index d5242b0..16cacfe 100644
--- a/remote.h
+++ b/remote.h
@@ -56,6 +56,20 @@ struct remote {
 	char *http_proxy;
 };
 
+/* todo: discuss if this should be merged with
+ * git_transport_options in transport.c */
+struct transport_options {
+	unsigned multi_ack : 2;
+	unsigned no_done : 1;
+	unsigned use_thin_pack : 1;
+	unsigned no_progress : 1;
+	unsigned include_tag : 1;
+	unsigned prefer_ofs_delta : 1;
+	unsigned agent_supported : 1;
+	unsigned allow_tip_sha1_in_want : 1;
+	unsigned use_sideband;
+};
+
 struct remote *remote_get(const char *name);
 struct remote *pushremote_get(const char *name);
 int remote_is_configured(const char *name);

Re: [RFCv2 06/16] remote.h: add new struct for options

From: Stefan Beller <hidden>
Date: 2016-06-15 23:05:06

On Tue, Jun 2, 2015 at 2:18 PM, Junio C Hamano [off-list ref] wrote:
Why?
To have all options required for selecting the capabilities
together in one struct.

Currently there are independent variables used in a few places for this
(fetchpack.c: lines 296 - 309, which is where I also got the formatting from)

As soon as I realized I need to touch many places I thought about introducing
this struct.  But I guess I'll drop this as well as the patches
building on top of this
because it's actually only fetch-pack.c using it and it would have communicated
with the transport layer with this struct.

Maybe it is better to let the caller handle each option anyway, so that the
transport layer just invokes a callback at the caller (fetchpack or later on
sendpack) which immediately decides if it knows the capability and needs to
act on it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help