[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 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 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 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

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

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: [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 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

[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 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

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 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 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 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 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 14/27] sha1_file: allow link_alt_odb_entries to handle arbitrary repositories

2018-02-21 Thread Brandon Williams
ive_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.291.g4437f3f132-goog > -- Brandon Williams

Re: [PATCH 16/27] sha1_file: add repository argument to sha1_file_name

2018-02-21 Thread Brandon Williams
le.h or something like that at some point as that seems like a better place for the function than in the object-store.h file? -- Brandon Williams

Re: What's cooking in git.git (Feb 2018, #03; Wed, 21)

2018-02-21 Thread Brandon Williams
o 'type_name' > > Avoid using identifiers that clash with C++ keywords. Even though > it is not a goal to compile Git with C++ compilers, changes like > this help use of code analysis tools that targets C++ on our > codebase. > > Is the 'fixup!' cleanly squashable to the problematic one, or does > this series require another reroll to get it in a good enough shape? Yeah the fixup patch looks good to me. I don't think there was anything else that needed attention so it should be in good shape with the fixup patch. -- Brandon Williams

Re: bug in HTTP protocol spec

2018-02-22 Thread Brandon Williams
hrough the code and couldn’t determine it one way or > another, but my money is on that looking something like `000aversion 1\n` on > the wire. Yes the version string goes along with the ref_list in v1 like so: # service= version 1 ref_list This is because it is part of the payload which is actually delivered to the git fetch/push binary where as the "# service" bit is used by the remote helper to identify smart vs not smart servers. > > -- > Dorian Taylor > Make things. Make sense. > https://doriantaylor.com > -- Brandon Williams

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

2018-02-22 Thread Brandon Williams
On 02/22, Jeff King wrote: > On Wed, Feb 21, 2018 at 01:44:22PM -0800, Jonathan Tan wrote: > > > On Tue, 6 Feb 2018 17:12:41 -0800 > > Brandon Williams wrote: > > > > > In order to allow for code sharing with the server-side of fetch in > > > proto

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:45 -0800 > Brandon Williams wrote: > > > - get_remote_heads(fd[0], NULL, 0, &ref, 0, NULL, &shallow); > > + > > + packet_reader_init(&reader, fd[0], NULL, 0, > > +

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:51 -0800 > Brandon Williams wrote: > > > +extern struct ref **get_remote_refs(int fd_out, struct packet_reader > > *reader, > > + struct ref **list, int for_push, > > +

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:52 -0800 > Brandon Williams wrote: > > > @@ -21,7 +22,8 @@ struct transport_vtable { > > * the ref without a huge amount of effort, it should store it > > * in the ref's old_sha1 fie

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:53 -0800 > Brandon Williams wrote: > > > -const struct ref *transport_get_remote_refs(struct transport *transport) > > +const struct ref *transport_get_remote_refs(struct

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:13:05 -0800 > Brandon Williams wrote: > > > Introduce the transport-helper capability 'stateless-connect'. This > > capability indicates that the transport-helper can be requested to run > > the &#x

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:57 -0800 > Brandon Williams wrote: > > > +want > > + Indicates to the server an object which the client wants to > > + retrieve. > > Mention that the client can "want" anything e

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:13:07 -0800 > Brandon Williams wrote: > > > 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. >

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:13:09 -0800 > Brandon Williams wrote: > > > @@ -172,6 +172,8 @@ struct http_get_options { > > * for details. > > */ > > struct strbuf *base_url; > > + > > + struct string_list *e

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

2018-02-22 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:13:12 -0800 > Brandon Williams wrote: > > > +test_expect_success 'push with http:// and a config of v2 does not request > > v2' ' > > + # Till v2 for push is designed, make sure that if a client

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

2018-02-22 Thread Brandon Williams
On 02/22, Brandon Williams wrote: > On 02/21, Jonathan Tan wrote: > > On Tue, 6 Feb 2018 17:13:12 -0800 > > Brandon Williams wrote: > > > > > +test_expect_success 'push with http:// and a config of v2 does not > > > request v2' ' >

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

2018-02-22 Thread Brandon Williams
On 02/22, Stefan Beller wrote: > On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote: > > One of the design goals of protocol-v2 is to improve the semantics of > > flush packets. Currently in protocol-v1, flush packets are used both to > > indicate a break in a list of pa

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

2018-02-22 Thread Brandon Williams
On 02/22, Stefan Beller wrote: > On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote: > > 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 additi

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

2018-02-22 Thread Brandon Williams
On 02/22, Jonathan Tan wrote: > On Thu, 22 Feb 2018 10:26:47 -0800 > Brandon Williams wrote: > > > On 02/21, Jonathan Tan wrote: > > > On Tue, 6 Feb 2018 17:12:53 -0800 > > > Brandon Williams wrote: > > > > > > > -const

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

2018-02-22 Thread Brandon Williams
On 02/22, Jeff King wrote: > On Tue, Feb 06, 2018 at 05:12:50PM -0800, 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

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

2018-02-23 Thread Brandon Williams
On 02/23, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:13:00 -0800 > Brandon Williams wrote: > > > @@ -1090,6 +1110,10 @@ static int send_fetch_request(int fd_out, const > > struct fetch_pack_args *args, > > if (prefer_ofs_delta) > > pack

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

2018-02-23 Thread Brandon Williams
em builtins, because it doesn't make much sense for v2 to straddle that line. I mean you could do some complicated advertising of commands based on the endpoint you hit, but then what does that mean if you're hitting the git-serve endpoint where you should presumably be able to do any operation. -- Brandon Williams

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

2018-02-23 Thread Brandon Williams
On 02/22, Stefan Beller wrote: > On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote: > > > +static void pack_line(const char *line) > > +{ > > + if (!strcmp(line, "") || !strcmp(line, "\n")) > > From our in-office discussion:

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

2018-02-23 Thread Brandon Williams
e > die (_("The server uses a different protocol version than we can > speak: %s\n"), > reader->line); > so I would think here it is reasonable to add _(translation). This should be a BUG as it shouldn't ever be unknown at this point. And I'll also drop that comment. -- Brandon Williams

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

2018-02-23 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:49 -0800 > Brandon Williams wrote: > > > .gitignore | 1 + > > Documentation/technical/protocol-v2.txt | 114 +++ > > Makefile

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

2018-02-23 Thread Brandon Williams
On 02/22, Jeff King wrote: > On Tue, Feb 06, 2018 at 05:12:49PM -0800, Brandon Williams wrote: > > > +In protocol v2 communication is command oriented. When first contacting a > > +server a list of capabilities will advertised. Some of these capabilities > > +will be com

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

2018-02-23 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Fri, Feb 23, 2018 at 1:30 PM, Brandon Williams wrote: > > On 02/22, Stefan Beller wrote: > >> > +static enum protocol_version discover_version(struct packet_reader > >> > *reader) > >> > +{ > >> ... >

Re: [PATCH 16/27] sha1_file: add repository argument to sha1_file_name

2018-02-23 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Wed, Feb 21, 2018 at 4:51 PM, Brandon Williams wrote: > > On 02/20, Stefan Beller wrote: > >> Add a repository argument to allow sha1_file_name callers to be more > >> specific about which repository to handle. This is a small mechani

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread Brandon Williams
g without a repository, assuming SHA-1 hash")); > > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); > > + } > > Again, same concern. I can imagine scripts that will blow up loudly if > git diff --no-index spews things to standard error. > > I'm not opposed to making this more visible, but I wonder if maybe it > should only be visible to developers or such. The only way I can think > of doing is that is with an advice options, but maybe there's a better > way. > -- > brian m. carlson / brian with sandals: Houston, Texas, US > https://www.crustytoothpaste.net/~bmc | My opinion only > OpenPGP: https://keybase.io/bk2204 -- Brandon Williams

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

2018-02-23 Thread Brandon Williams
On 02/22, Brandon Williams wrote: > On 02/22, Jeff King wrote: > > On Tue, Feb 06, 2018 at 05:12:50PM -0800, Brandon Williams wrote: > > > > > +ls-refs takes in the following parameters wrapped in packet-lines: > > > + > > > +symrefs > > >

Re: [PATCHv4 01/27] repository: introduce raw object store field

2018-02-26 Thread Brandon Williams
> > + the_repository->index = &the_index; > > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); > > +} > > I see what you did here, and I like it. I thought this would be a good idea to do eventually but back when I first introduced struct repository there wasn't enough to justify it till now. This definitely makes it much easier to read the initialization and I prefer this over the initializer. Thanks for working on this :) -- Brandon Williams

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

2018-02-26 Thread Brandon Williams
On 02/23, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:58 -0800 > Brandon Williams wrote: > > > + while ((oid = get_rev())) { > > + packet_buf_write(req_buf, "have %s\n", oid_to_hex(oid)); > > + if (++haves_added >= INIT

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

2018-02-27 Thread Brandon Williams
pports infix matching, or maybe > we'll never need it. :) > > Sincerely, > Jonathan > > [1] > https://public-inbox.org/git/CAJo=hjszcam9sipdvr7tmd-fd2v2w6_pvmq791egcdsdkq0...@mail.gmail.com/#t -- Brandon Williams

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

2018-02-27 Thread Brandon Williams
e interface as similar as possible to make it easy to convert to using it as well as having no need to clean anything up (because the struct is really just a wrapper and doesn't own anything). -- Brandon Williams

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

2018-02-27 Thread Brandon Williams
On 02/26, Jonathan Nieder wrote: > Brandon Williams wrote: > > > 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_trans

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

2018-02-27 Thread Brandon Williams
On 02/27, Jonathan Tan wrote: > On Fri, 23 Feb 2018 13:33:15 -0800 > Brandon Williams wrote: > > > On 02/21, Jonathan Tan wrote: > > > As someone who is implementing the server side of protocol V2 in JGit, I > > > now have a bit more insight into this :-) > &g

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

2018-02-27 Thread Brandon Williams
On 02/26, Jonathan Nieder wrote: > Hi, > > 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 Williams

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

2018-02-27 Thread Brandon Williams
3 @@ struct upload_pack_data { > > struct object_array wants; > > struct oid_array haves; > > > > + struct object_array shallows; > > + struct string_list deepen_not; > > + int depth; > > + timestamp_t deepen_since; > > + int deepen_rev_list; > > + int deepen_relative; > > Nice. > > Comments describing deepen_Rev_list and deepen_relative would be nice. > > Are those boolean? Can they be unsigned:1 to make that > self-explanatory? They are boolean but are passed via reference at some points so they can't be bit flags. > > [...] > > @@ -1080,12 +1101,14 @@ struct upload_pack_data { > > unsigned done : 1; > > }; > > > > -#define UPLOAD_PACK_DATA_INIT { OBJECT_ARRAY_INIT, OID_ARRAY_INIT, 0, 0, > > 0, 0, 0, 0 } > > +#define UPLOAD_PACK_DATA_INIT { OBJECT_ARRAY_INIT, OID_ARRAY_INIT, > > OBJECT_ARRAY_INIT, STRING_LIST_INIT_DUP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } > > Long line, "make style" should be able to fix it. > I'll fix this. -- Brandon Williams

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

2018-02-27 Thread Brandon Williams
On 02/26, Jonathan Nieder wrote: > Brandon Williams wrote: > > static char *server_capabilities; > > +static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT; > > Can a quick doc comment describe these and how they relate? > > Is only one of them set, base

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

2018-02-27 Thread Brandon Williams
int fd[2], > > + const struct ref *orig_ref, > > + struct ref **sought, int nr_sought, > > + char **pack_lockfile) > > +{ > > + struct ref *ref = copy_ref_list(orig_ref); > > + enum fetch_state state = FETCH_CHECK_LOCAL; > > + struct oidset common = OIDSET_INIT; > > + struct packet_reader reader; > > + int in_vain = 0; > > + packet_reader_init(&reader, fd[0], NULL, 0, > > + PACKET_READ_CHOMP_NEWLINE); > > + > > + while (state != FETCH_DONE) { > > + switch (state) { > > + case FETCH_CHECK_LOCAL: > > + sort_ref_list(&ref, ref_compare_name); > > + QSORT(sought, nr_sought, cmp_ref_by_name); > > + > > + /* v2 supports these by default */ > > Is there a doc that says what is all on by default? Yeah protocol-v2.txt should say all of that. > > Thanks, > Stefan -- Brandon Williams

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

2018-02-27 Thread Brandon Williams
On 02/27, Jonathan Nieder wrote: > Brandon Williams wrote: > > On 02/26, Jonathan Nieder wrote: > >> Brandon Williams wrote: > > >>> +++ b/transport.c > >>> @@ -230,12 +230,8 @@ static int fetch_refs_via_pack(struct transport > >>&

Re: [PATCH v2 2/4] repository.c: delete dead functions

2018-02-27 Thread Brandon Williams
t_path_from_env(INDEX_ENVIRONMENT, repo->gitdir, > - "index", !repo->ignore_env); > -} > - > static void expand_base_dir(char **out, const char *in, > const char *base_dir, const char *def_in) > { > -- > 2.16.1.435.g8f24da2e1a > -- Brandon Williams

Re: [PATCH v2 1/4] repository.c: move env-related setup code back to environment.c

2018-02-27 Thread Brandon Williams
et_gitdir(struct repository *repo, > + const char *root, > + const struct set_gitdir_args *optional); > extern void repo_set_worktree(struct repository *repo, const char *path); > extern void repo_set_hash_algo(struct repository *repo, int algo); > extern int repo_init(struct repository *repo, const char *gitdir, const char > *worktree); > diff --git a/setup.c b/setup.c > index c5d55dcee4..6fac1bb58a 100644 > --- a/setup.c > +++ b/setup.c > @@ -1116,8 +1116,7 @@ const char *setup_git_directory_gently(int *nongit_ok) > const char *gitdir = getenv(GIT_DIR_ENVIRONMENT); > if (!gitdir) > gitdir = DEFAULT_GIT_DIR_ENVIRONMENT; > - repo_set_gitdir(the_repository, gitdir); > - setup_git_env(); > + setup_git_env(gitdir); > } > if (startup_info->have_repository) > repo_set_hash_algo(the_repository, repo_fmt.hash_algo); > -- > 2.16.1.435.g8f24da2e1a > -- Brandon Williams

Re: [PATCH v2 3/4] sha1_file.c: move delayed getenv(altdb) back to setup_git_env()

2018-02-27 Thread Brandon Williams
*cb) > > void prepare_alt_odb(struct repository *r) > { > - const char *alt; > - > if (r->objects.alt_odb_tail) > return; > > - alt = getenv(ALTERNATE_DB_ENVIRONMENT); > - > r->objects.alt_odb_tail = &r->objects.alt_odb_list; > - link_alt_odb_entries(r, alt, PATH_SEP, NULL, 0); > + link_alt_odb_entries(r, r->objects.alternate_db, PATH_SEP, NULL, 0); > > read_info_alternates(r, r->objects.objectdir, 0); > } > -- > 2.16.1.435.g8f24da2e1a > -- Brandon Williams

Re: [PATCH v2 4/4] repository: delete ignore_env member

2018-02-27 Thread Brandon Williams
e but initializing a repo object otherwise you would have had a bit more difficult time getting rid of it :) Thanks! > > /* Indicate if a repository has a different 'commondir' from 'gitdir' */ > unsigned different_commondir:1; > -- > 2.16.1.435.g8f24da2e1a > -- Brandon Williams

Re: [PATCH] protocol: treat unrecognized protocol.version setting as 0

2018-02-27 Thread Brandon Williams
> since we have been changing the protocol.version number to a new value > like 20180226 each time a minor tweak to the protocolv2 RFC occured. > > The bit I have doubts about is whether to warn. What do you think? Patch looks good to me. And I don't have a strong preference either way for whether to warn or not. -- Brandon Williams

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

2018-02-27 Thread Brandon Williams
On 02/27, Jonathan Nieder wrote: > Brandon Williams wrote: > > > 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. > > Makes se

Re: [PATCH] protocol: treat unrecognized protocol.version setting as 0

2018-02-27 Thread Brandon Williams
On 02/28, Duy Nguyen wrote: > On Wed, Feb 28, 2018 at 8:02 AM, Brandon Williams wrote: > > On 02/27, Jonathan Nieder wrote: > >> If I share my .gitconfig or .git/config file between multiple machines > >> (or between multiple Git versions on a single machine) and se

Re: [PATCH v3 0/4] Delete ignore_env member in struct repository

2018-02-28 Thread Brandon Williams
ns > sha1_file.c: move delayed getenv(altdb) back to setup_git_env() > repository: delete ignore_env member > > cache.h| 2 +- > environment.c | 31 +-- > object-store.h | 5 ++- > object.c | 1 + > repository.c | 84 -- > repository.h | 21 +++-- > setup.c| 3 +- > sha1_file.c| 6 +--- > 8 files changed, 87 insertions(+), 66 deletions(-) > > -- > 2.16.1.399.g632f88eed1 > -- Brandon Williams

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

2018-02-28 Thread Brandon Williams
On 02/27, Jonathan Nieder wrote: > Brandon Williams wrote: > > > Introduce the transport-helper capability 'stateless-connect'. This > > capability indicates that the transport-helper can be requested to run > > the 'stateless-connect' command

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

2018-02-28 Thread Brandon Williams
On 02/27, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > > Teach remote-curl the 'stateless-connect' command which is used to > > establish a stateless connection with servers which support protocol > > version 2. This allows remote-

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

2018-02-28 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 v4 00/35] protocol version 2

2018-02-28 Thread Brandon Williams
x27;t use objects from configured alternates. 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:

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

2018-02-28 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 | 173 ++-

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

2018-02-28 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 | 55 -- pkt-line.h | 16

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

2018-02-28 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 changed

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

2018-02-28 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 v4 05/35] upload-pack: factor out processing lines

2018-02-28 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 v4 03/35] pkt-line: add delim packet support

2018-02-28 Thread Brandon Williams
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 | 17 + pkt-line.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/pkt-line.c b/pkt-li

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

2018-02-28 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 | 171 Mak

[PATCH v4 02/35] pkt-line: allow peeking a packet line without consuming it

2018-02-28 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 v4 09/35] transport: store protocol version

2018-02-28 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 v4 10/35] protocol: introduce enum protocol_version value protocol_v2

2018-02-28 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 | 2 ++ builtin/receive-pack.c | 6 ++ builtin/send-pack.c| 3 +++ builtin/upload-p

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

2018-02-28 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 v4 14/35] connect: request remote refs using v2

2018-02-28 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 v4 15/35] transport: convert get_refs_list to take a list of ref patterns

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

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

2018-02-28 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 v4 13/35] ls-refs: introduce ls-refs server command

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

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

2018-02-28 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 v4 21/35] fetch-pack: perform a fetch using v2

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

[PATCH v4 33/35] http: eliminate "# service" line when using protocol v2

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

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

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

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

2018-02-28 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 v4 22/35] fetch-pack: support shallow requests

2018-02-28 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 v4 25/35] transport-helper: remove name parameter

2018-02-28 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 v4 29/35] remote-curl: create copy of the service name

2018-02-28 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. Currently, all service names are string constants, but a subsequent patch will introduce service names from external sources. Signed-off-b

[PATCH v4 31/35] http: allow providing extra headers for http requests

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

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

2018-02-28 Thread Brandon Williams
Introduce the 'fetch' server command. Signed-off-by: Brandon Williams --- Documentation/technical/protocol-v2.txt | 128 serve.c | 2 + t/t5701-git-serve.sh| 1 + upload-pack.c

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

2018-02-28 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 v4 27/35] transport-helper: introduce stateless-connect

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

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

2018-02-28 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 v4 17/35] ls-remote: pass ref patterns when requesting a remote's refs

2018-02-28 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 v4 24/35] connect: don't request v2 when pushing

2018-02-28 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 v4 28/35] pkt-line: add packet_buf_write_len function

2018-02-28 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

<    14   15   16   17   18   19   20   21   22   23   >