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

2018-01-02 Thread Brandon Williams
based on provided ref-patterns. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/technical/protocol-v2.txt | 26 + Makefile| 1 + ls-refs.c | 97 + ls-

[PATCH 26/26] remote-curl: implement connect-half-duplex command

2018-01-02 Thread Brandon Williams
through to convert requests to http. Signed-off-by: Brandon Williams <bmw...@google.com> --- remote-curl.c | 185 - t/t5701-protocol-v2.sh | 41 +++ 2 files changed, 224 insertions(+), 2 deletions(-) diff --git a/remote-cu

[PATCH 24/26] pkt-line: add packet_buf_write_len function

2018-01-02 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 <bmw...@google.com> --- pkt-line.c | 16 pkt-line.h | 1 + 2 files chang

[PATCH 23/26] transport-helper: introduce connect-half-duplex

2018-01-02 Thread Brandon Williams
to using the dumb remote-helper commands. Signed-off-by: Brandon Williams <bmw...@google.com> --- transport-helper.c | 8 transport.c| 1 + transport.h| 6 ++ 3 files changed, 15 insertions(+) diff --git a/transport-helper.c b/transport-helper.c index c03

[PATCH 20/26] fetch-pack: perform a fetch using v2

2018-01-02 Thread Brandon Williams
When communicating with a v2 server, perform a fetch by requesting the 'fetch' command. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch-pack.c | 2 +- fetch-pack.c | 267 - fetch-pack.h | 4

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

2018-01-02 Thread Brandon Williams
necessary but wasn't removed. Clean up 'recvline_fh()' parameter list by removing the 'name' parameter. Signed-off-by: Brandon Williams <bmw...@google.com> --- transport-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transport-helper.c b/transport-helper.c

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

2018-01-02 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 <bmw...@google.

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

2018-01-02 Thread Brandon Williams
to indicate the end of a response. Signed-off-by: Brandon Williams <bmw...@google.com> --- pkt-line.c | 19 ++- pkt-line.h | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkt-line.c b/pkt-line.c index 98c2d7d68..3159cbe10 100644 --- a/pkt-line.c +++ b/pkt-

[PATCH 18/26] push: pass ref patterns when pushing

2018-01-02 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 <bmw...@google.

[PATCH 00/26] protocol version 2

2018-01-02 Thread Brandon Williams
! Thanks! Brandon Brandon Williams (26): 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 processing lines transport: use get_refs_via_connect to get refs

[PATCH 16/26] ls-remote: pass ref patterns when requesting a remote's refs

2018-01-02 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 <bmw...@google.

[PATCH 14/26] transport: convert get_refs_list to take a list of ref patterns

2018-01-02 Thread Brandon Williams
on the sent patterns. Signed-off-by: Brandon Williams <bmw...@google.com> --- 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

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

2018-01-02 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 <bmw...@google.com> --- Makefile | 3 ++- builtin.h | 1 + git.c | 1 + upload-pack.c | 2 +- 4 files changed, 5 insertions

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

2018-01-02 Thread Brandon Williams
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 <bmw...@google.com> --- connect.c

[PATCH 01/26] pkt-line: introduce packet_read_with_status

2018-01-02 Thread Brandon Williams
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 <bmw...@google.com> --- pkt-line.c | 55 ++- pkt-line.h | 15 +++ 2 files c

[PATCH 13/26] connect: request remote refs using v2

2018-01-02 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 <bmw...@google.com> --- connect.c | 101 - re

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

2018-01-02 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- builtin/fetch-pack.c | 16 +++- builtin/send-pack.c | 17 +++-- connect.c| 15 --- connect.h| 3 +++ remote-curl.c| 20 ++-- remote.h | 5 +++-- trans

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

2018-01-02 Thread Brandon Williams
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 <bmw...@google.com> --- pkt-line.c | 59 +++ pkt-line.

[PATCH] oidmap: ensure map is initialized

2017-12-22 Thread Brandon Williams
Ensure that an oidmap is initialized before attempting to add, remove, or retrieve an entry by simply performing the initialization step before accessing the underlying hashmap. Signed-off-by: Brandon Williams <bmw...@google.com> --- oidmap.c | 11 +++ 1 file changed, 11 inse

Re: [PATCH] oidmap.h: strongly discourage using OIDMAP_INIT directly

2017-12-22 Thread Brandon Williams
tely here because oidset_insert() > + * will call oidset_init() (which will call oidmap_init()), and > + * oidset_contains() works as intended even before oidset_init() was called. > + */ > +#define OIDSET_INIT { OIDMAP_INIT_INCOMPLETELY } > > /** > * Returns true iff `set` contains `oid`. > > base-commit: 936d1b989416a95f593bf81ccae8ac62cd83f279 > -- > 2.15.1.windows.2 -- Brandon Williams

Re: [PATCH v2 1/3] repository: fix repo_read_index with submodules

2017-12-18 Thread Brandon Williams
On 12/18, Thomas Gummerer wrote: > On 12/18, Brandon Williams wrote: > > On 12/17, Thomas Gummerer wrote: > > > repo_read_index calls read_index_from, which takes an path argument for > > > the location of the index file. For the split index however it relies > &

Re: [PATCH v2 2/3] prune: fix pruning with multiple worktrees and split index

2017-12-18 Thread Brandon Williams
s", gitdir, base_sha1_hex); ret = do_read_index(split_index->base, base_path, 1); if (hashcmp(split_index->base_sha1, split_index->base->sha1)) die("broken index, expect %s in %s, got %s", base_sha1_hex, base_path, sha1_to_hex(split_index->base->sha1)); - freshen_shared_index(base_sha1_hex, 0); + freshen_shared_index(base_path, 0); merge_base_index(istate); post_read_index_from(istate); + free(base_path); return ret; -- Brandon Williams

Re: [PATCH v2 1/3] repository: fix repo_read_index with submodules

2017-12-18 Thread Brandon Williams
index_state *istate) > { > return (!istate->cache_nr && !istate->timestamp.sec); > diff --git a/repository.c b/repository.c > index bb2fae5446..928b1f553d 100644 > --- a/repository.c > +++ b/repository.c > @@ -229,5 +229,5 @@ int repo_read_index(struct repository *repo) > if (!repo->index) > repo->index = xcalloc(1, sizeof(*repo->index)); > > - return read_index_from(repo->index, repo->index_file); > + return read_index_for_repo(repo); > } > -- > 2.15.1.620.gb9897f4670 > -- Brandon Williams

[PATCH] path: document path functions

2017-12-13 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- As promised here is an update to the documentation for the path generating functions. path.h | 133 ++--- 1 file changed, 112 insertions(+), 21 deletions(-) diff --git a/pa

[PATCH 3/3] submodule: convert get_next_submodule to not rely on the_index

2017-12-12 Thread Brandon Williams
' to prevent future users of these macros in submodule.c. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 4 +++- submodule.c | 23 +-- submodule.h | 10 ++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/builtin/f

[PATCH 1/3] submodule: convert stage_updated_gitmodules to take a struct index_state

2017-12-12 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/mv.c | 2 +- builtin/rm.c | 2 +- submodule.c | 4 ++-- submodule.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/mv.c b/builtin/mv.c index ffdd5f01a..cf3684d90 100644 --- a/builtin/mv.c

[PATCH 0/3] convert submodule.c to not use the index compat macros

2017-12-12 Thread Brandon Williams
This series removes the remaining users of the index compatibility macros and ensures that future uses of the macros will result in compiler errors. Brandon Williams (3): submodule: convert stage_updated_gitmodules to take a struct index_state submodule: used correct index

[PATCH 2/3] submodule: used correct index in is_staging_gitmodules_ok

2017-12-12 Thread Brandon Williams
index_state'. Fix this by changing the call to 'ie_match_stat()' and using the passed in index_state struct. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 5 +++-- submodule.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submo

Re: [PATCH] clone: support 'clone --shared' from a worktree

2017-12-11 Thread Brandon Williams
On 12/11, Eric Sunshine wrote: > On Mon, Dec 11, 2017 at 7:18 PM, Brandon Williams <bmw...@google.com> wrote: > > On 12/11, Eric Sunshine wrote: > >> struct strbuf alt = STRBUF_INIT; > >> - strbuf_addf(, "%s/objects", s

Re: [PATCH] clone: support 'clone --shared' from a worktree

2017-12-11 Thread Brandon Williams
ared from linked checkout' ' > + git -C bare worktree add --detach ../baretree && > + git clone --local --shared baretree bare-clone && > + grep /bare/ bare-clone/.git/objects/info/alternates > +' > + > test_expect_success '"add" worktree with --no-checkout' ' > git worktree add --no-checkout -b swamp swamp && > ! test -e swamp/init.t && > -- > 2.15.1.502.gccaef8de57 > -- Brandon Williams

Re: [PATCH 2/3] prune: fix pruning with multiple worktrees and split index

2017-12-11 Thread Brandon Williams
epository object from > worktree"); > > - if (read_index_from(, > - worktree_git_path(wt, "index")) > 0) > - do_add_index_objects_to_pending(revs, ); > - discard_index(); > + if (repo_read_index(repo) > 0) > + do_add_index_objects_to_pending(revs, repo->index); > + discard_index(repo->index); One we have separate object stores per-repository how would we handle this since this pruning should only work on a single repository's object store? > } > free_worktrees(worktrees); > } > -- > 2.15.1.504.g5279b80103 > -- Brandon Williams

Re: [PATCH 1/3] repository: fix repo_read_index with submodules

2017-12-11 Thread Brandon Williams
'? > + > int is_index_unborn(struct index_state *istate) > { > return (!istate->cache_nr && !istate->timestamp.sec); > diff --git a/repository.c b/repository.c > index bb2fae5446..928b1f553d 100644 > --- a/repository.c > +++ b/repository.c > @@ -229,5 +229,5 @@ int repo_read_index(struct repository *repo) > if (!repo->index) > repo->index = xcalloc(1, sizeof(*repo->index)); > > - return read_index_from(repo->index, repo->index_file); > + return read_index_for_repo(repo); > } > -- > 2.15.1.504.g5279b80103 > -- Brandon Williams

Re: [PATCH v7 00/16] Parial clone part 3: clone, fetch, fetch-pack, upload-pack, and tests

2017-12-08 Thread Brandon Williams
stion is a promised object before you go out to contact the server to request it? You may have already ruled this out for some reason I'm not aware of (maybe its too costly to compute?). -- Brandon Williams

Re: [WIP 11/15] serve: introduce git-serve

2017-12-08 Thread Brandon Williams
On 12/07, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > +static struct protocol_capability *get_capability(const char *key) > > +{ > > + int i; > > + > > + if (!key) > > + return NULL; > >

Re: [WIP 07/15] connect: convert get_remote_heads to use struct packet_reader

2017-12-08 Thread Brandon Williams
On 12/06, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > EXPECTING_DONE sounded like we are expecting to see 'done' packet > sent from the other side, but I was mistaken. It is the state > where we are "done" expecting anything

Re: [WIP 04/15] upload-pack: convert to a builtin

2017-12-08 Thread Brandon Williams
On 12/06, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > 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 <bmw...@goog

Re: [WIP 08/15] connect: discover protocol version outside of get_remote_heads

2017-12-08 Thread Brandon Williams
On 12/07, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > While we could wrap the preamble into a function it sort of defeats the > > purpose since you want to be able to call different functions based on > > the protocol version you're sp

Re: [WIP 03/15] pkt-line: add delim packet support

2017-12-08 Thread Brandon Williams
On 12/07, Stefan Beller wrote: > On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams <bmw...@google.com> 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 > >

Re: [WIP 02/15] pkt-line: introduce struct packet_reader

2017-12-08 Thread Brandon Williams
On 12/07, Stefan Beller wrote: > On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams <bmw...@google.com> wrote: > > Sometimes it is advantageous to be able to peek the next packet line > > without consuming it (e.g. to be able to determine the protocol version > > a ser

Re: [WIP 01/15] pkt-line: introduce packet_read_with_status

2017-12-08 Thread Brandon Williams
On 12/07, Stefan Beller wrote: > On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams <bmw...@google.com> wrote: > > > diff --git a/pkt-line.h b/pkt-line.h > > index 3dad583e2..f1545929b 100644 > > --- a/pkt-line.h > > +++ b/pkt-line.h > > @@ -60,8 +60,16 @

Re: [PATCH v6 09/12] fixup: sha1_file: convert gotos to break/continue

2017-12-07 Thread Brandon Williams
; > + } > + > + return -1; > + } > > -found_packed: > if (oi == _oi) > /* >* We know that the caller doesn't actually need the > -- > 2.9.3 > -- Brandon Williams

Re: [PATCH v6 03/12] fsck: support refs pointing to promisor objects

2017-12-07 Thread Brandon Williams
On 12/07, Jonathan Tan wrote: > On Thu, 7 Dec 2017 11:18:52 -0800 > Brandon Williams <bmw...@google.com> wrote: > > > Instead of requiring that every test first removes 'repo', maybe you > > want to have each test do its own cleanup by adding in > > 'test_when_f

Re: [PATCH v6 03/12] fsck: support refs pointing to promisor objects

2017-12-07 Thread Brandon Williams
s own cleanup by adding in 'test_when_finished' lines to do the removals? Just a thought. > + test_create_repo repo && > + test_commit -C repo my_commit && > + > + A=$(git -C repo commit-tree -m a HEAD^{tree}) && > + > + # Reference $A only from ref > + git -C repo branch my_branch "$A" && > + promise_and_delete "$A" && > + > + git -C repo config core.repositoryformatversion 1 && > + git -C repo config extensions.partialclone "arbitrary string" && > + git -C repo fsck > +' > + > test_done > -- > 2.9.3 > -- Brandon Williams

Re: [WIP 08/15] connect: discover protocol version outside of get_remote_heads

2017-12-07 Thread Brandon Williams
On 12/07, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > @@ -193,7 +195,17 @@ int cmd_fetch_pack(int argc, const char **argv, const > > char *prefix) > > if (!conn) > > return args.diag_url ? 0 : 1; &

Re: [WIP 06/15] transport: use get_refs_via_connect to get refs

2017-12-07 Thread Brandon Williams
On 12/06, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > 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()'. > >

[PATCH v2] diff-tree: read the index so attribute checks work in bare repositories

2017-12-06 Thread Brandon Williams
e setup of diff-tree. Reported-by: Ben Boeckel <ben.boec...@kitware.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/diff-tree.c| 2 ++ t/t4015-diff-whitespace.sh | 17 + 2 files changed, 19 insertions(+) diff --git a/builtin/diff-tree.c b/bui

Re: [PATCH] diff-tree: read the index so attribute checks work in bare repositories

2017-12-06 Thread Brandon Williams
On 12/05, Eric Sunshine wrote: > On Tue, Dec 5, 2017 at 5:13 PM, Brandon Williams <bmw...@google.com> wrote: > > A regression was introduced in 557a5998d (submodule: remove > > gitmodules_config, 2017-08-03) to how attribute processing was handled > > in bare reposit

Re: [PATCH] diff-tree: read the index so attribute checks work in bare repositories

2017-12-06 Thread Brandon Williams
On 12/05, Stefan Beller wrote: > On Tue, Dec 5, 2017 at 2:13 PM, Brandon Williams <bmw...@google.com> wrote: > > A regression was introduced in 557a5998d (submodule: remove > > gitmodules_config, 2017-08-03) to how attribute processing was handled > > in bare reposit

Re: [RFC] 'unsigned long' to 'size_t' conversion

2017-12-06 Thread Brandon Williams
ay to go about such a conversion would be to do it in small chunks as you've mentioned. That way you are only causing churn in hopefully small parts of the code base at a time instead of one monolithic change that is sure to cause conflicts. -- Brandon Williams

Re: [PATCH] diff-tree: read the index so attribute checks work in bare repositories

2017-12-05 Thread Brandon Williams
On 12/05, Ben Boeckel wrote: > On Tue, Dec 05, 2017 at 14:13:37 -0800, Brandon Williams wrote: > > This patch should fix the regression. Let me know if it doesn't solve the > > issue and I'll investigate some more. > > Our test suite passes again. Thanks! Of cour

[PATCH] diff-tree: read the index so attribute checks work in bare repositories

2017-12-05 Thread Brandon Williams
e setup of diff-tree. Reported-by: Ben Boeckel <ben.boec...@kitware.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- This patch should fix the regression. Let me know if it doesn't solve the issue and I'll investigate some more. builtin/diff-tree.c| 1 +

Re: gitattributes not read for diff-tree anymore in 2.15?

2017-12-05 Thread Brandon Williams
On 12/05, Ben Boeckel wrote: > On Mon, Dec 04, 2017 at 15:03:55 -0800, Brandon Williams wrote: > > Reading the attributes files should be done regardless if the gitmodules > > file is read. The gitmodules file should only come into play if you are > > dealing with

Re: [PATCH] pathspec: only match across submodule boundaries when requested

2017-12-04 Thread Brandon Williams
On 11/29, Johannes Schindelin wrote: > Hi Brandon, > > On Tue, 28 Nov 2017, Brandon Williams wrote: > > > Commit 74ed43711fd (grep: enable recurse-submodules to work on > > objects, 2016-12-16) taught 'tree_entry_interesting()' to be able to > > match across submod

[PATCH v2] pathspec: only match across submodule boundaries when requested

2017-12-04 Thread Brandon Williams
be allowed to cross submodule boundaries. This fixes https://github.com/git-for-windows/git/issues/1371. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c| 1 + pathspec.h| 1 + t/t4208-log-magic-pathspec.sh | 19 +++

[WIP 05/15] upload-pack: factor out processing lines

2017-12-04 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 <bmw...@google.

[WIP 10/15] protocol: introduce enum protocol_version value protocol_v2

2017-12-04 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 <bmw...@google.com> --- builtin/fetch-pack.c | 3 +++ builtin/receive-pack.c | 3 +++ builtin/send-pack.c| 3 +++ con

[WIP 14/15] upload_pack: introduce fetch server command

2017-12-04 Thread Brandon Williams
Introduce the 'fetch' server command. Signed-off-by: Brandon Williams <bmw...@google.com> --- serve.c | 2 + upload-pack.c | 223 ++ upload-pack.h | 9 +++ 3 files changed, 234 insertions(+) create mode 100644 upload-pack.h

[WIP 12/15] ls-refs: introduce ls-refs server command

2017-12-04 Thread Brandon Williams
based on provided ref-patterns. Signed-off-by: Brandon Williams <bmw...@google.com> --- Makefile | 1 + ls-refs.c | 96 +++ ls-refs.h | 9 ++ serve.c | 8 ++ 4 files changed, 114 insertions(+) create mode 100644 ls-

[WIP 15/15] fetch-pack: perform a fetch using v2

2017-12-04 Thread Brandon Williams
When communicating with a v2 server, perform a fetch by requesting the 'fetch' command. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch-pack.c | 2 +- fetch-pack.c | 237 - fetch-pack.h | 4

[WIP 07/15] connect: convert get_remote_heads to use struct packet_reader

2017-12-04 Thread Brandon Williams
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 <bmw...@google.com> --- connect.c

[WIP 08/15] connect: discover protocol version outside of get_remote_heads

2017-12-04 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- builtin/fetch-pack.c | 14 +- builtin/send-pack.c | 15 +-- connect.c| 13 - connect.h| 3 +++ remote-curl.c| 18 -- remote.h | 5 +++-- transport.c

[WIP 03/15] pkt-line: add delim packet support

2017-12-04 Thread Brandon Williams
to indicate the end of a response. Signed-off-by: Brandon Williams <bmw...@google.com> --- pkt-line.c | 19 ++- pkt-line.h | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkt-line.c b/pkt-line.c index 518109bbe..222e1e310 100644 --- a/pkt-line.c +++ b/pkt-

[WIP 01/15] pkt-line: introduce packet_read_with_status

2017-12-04 Thread Brandon Williams
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 <bmw...@google.com> --- pkt-line.c | 55 ++- pkt-line.h | 8 2 files chang

[WIP 09/15] transport: store protocol version

2017-12-04 Thread Brandon Williams
-by: Brandon Williams <bmw...@google.com> --- transport.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/transport.c b/transport.c index 28b744ec2..4160c4167 100644 --- a/transport.c +++ b/transport.c @@ -118,6 +118,7 @@

[WIP 06/15] transport: use get_refs_via_connect to get refs

2017-12-04 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 <bmw...@google.com> --- transport.c | 18 -- 1 file changed, 4 insertions(

[WIP 04/15] upload-pack: convert to a builtin

2017-12-04 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 <bmw...@google.com> --- Makefile | 3 ++- builtin.h | 1 + git.c | 1 + upload-pack.c | 2 +- 4 files changed, 5 insertions

[WIP 02/15] pkt-line: introduce struct packet_reader

2017-12-04 Thread Brandon Williams
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 <bmw...@google.com> --- pkt-line.c | 61 + pkt-

[WIP 11/15] serve: introduce git-serve

2017-12-04 Thread Brandon Williams
at another command be executed or can terminate the connection by sending a flush packet. Signed-off-by: Brandon Williams <bmw...@google.com> --- .gitignore | 1 + Makefile| 2 + builtin.h | 1 + builtin/serve.c | 25 git.c | 1 + serve

[WIP 13/15] connect: request remote refs using v2

2017-12-04 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 <bmw...@google.com> --- connect.c | 85 +- re

[WIP 00/15] protocol version 2

2017-12-04 Thread Brandon Williams
as a separate server command or to keep it in fetch like it is in v1, just something to think about. Any comments or criticism is welcome. Thanks! Brandon Williams (15): pkt-line: introduce packet_read_with_status pkt-line: introduce struct packet_reader pkt-line: add delim packet support upload

Re: gitattributes not read for diff-tree anymore in 2.15?

2017-12-04 Thread Brandon Williams
On 12/04, Ben Boeckel wrote: > Hi, > > I've bisected a failure in our test suite to this commit: > > commit 557a5998df19faf8641acfc5b6b1c3c2ba64dca9 (HEAD, refs/bisect/bad) > Author: Brandon Williams <bmw...@google.com> > Date: Thu Aug 3 11:20:00 2017 -

Re: git-clone ignores submodule.recurse configuration

2017-12-01 Thread Brandon Williams
ot work with clone because a recursive clone ends up pulling data from other sources aside from the URL the user explicitly provides. Historically there have been a number of security related bugs with respect to cloning submodules so we felt it was best to require a recursive clone to be requested explicitly, at least for the time being. -- Brandon Williams

[PATCH] pathspec: only match across submodule boundaries when requested

2017-11-28 Thread Brandon Williams
be allowed to cross submodule boundaries. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/grep.c| 1 + pathspec.h| 1 + t/t4208-log-magic-pathspec.sh | 17 + tree-walk.c | 5 +++-- 4 files changed, 22

Re: Bug in pathspec handling (in conjunction with submodules)

2017-11-28 Thread Brandon Williams
it rev-list HEAD -- '[bracket]'` never > recurses into the submodule. And therefore, the promised "more accurate > matching [...] in the submodule" is never performed. And the commit adding > the submodule is never pruned. > > Since I am not really familiar with all that tree diff code (and as a > general rule to protect my mental health, I try my best to stay away from > submodules, too), but you two are, may I ask you gentle people to have a > closer look to fix those bugs? > > Thanks, > Dscho -- Brandon Williams

Re: [PATCH v3 0/8] Coping with unrecognized ssh wrapper scripts in GIT_SSH

2017-11-20 Thread Brandon Williams
6mhcyqti7vdg6...@aiede.mtv.corp.google.com/ > [2] > https://public-inbox.org/git/20171115202516.hduhzsgeoff5a...@aiede.mtv.corp.google.com/ > [3] https://public-inbox.org/git/xmqq60b59toe@gitster.mtv.corp.google.com/ -- Brandon Williams

Re: [PATCH 3/8] connect: split git:// setup into a separate function

2017-11-20 Thread Brandon Williams
On 11/20, Jonathan Nieder wrote: > Brandon Williams wrote: > > On 11/20, Jonathan Nieder wrote: > > >> + /* These underlying connection commands die() if they > >> + * cannot connect. > >> + */ > > > > I know this is really just code motio

Re: [PATCH 4/8] connect: split ssh command line options into separate function

2017-11-20 Thread Brandon Williams
On 11/20, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > On 11/20, Jonathan Nieder wrote: > [long stream of quoted context snipped; please cut down the quoted > text to what you are replying to in the future] > >> @@ -972,16 +1031,13 @@ struct child

Re: [PATCH 6/8] ssh: 'auto' variant to select between 'ssh' and 'simple'

2017-11-20 Thread Brandon Williams
-bracket-clone-simple && > @@ -381,6 +387,21 @@ test_expect_success 'uplink is treated as simple' ' > expect_ssh myhost src > ' > > +test_expect_success 'OpenSSH-like uplink is treated as ssh' ' > + write_script "$TRASH_DIRECTORY/uplink" <<-EOF && > + if test "\$1" = "-G" > + then > + exit 0 > + fi && > + exec "\$TRASH_DIRECTORY/ssh$X" "\$@" > + EOF > + test_when_finished "rm -f \"\$TRASH_DIRECTORY/uplink\"" && > + GIT_SSH="$TRASH_DIRECTORY/uplink" && > + test_when_finished "GIT_SSH=\"\$TRASH_DIRECTORY/ssh\$X\"" && > + git clone "[myhost:123]:src" ssh-bracket-clone-sshlike-uplink && > + expect_ssh "-p 123" myhost src > +' > + > test_expect_success 'plink is treated specially (as putty)' ' > copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && > git clone "[myhost:123]:src" ssh-bracket-clone-plink-0 && > -- > 2.15.0.448.gf294e3d99a > -- Brandon Williams

Re: [PATCH 4/8] connect: split ssh command line options into separate function

2017-11-20 Thread Brandon Williams
else if (flags & CONNECT_IPV6) > - argv_array_push(>args, "-6"); > - } > - > - if (variant == VARIANT_TORTOISEPLINK) > - argv_array_push(>args, "-batch"); > - > - if (port && variant != VARIANT_SIMPLE) { > - if (variant == VARIANT_SSH) > - argv_array_push(>args, "-p"); > - else > - argv_array_push(>args, "-P"); > - > - argv_array_push(>args, port); > - } > - > - argv_array_push(>args, ssh_host); > + fill_ssh_args(conn, ssh_host, port, flags); > } else { > transport_check_allowed("file"); > if (get_protocol_version_config() > 0) { > -- > 2.15.0.448.gf294e3d99a > -- Brandon Williams

Re: [PATCH 3/8] connect: split git:// setup into a separate function

2017-11-20 Thread Brandon Williams
prog, path, 0, > - target_host, 0); > - > - /* If using a new version put that stuff here after a second > null byte */ > - if (get_protocol_version_config() > 0) { > - strbuf_addch(, '\0'); > -

Re: [PATCH 1/8] ssh test: make copy_ssh_wrapper_as clean up after itself

2017-11-20 Thread Brandon Williams
k \ > git clone "[myhost:123]:src" ssh-bracket-clone-variant-3 && > expect_ssh "-P 123" myhost src > ' > > test_expect_success 'GIT_SSH_VARIANT overrides plink to tortoiseplink' ' > + copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && > GIT_SSH_VARIANT=tortoiseplink \ > git clone "[myhost:123]:src" ssh-bracket-clone-variant-4 && > expect_ssh "-batch -P 123" myhost src > @@ -449,9 +448,6 @@ test_expect_success 'clean failure on broken quoting' ' > git clone "[myhost:123]:src" sq-failure > ' > > -# Reset the GIT_SSH environment variable for clone tests. > -setup_ssh_wrapper > - > counter=0 > # $1 url > # $2 none|host > -- > 2.15.0.448.gf294e3d99a > -- Brandon Williams

Re: What's cooking in git.git (Nov 2017, #03; Wed, 8)

2017-11-08 Thread Brandon Williams
en a submodule that > is configured with 'submodule..ignore' is dirty; this has > been corrected. > > Will merge to 'next'. > I've edited in the tweak brought up in the discussion. Please > eyeball to sanity check. Tweaks look good to me! -- Brandon Williams

Re: [PATCH] wt-status: actually ignore submodules when requested

2017-11-06 Thread Brandon Williams
On 11/06, Stefan Beller wrote: > On Mon, Nov 6, 2017 at 2:08 PM, Brandon Williams <bmw...@google.com> wrote: > > Since ff6f1f564 (submodule-config: lazy-load a repository's .gitmodules > > file, 2017-08-03) rebase interactive fails if there are any submodules > > with

[PATCH] wt-status: actually ignore submodules when requested

2017-11-06 Thread Brandon Williams
ignored by rebase interactive, also set the 'OVERRIDE_SUBMODULE_CONFIG' diff flag when submodules are requested to be ignored when checking for unstaged changes. Reported-by: Orgad Shaneh <org...@gmail.com> Signed-off-by: Brandon Williams <bmw...@google.com> --- t/t3426-rebase-submo

Re: Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified

2017-11-06 Thread Brandon Williams
den by your repository's config, clearing the ignored flag and making rebase actually pay attention to the fact that the submodule has changes in it. I don't have a patch available to for you to test just yet (but I'll have some time later today to write one up) but could you verify that (1) you have an ignore entry for the submodule in question in your config and (2) removing it from your config avoids the failure? If that's the case then we would be able to put together a reproducible recipe for this failure. -- Brandon Williams

Re: [PATCH v2] grep: take the read-lock when adding a submodule

2017-11-01 Thread Brandon Williams
nates_memory()` around the same > time that another thread is reading in the list through > `read_sha1_file()`. > > Take the grep read-lock while adding the submodule. The lock is used to > serialize uses of non-thread-safe parts of Git's API, including > `read_sha1_file()`. &g

Re: [RFC] protocol version 2

2017-10-31 Thread Brandon Williams
On 10/28, Philip Oakley wrote: > From: "Brandon Williams" <bmw...@google.com> > Sent: Friday, October 20, 2017 6:18 PM > >Objective > >=== > > > >Replace Git's current wire protocol with a simpler, less wasteful > >protocol t

[PATCH v3 4/8] diff: remove touched flags

2017-10-31 Thread Brandon Williams
Now that the set of parallel touched flags are no longer being used, remove them. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/log.c | 2 -- diff.h| 6 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 821

[PATCH v3 0/8] convert diff flags to be stored in a struct

2017-10-31 Thread Brandon Williams
the struct members to lowercase Brandon Williams (8): add, reset: use DIFF_OPT_SET macro to set a diff flag diff: convert flags to be stored in bitfields diff: add flag to indicate textconv was set via cmdline diff: remove touched flags diff: remove DIFF_OPT_TST macro diff: remove

[PATCH v3 1/8] add, reset: use DIFF_OPT_SET macro to set a diff flag

2017-10-31 Thread Brandon Williams
Instead of explicitly setting the 'DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG' flag, use the 'DIFF_OPT_SET' macro. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/add.c | 2 +- builtin/reset.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/a

[PATCH v3 5/8] diff: remove DIFF_OPT_TST macro

2017-10-31 Thread Brandon Williams
; identifier fld; @@ - DIFF_OPT_TST(ptr, fld) + ptr->flags.fld Signed-off-by: Brandon Williams <bmw...@google.com> --- blame.c| 8 +++--- builtin/am.c | 2 +- builtin/blame.c| 4 +-- builtin/diff.c | 2 +- builtin/log.c

[PATCH v3 2/8] diff: convert flags to be stored in bitfields

2017-10-31 Thread Brandon Williams
diff_flags'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/commit.c | 7 +++-- builtin/log.c| 3 +- diff-lib.c | 7 +++-- diff.c | 2 +- diff.h | 93 sequencer.c | 5 +-- 6 files c

[PATCH v3 3/8] diff: add flag to indicate textconv was set via cmdline

2017-10-31 Thread Brandon Williams
is set to true via the command line. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/log.c | 2 +- diff.c| 5 +++-- diff.h| 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index dc28d43eb..82131751d

[PATCH v3 8/8] diff: make struct diff_flags members lowercase

2017-10-31 Thread Brandon Williams
; @@ - E.DEFAULT_FOLLOW_RENAMES + E.default_follow_renames Signed-off-by: Brandon Williams <bmw...@google.com> --- blame.c | 16 ++--- builtin/add.c | 4 +- builtin/am.c | 10 +-- builtin/blame.c | 10 +-- builtin/commit.c | 4 +- builtin/

[PATCH v3 6/8] diff: remove DIFF_OPT_SET macro

2017-10-31 Thread Brandon Williams
; identifier fld; @@ - DIFF_OPT_SET(ptr, fld) + ptr->flags.fld = 1 Signed-off-by: Brandon Williams <bmw...@google.com> --- blame.c | 8 +++ builtin/add.c | 4 ++-- builtin/am.c | 8 +++ builtin/blame.c | 4 ++--

[PATCH v3 7/8] diff: remove DIFF_OPT_CLR macro

2017-10-31 Thread Brandon Williams
; identifier fld; @@ - DIFF_OPT_CLR(ptr, fld) + ptr->flags.fld = 0 Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/blame.c | 2 +- combine-diff.c| 2 +- diff.c| 28 ++-- diff.h| 2

Re: [PATCH 3.5/4] diff: set TEXTCONV_VIA_CMDLINE only when it is set to true

2017-10-31 Thread Brandon Williams
modules")) { > DIFF_OPT_SET(options, OVERRIDE_SUBMODULE_CONFIG); > handle_ignore_submodules_arg(options, "all"); > } else if (skip_prefix(arg, "--ignore-submodules=", )) { > -- > 2.15.0-224-g5109123e6a > -- Brandon Williams

Re: [PATCH 2.5/4] diff: avoid returning a struct by value from diff_flags_or()

2017-10-31 Thread Brandon Williams
for (i = 0; i < sizeof(struct diff_flags); i++) > - tmp_out[i] = tmp_a[i] | tmp_b[i]; > - > - return out; > + tmp_a[i] |= tmp_b[i]; > } > > #define DIFF_OPT_TST(opts, flag) ((opts)->flags.flag) > -- > 2.15.0-224-g5109123e6a > -- Brandon Williams

Re: [PATCH v2 2/4] Add structure representing hash algorithm

2017-10-30 Thread Brandon Williams
"sha-1", > + /* "sha1", big-endian */ > + 0x73686131, > + sizeof(git_SHA_CTX), > + GIT_SHA1_RAWSZ, > + GIT_SHA1_HEXSZ, > + git_hash_sha1_init, > + git_hash_sha1_update, > + git_hash_sha1_final, > + _tree_oid, > + _blob_oid, > + }, > +}; > + > /* > * This is meant to hold a *small* number of objects that you would > * want read_sha1_file() to be able to return, but yet you do not want > -- > 2.15.0.rc2 > -- Brandon Williams

[PATCH v2 7/4] diff: remove DIFF_OPT_CLR macro

2017-10-30 Thread Brandon Williams
; identifier fld; @@ - DIFF_OPT_CLR(ptr, fld) + ptr->flags.fld = 0 Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/blame.c | 2 +- combine-diff.c| 2 +- diff.c| 30 +++--- diff.h| 2

<    3   4   5   6   7   8   9   10   11   12   >