Re: [PATCH 08/27] pack: move approximate object count to object store

2018-02-21 Thread Brandon Williams
_count = count; > } > - return count; > + return the_repository->objects.approximate_object_count; > } > > static void *get_next_packed_git(const void *p) > @@ -901,7 +900,7 @@ void prepare_packed_git(void) > > void reprepare_packed_git(void) > { > - approximate_object_count_valid = 0; > + the_repository->objects.approximate_object_count_valid = 0; > the_repository->objects.packed_git_initialized = 0; > prepare_packed_git(); > } > -- > 2.16.1.291.g4437f3f132-goog > -- Brandon Williams

Re: [PATCH 06/27] object-store: close all packs upon clearing the object store

2018-02-21 Thread Brandon Williams
ca598d6..6a2c57045c 100644 > --- a/packfile.h > +++ b/packfile.h > @@ -63,7 +63,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.291.g4437f3f132-goog > -- Brandon Williams

Re: [PATCH 04/27] object-store: free alt_odb_list

2018-02-21 Thread Brandon Williams
_odb_list); > + o->alt_odb_list = o->alt_odb_list->next; > + } > +} > + > void raw_object_store_clear(struct raw_object_store *o) > { > free(o->objectdir); > + > + free_alt_odbs(o); > + o->alt_odb_tail = NULL; > } > -- > 2.16.1.291.g4437f3f132-goog > -- Brandon Williams

Re: [PATCH 03/27] object-store: move alt_odb_list and alt_odb_tail to object store

2018-02-21 Thread Brandon Williams
for (alt = alt_odb_list; alt; alt = alt->next) > + for (alt = the_repository->objects.alt_odb_list; > + alt; alt = alt->next) Indentation on this line looks odd. -- Brandon Williams

Re: [PATCH 02/27] object-store: migrate alternates struct and functions from cache.h

2018-02-21 Thread Brandon Williams
ause cache.h includes > repository.h which in turn includes the object-store.h Nice. Always love seeing cache.h get smaller -- Brandon Williams

Re: [PATCH v3 00/35] protocol version 2

2018-02-21 Thread Brandon Williams
On 02/06, Brandon Williams wrote: > Changes in v3: > * There were some comments about how the protocol should be designed >stateless first. I've made this change and instead of having to >supply the `stateless-rpc=true` capability to force stateless >behavio

[PATCH] submodule: indicate that 'submodule.recurse' doesn't apply to clone

2018-02-20 Thread Brandon Williams
Update the documentation for the 'submodule.recurse' config to identify that the clone command does not respect it. Signed-off-by: Brandon Williams --- Documentation/config.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Doc

Re: [PATCH 2/2] remote-curl: unquote incoming push-options

2018-02-20 Thread Brandon Williams
pd > > @@ -260,6 +269,15 @@ test_expect_success 'push options work properly across > http' ' > test_cmp expect actual > ' > > +test_expect_success 'push options keep quoted characters intact (http)' ' > + mk_http_pair true && > + > + test_commit -C test_http_clone one && > + git -C test_http_clone push --push-option="\"embedded quotes\"" origin > master && > + echo "\"embedded quotes\"" >expect && > + test_cmp expect > "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options > +' > + > stop_httpd > > test_done > -- > 2.16.2.552.gea2a3cf654 -- Brandon Williams

Re: [PATCHv2 00/16] Moving global state into the repository object (part 1)

2018-02-20 Thread Brandon Williams
asier to write the patches (which most of them are already written) and to review because you can use the #define trick to make some sort of guarantees. After we have successfully completed the migration to f(repo), then we can revisit the subsystems which want to have a clearer abstraction layer and make the jump to f(repo->object_store). -- Brandon Williams

Re: [PATCH 0/3] a few grep patches

2018-02-15 Thread Brandon Williams
() per file > > builtin/grep.c | 25 - > grep.c | 8 ++-- > 2 files changed, 18 insertions(+), 15 deletions(-) > > -- > 2.15.1 > -- Brandon Williams

Re: [PATCH v2 06/37] diff: rename 'this' variables

2018-02-14 Thread Brandon Williams
On 02/14, Junio C Hamano wrote: > Brandon Williams writes: > > > Rename C++ keyword in order to bring the codebase closer to being able > > to be compiled with a C++ compiler. > > > > Signed-off-by: Brandon Williams > > --- > > The patch is not a

[PATCH v2 35/37] tempfile: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- tempfile.c | 12 ++-- tempfile.h | 34 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a

[PATCH v2 13/37] remote: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/remote.c | 66 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/builtin/remote.c

[PATCH v2 08/37] apply: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- apply.c | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/apply.c b/apply.c

[PATCH v2 14/37] combine-diff: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- combine-diff.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index bc08c4c5b

[PATCH v2 37/37] replace: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/replace.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/replace.c b/builtin

[PATCH v2 07/37] apply: rename 'try' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- apply.c | 68 - 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/apply.c b

[PATCH v2 36/37] trailer: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- trailer.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trailer.c b/trailer.c index 5a4a2ecf9..c508c9b75 100644 --- a

[PATCH v2 17/37] diff: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- diff.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/diff.c b/diff.c index

[PATCH v2 32/37] diff: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- diff.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/diff.c b/diff.c index 2de9c5ed2..5e46502cd 100644 --- a/diff.c

[PATCH v2 31/37] environment: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- cache.h | 2 +- environment.c | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index

[PATCH v2 16/37] diff-lib: rename 'new' variable

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- diff-lib.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/diff-lib.c b/diff-lib.c index

[PATCH v2 30/37] init-db: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/init-db.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/builtin/init-db.c b/builtin/init

[PATCH v2 33/37] environment: rename 'namespace' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- environment.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/environment.c b/environment.c index 98f77ea95..270ba98b5

[PATCH v2 34/37] wrapper: rename 'template' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- git-compat-util.h | 4 ++-- wrapper.c | 40 2 files changed, 22 insertions(+), 22 deletions(-) diff

[PATCH v2 29/37] unpack-trees: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- unpack-trees.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unpack-trees.c b/unpack-trees.c index 96c3327f1..bdedabcd5

[PATCH v2 27/37] submodule: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- submodule.c | 30 +++--- submodule.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/submodule.c b

[PATCH v2 18/37] diffcore-delta: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- diffcore-delta.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/diffcore-delta.c b/diffcore-delta.c index

[PATCH v2 19/37] entry: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- entry.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/entry.c b/entry.c index 30211447a

[PATCH v2 26/37] split-index: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- split-index.c | 16 split-index.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/split-index.c b/split-index.c

[PATCH v2 28/37] trailer: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- trailer.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/trailer.c b/trailer.c index 3ba157ed0

[PATCH v2 25/37] remote: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- remote.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/remote.c b/remote.c index 4e93753e1..2922dca07

[PATCH v2 24/37] ref-filter: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- ref-filter.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 9dae6cfe3..99a45beb1

[PATCH v2 21/37] imap-send: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- imap-send.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/imap-send.c b/imap-send.c index 36c7c1b4f..ffb0a6eca

[PATCH v2 22/37] line-log: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- line-log.c | 56 +++--- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/line-log.c b

[PATCH v2 23/37] read-cache: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- read-cache.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/read-cache.c b/read-cache.c

[PATCH v2 20/37] http: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- http.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/http.c b/http.c index 597771271..41cfa41a9 100644 --- a/http.c

[PATCH v2 06/37] diff: rename 'this' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- diff.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diff.c b/diff.c index 0a9a0cdf1..d682d0d1f 100644 --- a/diff.c +++ b

[PATCH v2 09/37] checkout: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/checkout.c | 196 ++--- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/builtin

[PATCH v2 15/37] commit: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- commit.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/commit.c b/commit.c index cd9ace105..874b6e510 100644

[PATCH v2 10/37] help: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/help.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/help.c b/builtin/help.c index d3c8fc408..598867cfe

[PATCH v2 11/37] pack-redundant: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/pack-redundant.c | 54 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/builtin/pack

[PATCH v2 12/37] reflog: rename 'new' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/reflog.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index 223372531

[PATCH v2 03/37] blame: rename 'this' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- blame.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/blame.c b/blame.c index 2893f3c10

[PATCH v2 05/37] rev-parse: rename 'this' variable

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/rev-parse.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/rev-parse.c b

[PATCH v2 02/37] object: rename function 'typename' to 'type_name'

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/cat-file.c | 2 +- builtin/diff-tree.c| 2 +- builtin/fast-export.c | 8

[PATCH v2 04/37] pack-objects: rename 'this' variables

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/pack-objects.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index

[PATCH v2 01/37] object_info: change member name from 'typename' to 'type_name'

2018-02-14 Thread Brandon Williams
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams --- builtin/cat-file.c | 2 +- cache.h| 2 +- packfile.c | 6 +++--- sha1_file.c| 10 +- 4 files changed, 10

[PATCH v2 00/37] removal of some c++ keywords

2018-02-14 Thread Brandon Williams
One person was interested enough for me to go back through and also rename all the paired 'old' variables to match the new names for the variables which were named 'new'. Brandon Williams (37): object_info: change member name from 'typename' to 'type_name&#

Re: What's cooking in git.git (Feb 2018, #02; Tue, 13)

2018-02-14 Thread Brandon Williams
efraining from using these keywords in a foreign > language in our codebase too much, but at the same time, renaming > must be done a bit more thoughtfully. When the original uses 'new' > together with and in contrast to 'old', renaming 'new' must be done > while preserving the pairing (which may involve renaming 'old' as > well), for example. > > Backburnered, i.e. will drop if other topics start to conflict with > it, but will accept rerolls. I was under the impression that people didn't care too much about this (which is a shame but that's an opinion :). If people were more interested in a change like this then I'd be happy to go back through and rename the 'old' variables too. -- Brandon Williams

Re: [PATCH 14/26] sha1_file: allow prepare_alt_odb to handle arbitrary repositories

2018-02-14 Thread Brandon Williams
b_tail = > > - &the_repository->objects.alt_odb_list; > > - link_alt_odb_entries(the_repository, alt, > > -PATH_SEP, NULL, 0); > > + link_alt_odb_entries(r, alt, PATH_SEP, NULL, 0); > > + } > > > > - read_info_alternates(the_repository, get_object_directory(), 0); > > + read_info_alternates(r, r->objects.objectdir, 0); > > } > > > > /* Returns 1 if we have successfully freshened the file, 0 otherwise. */ > > -- > > 2.16.1.73.ga2c3e9663f.dirty > > > > > > -- > Duy -- Brandon Williams

Re: [PATCH 00/26] Moving global state into the repository object (part 1)

2018-02-13 Thread Brandon Williams
+- > sha1_file.c | 135 > +++++--- > sha1_name.c | 11 +- > streaming.c | 5 +- > 36 files changed, 321 insertions(+), 182 deletions(-) > create mode 100644 contrib/coccinelle/refactoring/packed_git.cocci > create mode 100644 object-store.h > > -- > 2.16.1.73.ga2c3e9663f.dirty > -- Brandon Williams

Re: [PATCH 02/26] object-store: move alt_odb_list and alt_odb_tail to object store

2018-02-13 Thread Brandon Williams
pen_sha1_file(const unsigned char *sha1, > const char **path) > most_interesting_errno = errno; > > prepare_alt_odb(); > - for (alt = alt_odb_list; alt; alt = alt->next) { > + for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next) { > *path = alt_sha1_path(alt, sha1); > fd = git_open(*path); > if (fd >= 0) > diff --git a/sha1_name.c b/sha1_name.c > index 611c7d24dd..957ce25680 100644 > --- a/sha1_name.c > +++ b/sha1_name.c > @@ -10,6 +10,7 @@ > #include "dir.h" > #include "sha1-array.h" > #include "packfile.h" > +#include "repository.h" > > static int get_oid_oneline(const char *, struct object_id *, struct > commit_list *); > > @@ -104,7 +105,7 @@ static void find_short_object_filename(struct > disambiguate_state *ds) >*/ > fakeent = alloc_alt_odb(get_object_directory()); > } > - fakeent->next = alt_odb_list; > + fakeent->next = the_repository->objects.alt_odb_list; > > for (alt = fakeent; alt && !ds->ambiguous; alt = alt->next) { > int pos; > -- > 2.16.1.73.ga2c3e9663f.dirty > -- Brandon Williams

Re: [PATCH v3 22/35] upload-pack: support shallow requests

2018-02-13 Thread Brandon Williams
On 02/07, Stefan Beller wrote: > On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote: > > Add the 'shallow' feature to the protocol version 2 command 'fetch' > > which indicates that the server supports shallow clients and deepen > > requets

Re: [PATCH 00/26] Moving global state into the repository object (part 1)

2018-02-13 Thread Brandon Williams
e and ignore_env should > be gone. So sticking it inside raw_object_store _temporarily_ does not > sound so bad. I like this approach, I mean at the moment we are replicating a single bit of data but that allows us to be able to limit the scope of where a repository struct is passed, giving us a better abstraction layer. > -- > Duy -- Brandon Williams

Re: Fetch-hooks

2018-02-12 Thread Brandon Williams
l re-point my-branch to instead of > refs/real-remotes/my-remote/heads/my-branch. In order to avoid any > issue, the hook is not allowed to pass as second output a reference that > was not passed as second input. > > This way, the behavior of the tweak-fetch hook is reasonably preserv

[PATCH v3 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-02-06 Thread Brandon Williams
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 | 174 ++-

[PATCH v3 20/35] upload-pack: introduce fetch server command

2018-02-06 Thread Brandon Williams
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

[PATCH v3 15/35] transport: convert get_refs_list to take a list of ref patterns

2018-02-06 Thread Brandon Williams
fs it sends based on the sent patterns. Signed-off-by: Brandon Williams --- transport-helper.c | 5 +++-- transport-internal.h | 4 +++- transport.c | 16 +--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index

[PATCH v3 23/35] fetch-pack: support shallow requests

2018-02-06 Thread Brandon Williams
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 +

[PATCH v3 24/35] connect: refactor git_connect to only get the protocol version once

2018-02-06 Thread Brandon Williams
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

[PATCH v3 16/35] transport: convert transport_get_remote_refs to take a list of ref patterns

2018-02-06 Thread Brandon Williams
Convert 'transport_get_remote_refs()' to optionally take a list of ref patterns. Signed-off-by: Brandon Williams --- builtin/clone.c | 2 +- builtin/fetch.c | 4 ++-- builtin/ls-remote.c | 2 +- builtin/remote.c| 2 +- transport.c | 7 +-- transport.h

[PATCH v3 19/35] push: pass ref patterns when pushing

2018-02-06 Thread Brandon Williams
Construct a list of ref patterns to be passed to 'get_refs_list()' from the refspec to be used during the push. This list of ref patterns will be used to allow the server to filter the ref advertisement when communicating using protocol v2. Signed-off-by: Brandon Williams --- transp

[PATCH v3 27/35] transport-helper: refactor process_connect_service

2018-02-06 Thread Brandon Williams
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

[PATCH v3 14/35] connect: request remote refs using v2

2018-02-06 Thread 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

[PATCH v3 30/35] remote-curl: create copy of the service name

2018-02-06 Thread Brandon Williams
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. Signed-off-by: Brandon Williams --- remote-curl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remote-curl.

[PATCH v3 29/35] pkt-line: add packet_buf_write_len function

2018-02-06 Thread Brandon Williams
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

[PATCH v3 32/35] http: allow providing extra headers for http requests

2018-02-06 Thread Brandon Williams
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 | 2 ++ 2 files changed, 10 insertions(+) diff --git a/http.c b/http.c index 597771271..e1757d62b 100644 --- a/http.c +++ b/http.c

[PATCH v3 35/35] remote-curl: don't request v2 when pushing

2018-02-06 Thread Brandon Williams
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

[PATCH v3 31/35] remote-curl: store the protocol version the server responded with

2018-02-06 Thread Brandon Williams
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

[PATCH v3 22/35] upload-pack: support shallow requests

2018-02-06 Thread Brandon Williams
Add the 'shallow' feature to the protocol version 2 command 'fetch' which indicates that the server supports shallow clients and deepen requets. Signed-off-by: Brandon Williams --- Documentation/technical/protocol-v2.txt | 67 +++- serve.c

[PATCH v3 34/35] remote-curl: implement stateless-connect command

2018-02-06 Thread Brandon Williams
as a pass through to convert requests to http. Signed-off-by: Brandon Williams --- remote-curl.c | 187 - t/t5702-protocol-v2.sh | 41 +++ 2 files changed, 227 insertions(+), 1 deletion(-) diff --git a/remote-curl.c b/remote-cu

[PATCH v3 25/35] connect: don't request v2 when pushing

2018-02-06 Thread Brandon Williams
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

[PATCH v3 28/35] transport-helper: introduce stateless-connect

2018-02-06 Thread Brandon Williams
ort. If a stateless connection cannot be established then the remote-helper will respond in the same manner as the 'connect' command indicating that the client should fallback to using the dumb remote-helper commands. Signed-off-by: Brandon Williams --- transport-helper.c | 8 ++

[PATCH v3 21/35] fetch-pack: perform a fetch using v2

2018-02-06 Thread Brandon Williams
When communicating with a v2 server, perform a fetch by requesting the 'fetch' command. Signed-off-by: Brandon Williams --- builtin/fetch-pack.c | 2 +- fetch-pack.c | 252 - fetch-pack.h | 4 +- t/t5702-prot

[PATCH v3 33/35] http: don't always add Git-Protocol header

2018-02-06 Thread Brandon Williams
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

[PATCH v3 26/35] transport-helper: remove name parameter

2018-02-06 Thread Brandon Williams
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/t

[PATCH v3 08/35] connect: discover protocol version outside of get_remote_heads

2018-02-06 Thread 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

[PATCH v3 05/35] upload-pack: factor out processing lines

2018-02-06 Thread Brandon Williams
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 -

[PATCH v3 18/35] fetch: pass ref patterns when fetching

2018-02-06 Thread Brandon Williams
Construct a list of ref patterns to be passed to 'transport_get_remote_refs()' from the refspec to be used during the fetch. This list of ref patterns will be used to allow the server to filter the ref advertisement when communicating using protocol v2. Signed-off-by: Brando

[PATCH v3 03/35] pkt-line: add delim packet support

2018-02-06 Thread Brandon Williams
eserved to indicate the end of a response. Signed-off-by: Brandon Williams --- pkt-line.c | 17 + pkt-line.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/pkt-line.c b/pkt-line.c index 4fc9ad4b0..726e109ca 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -91,6 +91,12 @@ void pa

[PATCH v3 09/35] transport: store protocol version

2018-02-06 Thread Brandon Williams
ned-off-by: Brandon Williams --- transport.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/transport.c b/transport.c index 63c3dbab9..2378dcb38 100644 --- a/transport.c +++ b/transport.c @@ -118,6 +118,7 @@ struct git_transport_data {

[PATCH v3 11/35] test-pkt-line: introduce a packet-line test helper

2018-02-06 Thread Brandon Williams
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

[PATCH v3 13/35] ls-refs: introduce ls-refs server command

2018-02-06 Thread Brandon Williams
based on provided ref-patterns. Signed-off-by: Brandon Williams --- Documentation/technical/protocol-v2.txt | 32 + Makefile| 1 + ls-refs.c | 96 ++ ls-refs.h | 9

[PATCH v3 10/35] protocol: introduce enum protocol_version value protocol_v2

2018-02-06 Thread Brandon Williams
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 | 3 +++ builtin/receive-pack.c | 6 ++ builtin/send-pack.c| 3 +++ builtin/upload-p

[PATCH v3 06/35] transport: use get_refs_via_connect to get refs

2018-02-06 Thread Brandon Williams
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

[PATCH v3 17/35] ls-remote: pass ref patterns when requesting a remote's refs

2018-02-06 Thread Brandon Williams
Construct an argv_array of the ref 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 the supplied patterns. Signed-off-by: Brandon Williams ---

[PATCH v3 12/35] serve: introduce git-serve

2018-02-06 Thread Brandon Williams
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/technical/protocol-v2.txt | 114 +++ Mak

[PATCH v3 02/35] pkt-line: introduce struct packet_reader

2018-02-06 Thread Brandon Williams
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 | 59 ++

[PATCH v3 01/35] pkt-line: introduce packet_read_with_status

2018-02-06 Thread Brandon Williams
_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 | 57 +++-- pkt-line

[PATCH v3 04/35] upload-pack: convert to a builtin

2018-02-06 Thread 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

[PATCH v3 00/35] protocol version 2

2018-02-06 Thread Brandon Williams
is in a pretty good state, baring any more critical reviewing feedback. Thanks! Brandon Williams (35): pkt-line: introduce packet_read_with_status pkt-line: introduce struct packet_reader pkt-line: add delim packet support upload-pack: convert to a builtin upload-pack: factor out processi

Re: [PATCH v2 00/27] protocol version 2

2018-02-06 Thread Brandon Williams
t I could do. > > On 1/25/2018 6:58 PM, Brandon Williams wrote: > > Changes in v2: > > * Added documentation for fetch > > * changes #defines for state variables to be enums > > * couple code changes to pkt-line functions and documentation > > * Added unit

Re: [PATCH 12/26] ls-refs: introduce ls-refs server command

2018-02-06 Thread Brandon Williams
On 02/01, Jeff Hostetler wrote: > > > On 1/2/2018 7:18 PM, Brandon Williams wrote: > > Introduce the ls-refs server command. In protocol v2, the ls-refs > > command is used to request the ref advertisement from the server. Since > > it is a command which can

Re: [PATCH v1] dir.c: don't flag the index as dirty for changes to the untracked cache

2018-02-05 Thread Brandon Williams
<20160803174522.5571-1-pclo...@gmail.com> if you want to know > # more. > > +GIT_TEST_UNTRACKED_CACHE=true > +export GIT_TEST_UNTRACKED_CACHE > + > sync_mtime () { > find . -type d -ls >/dev/null > } > > base-commit: 5be1f00a9a701532232f57958efab4be8c959a29 > -- > 2.15.0.windows.1 > -- Brandon Williams

Re: [PATCH v2 10/27] protocol: introduce enum protocol_version value protocol_v2

2018-02-02 Thread Brandon Williams
On 01/31, Derrick Stolee wrote: > On 1/25/2018 6:58 PM, Brandon Williams wrote: > > Introduce protocol_v2, a new value for 'enum protocol_version'. > > Subsequent patches will fill in the implementation of protocol_v2. > > > > Signed-off-by: Brandon William

Re: [PATCH v2 13/27] ls-refs: introduce ls-refs server command

2018-02-02 Thread Brandon Williams
On 01/26, Stefan Beller wrote: > On Thu, Jan 25, 2018 at 3:58 PM, Brandon Williams wrote: > > > +ls-refs takes in the following parameters wrapped in packet-lines: > > + > > +symrefs > > + In addition to the object pointed by it, show the underlying ref

Re: [PATCH 11/26] serve: introduce git-serve

2018-02-01 Thread &#x27;Brandon Williams'
On 02/01, Randall S. Becker wrote: > On February 1, 2018 1:58 PM, Stefan Beller wrote: > > On Thu, Feb 1, 2018 at 10:48 AM, Jeff Hostetler > > wrote: > > > > > > > > > On 1/2/2018 7:18 PM, Brandon Williams wrote: > > >> > > &g

Re: [PATCH 11/26] serve: introduce git-serve

2018-02-01 Thread Brandon Williams
On 02/01, Jeff Hostetler wrote: > > > On 2/1/2018 1:57 PM, Stefan Beller wrote: > > On Thu, Feb 1, 2018 at 10:48 AM, Jeff Hostetler > > wrote: > > > > > > > > > On 1/2/2018 7:18 PM, Brandon Williams wrote: > > > > > &g

Re: [PATCH v2 08/27] connect: discover protocol version outside of get_remote_heads

2018-02-01 Thread Brandon Williams
On 01/31, Derrick Stolee wrote: > On 1/25/2018 6:58 PM, Brandon Williams wrote: > > In order to prepare for the addition of protocol_v2 push the protocol > > version discovery outside of 'get_remote_heads()'. This will allow for > > keeping the logic for processing

<    1   2   3   4   5   6   7   8   9   10   >