On 03/23, Duy Nguyen wrote:
> On Fri, Mar 23, 2018 at 6:03 PM, Duy Nguyen wrote:
> > On Wed, Mar 21, 2018 at 11:18 PM, Brandon Williams
> > wrote:
> >> You're marking packed_git
> >> as "private"...well C has no notion of private vs public fie
_packed_git_mru() introduced
> earlier will call prepare_packed_git() automatically.
>
> The whole thing is also available at
>
> https://github.com/pclouds/git/tree/ignore-env-object-store-packfiles
>
> And interdiff of all three, compared to what is currently in 'pu'.
> Looks pretty good in my opinon:
The only major issue I could find is with patch 40 and must be fixed
before this can be merged. The rest of the series looks good.
--
Brandon Williams
packed_git(the_repository); p; p = p->next) {
> /* we ignore things on alternate path since they are
>* not available to the pullers in general.
> diff --git a/sha1_name.c b/sha1_name.c
> index cb42e398b2..f25a0970ca 100644
> --- a/sha1_name.c
> +++ b/sha1_name.c
> @@ -195,7 +195,6 @@ static void find_short_packed_object(struct
> disambiguate_state *ds)
> {
> struct packed_git *p;
>
> - prepare_packed_git(the_repository);
> for (p = get_packed_git(the_repository); p && !ds->ambiguous;
>p = p->next)
> unique_in_pack(p, ds);
> @@ -566,7 +565,6 @@ static void find_abbrev_len_packed(struct min_abbrev_data
> *mad)
> {
> struct packed_git *p;
>
> - prepare_packed_git(the_repository);
> for (p = get_packed_git(the_repository); p; p = p->next)
> find_abbrev_len_for_pack(p, mad);
> }
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
pare_packed_git_##r()
> -extern void prepare_packed_git_the_repository(void);
> +extern void prepare_packed_git(struct repository *r);
> #define reprepare_packed_git(r) reprepare_packed_git_##r()
> extern void reprepare_packed_git_the_repository(void);
> extern void install_packed_git(struct repository *r, struct packed_git
> *pack);
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
*oi->disk_sizep = st.st_size;
> return 0;
> }
>
> - map = map_sha1_file(the_repository, sha1, &mapsize);
> + map = map_sha1_file(r, sha1, &mapsize);
> if (!map)
> return -1;
>
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
mp;objdirbuf);
> }
>
> -static void read_info_alternates_the_repository(const char *relative_base,
> - int depth)
> +static void read_info_alternates(struct repository *r,
> + const char *relative_base,
> + int depth)
> {
> char *path;
> struct strbuf buf = STRBUF_INIT;
> @@ -516,7 +512,7 @@ static void read_info_alternates_the_repository(const
> char *relative_base,
> return;
> }
>
> - link_alt_odb_entries(the_repository, buf.buf, '\n', relative_base,
> depth);
> + link_alt_odb_entries(r, buf.buf, '\n', relative_base, depth);
> strbuf_release(&buf);
> free(path);
> }
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
but where, how, when does
> > 'approximate_object_count_valid' ever get set to anything other than
> > 0? Even in the existing code (without this patch), there doesn't seem
> > to be anyplace which sets this to a non-zero value. Am I missing
> > something obvious (or subtle)?
>
> Probably related to this
> https://public-inbox.org/git/20180226085508.ga30...@sigill.intra.peff.net/#t
Yeah as far as doing a conversion this should be fine, we can come by
and clean it up at a later point.
--
Brandon Williams
; {
> approximate_object_count_valid = 0;
> - prepare_packed_git_run_once = 0;
> + the_repository->objects.packed_git_initialized = 0;
> prepare_packed_git();
> }
>
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
;do-not-close'");
> else
> diff --git a/packfile.h b/packfile.h
> index 76496226bb..5b1ce00f84 100644
> --- a/packfile.h
> +++ b/packfile.h
> @@ -66,7 +66,7 @@ extern void close_pack_index(struct packed_git *);
>
> extern unsigned char *use_pack(struct packed_git *, struct pack_window **,
> off_t, unsigned long *);
> extern void close_pack_windows(struct packed_git *);
> -extern void close_all_packs(void);
> +extern void close_all_packs(struct raw_object_store *o);
> extern void unuse_pack(struct pack_window **);
> extern void clear_delta_base_cache(void);
> extern struct packed_git *add_packed_git(const char *path, size_t path_len,
> int local);
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
gt; prepare_packed_git();
> - for (p = packed_git; p; p = p->next) {
> + for (p = the_repository->objects.packed_git; p; p = p->next) {
> if ((flags & FOR_EACH_OBJECT_LOCAL_ONLY) && !p->pack_local)
> continue;
> if ((flags & FOR_EACH_OBJECT_PROMISOR_ONLY) &&
> diff --git a/packfile.h b/packfile.h
> index a7fca598d6..76496226bb 100644
> --- a/packfile.h
> +++ b/packfile.h
> @@ -38,6 +38,9 @@ extern void prepare_packed_git(void);
> extern void reprepare_packed_git(void);
> extern void install_packed_git(struct packed_git *pack);
>
> +struct packed_git *get_packed_git(struct repository *r);
> +struct list_head *get_packed_git_mru(struct repository *r);
> +
> /*
> * Give a rough count of objects in the repository. This sacrifices accuracy
> * for speed.
> diff --git a/server-info.c b/server-info.c
> index 26a6c20b7d..6fe64ede17 100644
> --- a/server-info.c
> +++ b/server-info.c
> @@ -1,4 +1,5 @@
> #include "cache.h"
> +#include "repository.h"
> #include "refs.h"
> #include "object.h"
> #include "commit.h"
> @@ -200,7 +201,7 @@ static void init_pack_info(const char *infofile, int
> force)
> objdirlen = strlen(objdir);
>
> prepare_packed_git();
> - for (p = packed_git; p; p = p->next) {
> + for (p = get_packed_git(the_repository); p; p = p->next) {
> /* we ignore things on alternate path since they are
>* not available to the pullers in general.
>*/
> @@ -210,7 +211,7 @@ static void init_pack_info(const char *infofile, int
> force)
> }
> num_pack = i;
> info = xcalloc(num_pack, sizeof(struct pack_info *));
> - for (i = 0, p = packed_git; p; p = p->next) {
> + for (i = 0, p = get_packed_git(the_repository); p; p = p->next) {
> if (!p->pack_local)
> continue;
> info[i] = xcalloc(1, sizeof(struct pack_info));
> diff --git a/sha1_name.c b/sha1_name.c
> index 957ce25680..bd4d7352ce 100644
> --- a/sha1_name.c
> +++ b/sha1_name.c
> @@ -196,7 +196,8 @@ static void find_short_packed_object(struct
> disambiguate_state *ds)
> struct packed_git *p;
>
> prepare_packed_git();
> - for (p = packed_git; p && !ds->ambiguous; p = p->next)
> + for (p = get_packed_git(the_repository); p && !ds->ambiguous;
> + p = p->next)
> unique_in_pack(p, ds);
> }
>
> @@ -566,7 +567,7 @@ static void find_abbrev_len_packed(struct min_abbrev_data
> *mad)
> struct packed_git *p;
>
> prepare_packed_git();
> - for (p = packed_git; p; p = p->next)
> + for (p = get_packed_git(the_repository); p; p = p->next)
> find_abbrev_len_for_pack(p, mad);
> }
>
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
entry itself hasn't been freed (as noted above).
>
> Is leaking the entries themselves intentional?
>
> > void raw_object_store_clear(struct raw_object_store *o)
> > {
> > FREE_AND_NULL(o->objectdir);
> > FREE_AND_NULL(o->alternate_db);
> > +
> > + free_alt_odbs(o);
> > + o->alt_odb_tail = NULL;
> > }
>
> The commit message talks about freeing memory and resetting
> alt_odb_list and alt_odb_tail, but this code only resets alt_odb_tail.
--
Brandon Williams
ude "object-store.h"
> +
> struct config_set;
> struct index_state;
> struct submodule_cache;
> @@ -21,13 +23,9 @@ struct repository {
> char *commondir;
>
> /*
> - * Path to the repository's object store.
> - * Cannot be NULL after initialization.
> + * Holds any information related to accessing the raw object content.
>*/
> - char *objectdir;
> -
> - /* Path to extra alternate object database if not NULL */
> - char *alternate_db;
> + struct raw_object_store objects;
>
> /*
>* Path to the repository's graft file.
> diff --git a/sha1_file.c b/sha1_file.c
> index 4af422e3cf..792bb21c15 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -671,7 +671,8 @@ void prepare_alt_odb(void)
> return;
>
> alt_odb_tail = &alt_odb_list;
> - link_alt_odb_entries(the_repository->alternate_db, PATH_SEP, NULL, 0);
> + link_alt_odb_entries(the_repository->objects.alternate_db,
> + PATH_SEP, NULL, 0);
>
> read_info_alternates(get_object_directory(), 0);
> }
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
which doesn't go through
> - * the normal 'repo_init()' process.
> - */
> - unsigned ignore_env:1;
>
> /* Indicate if a repository has a different 'commondir' from 'gitdir' */
> unsigned different_commondir:1;
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
cb)
>
> void prepare_alt_odb(void)
> {
> - const char *alt;
> -
> if (alt_odb_tail)
> return;
>
> - alt = getenv(ALTERNATE_DB_ENVIRONMENT);
> -
> alt_odb_tail = &alt_odb_list;
> - link_alt_odb_entries(alt, PATH_SEP, NULL, 0);
> + link_alt_odb_entries(the_repository->alternate_db, PATH_SEP, NULL, 0);
>
> read_info_alternates(get_object_directory(), 0);
> }
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
16.1.435.g8f24da2e1a
>
This patch needs to be squashed into the previous one, the build breaks
otherwise (unless built with -Werror=unused-function).
--
Brandon Williams
wly) in
> the process of unifying the repo setup for the main repo and
> submodules, which hopefully may kill this function or replace it with
> something better. But it's too early to tell. Since this part of the
> series has landed in 'next', I'll post a fixup patch soon with your
> suggestion.
> --
> Duy
Yeah looking at the patch this is probably my only complaint. The rest
looked good.
--
Brandon Williams
t(struct repository *repo, const char *gitdir, const char
> *worktree);
I had to double check that this was ok, it indeed is as repo_init is
only used in repository.c.
> +extern void initialize_the_repository(void);
> extern int repo_submodule_init(struct repository *submodule,
> struct repository *superproject,
> const char *path);
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
In order to allow for code sharing with the server-side of fetch in
protocol-v2 convert upload-pack to be a builtin.
Signed-off-by: Brandon Williams
---
Makefile | 3 +-
builtin.h | 1 +
builtin/upload-pack.c | 67 ++
git.c
Factor out the logic for processing shallow, deepen, deepen_since, and
deepen_not lines into their own functions to simplify the
'receive_needs()' function in addition to making it easier to reuse some
of this logic when implementing protocol_v2.
Signed-off-by: Brandon Williams
-
Teach the client to be able to request a remote's refs using protocol
v2. This is done by having a client issue a 'ls-refs' request to a v2
server.
Signed-off-by: Brandon Williams
---
builtin/upload-pack.c | 10 +--
connect.c
fs it sends based on the sent prefixes. This list will be ignored
when not using protocol v2.
Signed-off-by: Brandon Williams
---
transport-helper.c | 5 +++--
transport-internal.h | 11 ++-
transport.c | 18 +++---
3 files changed, 24 insertions(+), 10 deleti
was removed the parameter
was no longer necessary but wasn't removed. Clean up 'recvline_fh()'
parameter list by removing the 'name' parameter.
Signed-off-by: Brandon Williams
---
transport-helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tra
When communicating with a v2 server, perform a fetch by requesting the
'fetch' command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 67 +-
builtin/fetch-pack.c| 2 +-
fetch-pack.c
ful in the next patch where we can have centralized
logic which determines if we need to request a different protocol
version than what the user has configured.
Signed-off-by: Brandon Williams
---
connect.c | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
di
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
Instead of always sending the Git-Protocol header with the configured
version with every http request, explicitly send it when discovering
refs and then only send it on subsequent http requests if the server
understood the version requested.
Signed-off-by: Brandon Williams
---
http.c
Add the 'packet_buf_write_len()' function which allows for writing an
arbitrary length buffer into a 'struct strbuf' and formatting it in
packet-line format.
Signed-off-by: Brandon Williams
---
pkt-line.c | 16
pkt-line.h | 1 +
2 files changed, 17 inserti
Add a way for callers to request that extra headers be included when
making http requests.
Signed-off-by: Brandon Williams
---
http.c | 8
http.h | 7 +++
2 files changed, 15 insertions(+)
diff --git a/http.c b/http.c
index 5977712712..e1757d62b2 100644
--- a/http.c
+++ b/http.c
When an http info/refs request is made, requesting that protocol v2 be
used, don't send a "# service" line since this line is not part of the
v2 spec.
Signed-off-by: Brandon Williams
---
http-backend.c | 8 ++--
remote-curl.c | 3 +++
2 files changed, 9 insertions(+), 2 del
as a pass through to convert requests to http.
Signed-off-by: Brandon Williams
---
remote-curl.c | 207 -
t/t5702-protocol-v2.sh | 45 +
2 files changed, 251 insertions(+), 1 deletion(-)
diff --git a/remote-curl.c b/remote-curl.c
index
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
y in our
http remote-helper (remote-curl) so that protocol v2 can be used using
the http transport.
Signed-off-by: Brandon Williams
---
Documentation/gitremote-helpers.txt | 32 +
transport-helper.c | 11 ++
transport.c
Make a copy of the service name being requested instead of relying on
the buffer pointed to by the passed in 'const char *' to remain
unchanged.
Currently, all service names are string constants, but a subsequent
patch will introduce service names from external sources.
Signed-off-b
Store the protocol version the server responded with when performing
discovery. This will be used in a future patch to either change the
'Git-Protocol' header sent in subsequent requests or to determine if a
client needs to fallback to using a different protocol version.
Signed-off-b
A future patch will need to take advantage of the logic which runs and
processes the response of the connect command on a remote helper so
factor out this logic from 'process_connect_service()' and place it into
a helper function 'run_connect()'.
Signed-off-by: Brandon Will
Construct a list of ref prefixes to be passed to 'get_refs_list()' from
the refspec to be used during the push. This list of ref prefixes will
be used to allow the server to filter the ref advertisement when
communicating using protocol v2.
Signed-off-by: Brandon Williams
---
transp
Construct a list of ref prefixes to be passed to
'transport_get_remote_refs()' from the refspec to be used during the
fetch. This list of ref prefixes will be used to allow the server to
filter the ref advertisement when communicating using protocol v2.
Signed-off-by: Brando
Construct an argv_array of ref prefixes based on the patterns supplied
via the command line and pass them to 'transport_get_remote_refs()' to
be used when communicating protocol v2 so that the server can limit the
ref advertisement based on those prefixes.
Signed-off-by: Brando
Introduce the 'fetch' server command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 125 +++
serve.c | 2 +
t/t5701-git-serve.sh| 1 +
upload-pack.c
t the completion of a command, a client can request that
another command be executed or can terminate the connection by sending a
flush packet.
Signed-off-by: Brandon Williams
---
.gitignore | 1 +
Documentation/Makefile | 1 +
Documentation/tech
based on provided ref-prefixes.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 31 +++
Makefile| 1 +
ls-refs.c | 96
ls-refs.h | 10
Teach transport_get_remote_refs() to accept a list of ref prefixes,
which will be sent to the server for use in filtering when using
protocol v2. (This list will be ignored when not using protocol v2.)
Signed-off-by: Brandon Williams
---
builtin/clone.c | 2 +-
builtin/fetch.c | 4
Enable shallow clones and deepen requests using protocol version 2 if
the server 'fetch' command supports the 'shallow' feature.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 18 ---
connect.c | 22
Introduce a packet-line test helper which can either pack or unpack an
input stream into packet-lines and writes out the result to stdout.
Signed-off-by: Brandon Williams
---
Makefile | 1 +
t/helper/test-pkt-line.c | 64
2 files changed
Introduce protocol_v2, a new value for 'enum protocol_version'.
Subsequent patches will fill in the implementation of protocol_v2.
Signed-off-by: Brandon Williams
---
builtin/fetch-pack.c | 2 ++
builtin/receive-pack.c | 6 ++
builtin/send-pack.c| 3 +++
builtin/upload-p
ned-off-by: Brandon Williams
---
transport.c | 35 ++-
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/transport.c b/transport.c
index 63c3dbab94..2378dcb38c 100644
--- a/transport.c
+++ b/transport.c
@@ -118,6 +118,7 @@ struct git_transport_data {
ned-off-by: Brandon Williams
---
builtin/fetch-pack.c | 16 +++-
builtin/send-pack.c | 17 +++--
connect.c| 27 ++-
connect.h| 3 +++
remote-curl.c| 20 ++--
remote.h | 5 +++--
transport.c
eserved to indicate the end of a response.
Documentation for how this packet will be used in protocol v2 will
included in a future patch.
Signed-off-by: Brandon Williams
---
pkt-line.c | 16
pkt-line.h | 3 +++
2 files changed, 19 insertions(+)
diff --git a/pkt-line.c b/pkt-li
st line
without consuming the first ref sent in the protocol_v0 case so that the
protocol version the server is speaking can be determined outside of
'get_remote_heads()' in a future patch.
Signed-off-by: Brandon Williams
---
connect.c | 173 ++-
enables a caller to be able to peek a single line at a time
using 'packet_reader_peek()' and having a caller consume a line by
calling 'packet_reader_read()'.
Signed-off-by: Brandon Williams
---
pkt-line.c | 50 +
Remove code duplication and use the existing 'get_refs_via_connect()'
function to retrieve a remote's heads in 'fetch_refs_via_pack()' and
'git_transport_push()'.
Signed-off-by: Brandon Williams
---
transport.c | 18 --
1 file changed, 4 i
_status'
type. This allows for easily identifying between special and normal
packets as well as errors. It also enables easily adding a new special
packet in the future.
Signed-off-by: Brandon Williams
---
pkt-line.c | 51 +--
pkt-line.h | 16
Fixed the protocol-v2.txt technical document so that it builds when
running "make doc".
Brandon Williams (35):
pkt-line: introduce packet_read_with_status
pkt-line: allow peeking a packet line without consuming it
pkt-line: add delim packet support
upload-pack: convert to
On 03/14, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > +/*
> > + * Read a packetized line into a buffer like the 'packet_read()' function
> > but
> > + * returns an 'enum packet_read_status' which indicates the status of the
On 03/14, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > Introduce git-serve, the base server for protocol version 2.
> > ...
> > Documentation/Makefile | 1 +
> > Documentation/technical/protocol-v2.txt | 174 +
>
&
Remove code duplication and use the existing 'get_refs_via_connect()'
function to retrieve a remote's heads in 'fetch_refs_via_pack()' and
'git_transport_push()'.
Signed-off-by: Brandon Williams
---
transport.c | 18 --
1 file changed, 4 i
Factor out the logic for processing shallow, deepen, deepen_since, and
deepen_not lines into their own functions to simplify the
'receive_needs()' function in addition to making it easier to reuse some
of this logic when implementing protocol_v2.
Signed-off-by: Brandon Williams
-
ned-off-by: Brandon Williams
---
builtin/fetch-pack.c | 16 +++-
builtin/send-pack.c | 17 +++--
connect.c| 27 ++-
connect.h| 3 +++
remote-curl.c| 20 ++--
remote.h | 5 +++--
transport.c
ned-off-by: Brandon Williams
---
transport.c | 35 ++-
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/transport.c b/transport.c
index 63c3dbab94..2378dcb38c 100644
--- a/transport.c
+++ b/transport.c
@@ -118,6 +118,7 @@ struct git_transport_data {
Teach transport_get_remote_refs() to accept a list of ref prefixes,
which will be sent to the server for use in filtering when using
protocol v2. (This list will be ignored when not using protocol v2.)
Signed-off-by: Brandon Williams
---
builtin/clone.c | 2 +-
builtin/fetch.c | 4
fs it sends based on the sent prefixes. This list will be ignored
when not using protocol v2.
Signed-off-by: Brandon Williams
---
transport-helper.c | 5 +++--
transport-internal.h | 11 ++-
transport.c | 18 +++---
3 files changed, 24 insertions(+), 10 deleti
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
Introduce the 'fetch' server command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 127 +++
serve.c | 2 +
t/t5701-git-serve.sh| 1 +
upload-pack.c
Store the protocol version the server responded with when performing
discovery. This will be used in a future patch to either change the
'Git-Protocol' header sent in subsequent requests or to determine if a
client needs to fallback to using a different protocol version.
Signed-off-b
was removed the parameter
was no longer necessary but wasn't removed. Clean up 'recvline_fh()'
parameter list by removing the 'name' parameter.
Signed-off-by: Brandon Williams
---
transport-helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tra
ful in the next patch where we can have centralized
logic which determines if we need to request a different protocol
version than what the user has configured.
Signed-off-by: Brandon Williams
---
connect.c | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
di
as a pass through to convert requests to http.
Signed-off-by: Brandon Williams
---
remote-curl.c | 207 -
t/t5702-protocol-v2.sh | 45 +
2 files changed, 251 insertions(+), 1 deletion(-)
diff --git a/remote-curl.c b/remote-curl.c
index
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
When an http info/refs request is made, requesting that protocol v2 be
used, don't send a "# service" line since this line is not part of the
v2 spec.
Signed-off-by: Brandon Williams
---
http-backend.c | 8 ++--
remote-curl.c | 3 +++
2 files changed, 9 insertions(+), 2 del
Instead of always sending the Git-Protocol header with the configured
version with every http request, explicitly send it when discovering
refs and then only send it on subsequent http requests if the server
understood the version requested.
Signed-off-by: Brandon Williams
---
http.c
Make a copy of the service name being requested instead of relying on
the buffer pointed to by the passed in 'const char *' to remain
unchanged.
Currently, all service names are string constants, but a subsequent
patch will introduce service names from external sources.
Signed-off-b
Add the 'packet_buf_write_len()' function which allows for writing an
arbitrary length buffer into a 'struct strbuf' and formatting it in
packet-line format.
Signed-off-by: Brandon Williams
---
pkt-line.c | 16
pkt-line.h | 1 +
2 files changed, 17 inserti
Add a way for callers to request that extra headers be included when
making http requests.
Signed-off-by: Brandon Williams
---
http.c | 8
http.h | 7 +++
2 files changed, 15 insertions(+)
diff --git a/http.c b/http.c
index 5977712712..e1757d62b2 100644
--- a/http.c
+++ b/http.c
y in our
http remote-helper (remote-curl) so that protocol v2 can be used using
the http transport.
Signed-off-by: Brandon Williams
---
Documentation/gitremote-helpers.txt | 32 +
transport-helper.c | 11 ++
transport.c
A future patch will need to take advantage of the logic which runs and
processes the response of the connect command on a remote helper so
factor out this logic from 'process_connect_service()' and place it into
a helper function 'run_connect()'.
Signed-off-by: Brandon Will
When communicating with a v2 server, perform a fetch by requesting the
'fetch' command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 68 +-
builtin/fetch-pack.c| 2 +-
fetch-pack.c
Enable shallow clones and deepen requests using protocol version 2 if
the server 'fetch' command supports the 'shallow' feature.
Signed-off-by: Brandon Williams
---
connect.c| 22
connect.h| 2 +
Construct a list of ref prefixes to be passed to 'get_refs_list()' from
the refspec to be used during the push. This list of ref prefixes will
be used to allow the server to filter the ref advertisement when
communicating using protocol v2.
Signed-off-by: Brandon Williams
---
transp
Construct an argv_array of ref prefixes based on the patterns supplied
via the command line and pass them to 'transport_get_remote_refs()' to
be used when communicating protocol v2 so that the server can limit the
ref advertisement based on those prefixes.
Signed-off-by: Brando
based on provided ref-prefixes.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 31 +++
Makefile| 1 +
ls-refs.c | 96
ls-refs.h | 10
Construct a list of ref prefixes to be passed to
'transport_get_remote_refs()' from the refspec to be used during the
fetch. This list of ref prefixes will be used to allow the server to
filter the ref advertisement when communicating using protocol v2.
Signed-off-by: Brando
t the completion of a command, a client can request that
another command be executed or can terminate the connection by sending a
flush packet.
Signed-off-by: Brandon Williams
---
.gitignore | 1 +
Documentation/Makefile | 1 +
Documentation/tech
Teach the client to be able to request a remote's refs using protocol
v2. This is done by having a client issue a 'ls-refs' request to a v2
server.
Signed-off-by: Brandon Williams
---
builtin/upload-pack.c | 10 +--
connect.c
Introduce a packet-line test helper which can either pack or unpack an
input stream into packet-lines and writes out the result to stdout.
Signed-off-by: Brandon Williams
---
Makefile | 1 +
t/helper/test-pkt-line.c | 64
2 files changed
Introduce protocol_v2, a new value for 'enum protocol_version'.
Subsequent patches will fill in the implementation of protocol_v2.
Signed-off-by: Brandon Williams
---
builtin/fetch-pack.c | 2 ++
builtin/receive-pack.c | 6 ++
builtin/send-pack.c| 3 +++
builtin/upload-p
In order to allow for code sharing with the server-side of fetch in
protocol-v2 convert upload-pack to be a builtin.
Signed-off-by: Brandon Williams
---
Makefile | 3 +-
builtin.h | 1 +
builtin/upload-pack.c | 67 ++
git.c
st line
without consuming the first ref sent in the protocol_v0 case so that the
protocol version the server is speaking can be determined outside of
'get_remote_heads()' in a future patch.
Signed-off-by: Brandon Williams
---
connect.c | 173 ++-
enables a caller to be able to peek a single line at a time
using 'packet_reader_peek()' and having a caller consume a line by
calling 'packet_reader_read()'.
Signed-off-by: Brandon Williams
---
pkt-line.c | 50 +
_status'
type. This allows for easily identifying between special and normal
packets as well as errors. It also enables easily adding a new special
packet in the future.
Signed-off-by: Brandon Williams
---
pkt-line.c | 51 +--
pkt-line.h | 16
eserved to indicate the end of a response.
Documentation for how this packet will be used in protocol v2 will
included in a future patch.
Signed-off-by: Brandon Williams
---
pkt-line.c | 16
pkt-line.h | 3 +++
2 files changed, 19 insertions(+)
diff --git a/pkt-line.c b/pkt-li
1-bmw...@google.com/
Brandon Williams (35):
pkt-line: introduce packet_read_with_status
pkt-line: allow peeking a packet line without consuming it
pkt-line: add delim packet support
upload-pack: convert to a builtin
upload-pack: factor out processing lines
transport: use get_refs_via_conne
On 03/13, Jonathan Tan wrote:
> On Wed, 28 Feb 2018 15:22:44 -0800
> Brandon Williams wrote:
>
> > +'stateless-connect'::
> > + Experimental; for internal use only.
> > + Can attempt to connect to a remote server for communication
> > +
On 03/13, Jonathan Tan wrote:
> On Wed, 28 Feb 2018 15:22:37 -0800
> Brandon Williams wrote:
>
> > +output = *section
> > +section = (acknowledgments | packfile)
> > + (flush-pkt | delim-pkt)
> > +
> > +acknowle
On 03/02, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > + Capabilities
> > +~~
> > +
> > +There are two different types of capabilities: normal capabilities,
> > +which can be used to to convey information or alter the behavior of a
>
On 03/02, Junio C Hamano wrote:
> Brandon Williams writes:
> > +static int is_command(const char *key, struct protocol_capability
> > **command)
> > +{
> > + const char *out;
> > +
> > + if (skip_prefix(key, "command=", &ou
On 03/02, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > + ls-refs
> > +-
> > +
> > +`ls-refs` is the command used to request a reference advertisement in v2.
> > +Unlike the current reference advertisement, ls-refs takes in arguments
> >
On 03/05, Jeff King wrote:
> On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote:
>
> > > Hmm, so this would accept stuff like "refs/heads/*/foo" but quietly
> > > ignore the "/foo" part.
> >
> > Yeah that's true...t
On 03/13, Jonathan Tan wrote:
> On Wed, 28 Feb 2018 15:22:18 -0800
> Brandon Williams wrote:
>
> > + if (len < 0) {
> > die("protocol error: bad line length character: %.4s", linelen);
> > - if (!len) {
> > + } else if (!le
On 03/13, Jonathan Tan wrote:
> On Wed, 28 Feb 2018 15:22:21 -0800
> Brandon Williams wrote:
>
> > In order to allow for code sharing with the server-side of fetch in
> > protocol-v2 convert upload-pack to be a builtin.
> >
> > Signed-off-by: Brandon Willia
supporting it).
>
> I do agree we should have _something_ that is easy to spin up. But it
> would be wonderful if git-over-http could become that, and we could just
> deprecate git://. I suppose it's possible people build clients without
> curl, but I suspect that's an extreme minority these days (most third
> party hosters don't seem to offer git:// at all).
>
> -Peff
--
Brandon Williams
301 - 400 of 2393 matches
Mail list logo