[PATCH] pack-protocol: mention and point to docs for protocol v2

2018-07-23 Thread Brandon Williams
Signed-off-by: Brandon Williams --- Documentation/technical/pack-protocol.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt index 7fee6b780a..25acd9edb1 100644 --- a/Documentation

Re: [PATCH v6 8/8] fetch-pack: implement ref-in-want

2018-07-23 Thread Brandon Williams
On 07/22, Duy Nguyen wrote: > On Thu, Jun 28, 2018 at 12:33 AM Brandon Williams wrote: > > +static void receive_wanted_refs(struct packet_reader *reader, struct ref > > *refs) > > +{ > > + process_section_header(reader, "wanted-refs", 0); > &g

[PATCH] fetch-pack: mark die strings for translation

2018-07-23 Thread Brandon Williams
Signed-off-by: Brandon Williams --- fetch-pack.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 0b4a9f288f..51abee6181 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1245,13 +1245,13 @@ static int process_section_header

Re: [PATCH] fetch-pack: mark die strings for translation

2018-07-23 Thread Brandon Williams
On 07/23, Junio C Hamano wrote: > Junio C Hamano writes: > > > Brandon Williams writes: > > > >> Signed-off-by: Brandon Williams > >> --- > >> fetch-pack.c | 16 > >> 1 file changed, 8 insertions(+), 8 deletions(-) > &g

Re: [PATCH] pack-protocol: mention and point to docs for protocol v2

2018-07-24 Thread Brandon Williams
On 07/23, Jonathan Nieder wrote: > Hi, > > Brandon Williams wrote: > > > --- a/Documentation/technical/pack-protocol.txt > > +++ b/Documentation/technical/pack-protocol.txt > > @@ -50,7 +50,8 @@ Each Extra Parameter takes the form of `=` or > > ``. > >

Re: [RFC] push: add documentation on push v2

2018-07-24 Thread Brandon Williams
On 07/20, Jeff Hostetler wrote: > > > On 7/18/2018 1:15 PM, Brandon Williams wrote: > > On 07/18, Stefan Beller wrote: > > > On Wed, Jul 18, 2018 at 6:31 AM Derrick Stolee wrote: > > > > > > > > On 7/17/2018 7:25 PM, Stefan Beller wrote: &

Re: [RFC] push: add documentation on push v2

2018-07-24 Thread Brandon Williams
On 07/17, Brandon Williams wrote: > Signed-off-by: Brandon Williams > --- > > Since introducing protocol v2 and enabling fetch I've been thinking > about what its inverse 'push' would look like. After talking with a > number of people I have a longish lis

Re: What's cooking in git.git (Jul 2018, #02; Wed, 18)

2018-07-24 Thread Brandon Williams
), and I think the correct resolution is to move your > removal of "&& !rs->nr" to do_fetch() function where that commit > moved to. > > Thanks. > > [2] https://public-inbox.org/git/xmqqd0vwcfkr....@gitster-ct.c.googlers.com/ Yeah I still don't like it from a performance perspective, but given people rely on this functionality I've been convinced its necessary for correctness until we make other changes. -- Brandon Williams

Re: [PATCH] pack-protocol: mention and point to docs for protocol v2

2018-07-24 Thread Brandon Williams
On 07/24, Junio C Hamano wrote: > Brandon Williams writes: > > >> Not about this patch, but I wonder if an organization along the > >> following lines would make sense? > >> > >> 1. Rename pack-protocol.txt to protocol-v1.txt. Rename >

Re: [RFC] push: add documentation on push v2

2018-07-25 Thread Brandon Williams
On 07/25, Duy Nguyen wrote: > On Tue, Jul 24, 2018 at 9:29 PM Brandon Williams wrote: > > > > On 07/17, Brandon Williams wrote: > > > Signed-off-by: Brandon Williams > > > --- > > > > > > Since introducing protocol v2 and enabling fetch I&

Re: [PATCH 2/3] refs: introduce new API, wrap old API shallowly around new API

2018-07-27 Thread Brandon Williams
use a ref-store (and instead just calls the underlying impl with get_main_ref_store()). Am I missing something here? -- Brandon Williams

Re: [PATCH] config: fix case sensitive subsection names on writing

2018-07-27 Thread Brandon Williams
sensitive. > + git config -f caseSens v."A".r VAL && > + git config -f caseSens v."a".r val && > + > + echo VAL >caseSens_expect && > + git config -f caseSens v."A".r >caseSens_actual && > + test_cmp caseSens_expect caseSens_actual && > + > + echo val >caseSens_expect && > + git config -f caseSens v."a".r >caseSens_actual && > + test_cmp caseSens_expect caseSens_actual > +' > + > for VAR in a .a a. a.0b a."b c". a."b c".0d > do > test_expect_success "git -c $VAR=VAL rejects invalid '$VAR'" ' > -- > 2.18.0.345.g5c9ce644c3-goog > -- Brandon Williams

Re: [PATCH] refspec: allow @ on the left-hand side of refspecs

2018-07-30 Thread Brandon Williams
010dce0c..57c2f65104 100644 > --- a/refspec.c > +++ b/refspec.c > @@ -62,8 +62,12 @@ static int parse_refspec(struct refspec_item *item, const > char *refspec, int fet > return 0; > } > > + if (llen == 1 && lhs[0] == '@') > + item->src = xstrdup("HEAD"); > + else > + item->src = xstrndup(lhs, llen); > + This is probably the easiest place to put the aliasing logic so I don't have any issue with including it here. -- Brandon Williams

Re: [BUG] fetching sometimes doesn't update refs

2018-07-30 Thread Brandon Williams
his will get the objects but fail to update refs > git fetch > > # and fetching again will actually update the refs > git fetch > -- 8< -- > > -Peff -- Brandon Williams

Re: [PATCH] refspec: allow @ on the left-hand side of refspecs

2018-07-31 Thread Brandon Williams
On 07/30, brian m. carlson wrote: > On Mon, Jul 30, 2018 at 10:50:51AM -0700, Brandon Williams wrote: > > On 07/29, brian m. carlson wrote: > > > The object ID parsing machinery is aware of "@" as a synonym for "HEAD" > > > and this is docum

Re: [PATCH] transport: report refs only if transport does

2018-08-01 Thread Brandon Williams
e the input list again in this case and just simply add the resulting refs to the input list? > > [1] > https://public-inbox.org/git/86a128c5fb710a41791e7183207c4d64889f9307.1485381677.git.jonathanta...@google.com/ > [2] > https://public-inbox.org/git/eef2b77d88df0db08e4a1505b06e0af2d40143d5.1485381677.git.jonathanta...@google.com/ > [3] https://public-inbox.org/git/20180620213235.10952-1-bmw...@google.com/ -- Brandon Williams

Re: [PATCH] fetch-pack: unify ref in and out param

2018-08-01 Thread Brandon Williams
s to the > tail of the input list. Upon hindsight, maybe this should have been the > original API change instead of the "fetched_refs" mechanism. Thanks for getting this out, it looks good to me. If we end up adding patterns to ref-in-want then we can explore what changes would need to be made then, I expect we may need to do a bit more work on the whole fetching stack to get what we'd want in that case (because we would want to avoid this issue again). -- Brandon Williams

Re: What's cooking in git.git (Aug 2018, #01; Thu, 2)

2018-08-03 Thread Brandon Williams
;t interested in taking, shouldn't they at least get informed of that? Anyway those are just some of my thoughts. If my thinking is mistaken or I'm missing something please point it out to me. [1] https://public-inbox.org/git/cagz79kygs4dvoetygx01cinrxxlcqgxovsplhmgyz8b51lz...@mail.gmail.com/ This mail seems to counter that indicating that the "What's Cooking" emails should not be used as a status update. -- Brandon Williams

[RFC] submodule: munge paths to submodule git directories

2018-08-07 Thread Brandon Williams
This allows for a single location where we can munge the submodule name (by url encoding it) before using it as part of a path. Signed-off-by: Brandon Williams --- Using submodule names as is continues to be not such a good idea. Maybe we could apply something like this to stop using them

[PATCH 0/2] munge submodule names

2018-08-08 Thread Brandon Williams
Here's a more polished series taking into account some of the feedback on the RFC. As Junio pointed out URL encoding makes the directories much more human readable, but I'm open to other ideas if we don't think URL encoding is the right thing to do. Brandon Williams (2): su

[PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-08 Thread Brandon Williams
ld a path to the submodule's gitdir. Signed-off-by: Brandon Williams --- submodule.c | 14 ++ t/t7400-submodule-basic.sh | 32 +++- t/t7406-submodule-update.sh | 21 ++--- 3 files changed, 51 insertions(+), 16 deletions(-)

[PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-08 Thread Brandon Williams
d up a path into a repository's "modules" directory, abstracting away the fact that submodule git directories are stored in a repository's common gitdir. This makes it easier to adjust how submodules gitdir are stored in the "modules" directory in a future patch. Signe

Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-08 Thread Brandon Williams
On 08/08, Stefan Beller wrote: > On Wed, Aug 8, 2018 at 3:33 PM Brandon Williams wrote: > > > > Introduce a helper function "submodule_name_to_gitdir()" (and the > > submodule--helper subcommand "gitdir") which constructs a path to a > > submodule

Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs

2018-08-10 Thread Brandon Williams
On 08/10, Junio C Hamano wrote: > Brandon Williams writes: > > > Introduce a helper function "submodule_name_to_gitdir()" (and the > > submodule--helper subcommand "gitdir") which constructs a path to a > > submodule's gitdir, located in

Re: [PATCH 6/7] submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree

2018-08-10 Thread Brandon Williams
me=$(git submodule--helper name "$sm_path") || exit > if ! test -z "$update" > then > @@ -577,11 +579,6 @@ cmd_update() > die "$(eval_gettext "Unable to find current > \${remote_name}/\${branch} revision in submodule path '\$sm_path'")" > fi > > - if ! $(git config -f "$(git rev-parse > --git-common-dir)/modules/$name/config" core.worktree) 2>/dev/null > - then > - git submodule--helper connect-gitdir-workingtree > "$name" "$sm_path" > - fi > - > if test "$subsha1" != "$sha1" || test -n "$force" > then > subforce=$force > -- > 2.18.0.132.g195c49a2227 > -- Brandon Williams

Re: [PATCH 6/7] submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree

2018-08-10 Thread Brandon Williams
ttwen commondir and gitdir for worktrees. Using the "repo_git_path" function handles path rewritting when using worktrees. Here (when working with worktrees) "subrepo.gitdir" refers to the worktree specific gitdir while "subrepo.commondir" refers to the global common gitdir where the repository config actually lives. -- Brandon Williams

Re: [PATCH 03/24] attr: remove an implicit dependency on the_index

2018-08-13 Thread Brandon Williams
ue) { > marker_size = atoi(check->items[1].value); > @@ -398,7 +398,7 @@ int ll_merge_marker_size(const char *path) > > if (!check) > check = attr_check_initl("conflict-marker-size", NULL); > - if (!git_check_attr(path, check) && check->items[0].value) { > + if (!git_check_attr(&the_index, path, check) && check->items[0].value) { > marker_size = atoi(check->items[0].value); > if (marker_size <= 0) > marker_size = DEFAULT_CONFLICT_MARKER_SIZE; > diff --git a/userdiff.c b/userdiff.c > index 36af25e7f9..f3f4be579c 100644 > --- a/userdiff.c > +++ b/userdiff.c > @@ -278,7 +278,7 @@ struct userdiff_driver *userdiff_find_by_path(const char > *path) > check = attr_check_initl("diff", NULL); > if (!path) > return NULL; > - if (git_check_attr(path, check)) > + if (git_check_attr(&the_index, path, check)) > return NULL; > > if (ATTR_TRUE(check->items[0].value)) > diff --git a/ws.c b/ws.c > index a07caedd5a..5b67b426e7 100644 > --- a/ws.c > +++ b/ws.c > @@ -78,7 +78,7 @@ unsigned whitespace_rule(const char *pathname) > if (!attr_whitespace_rule) > attr_whitespace_rule = attr_check_initl("whitespace", NULL); > > - if (!git_check_attr(pathname, attr_whitespace_rule)) { > + if (!git_check_attr(&the_index, pathname, attr_whitespace_rule)) { > const char *value; > > value = attr_whitespace_rule->items[0].value; > -- > 2.18.0.1004.g6639190530 > -- Brandon Williams

Re: [PATCH 05/24] dir.c: remove an implicit dependency on the_index in pathspec code

2018-08-13 Thread Brandon Williams
e, namelen, item)) > return 0; Yuck, all of this just because I added the ability to match against attrs with pathspecs. Part of me wonders if it would be better to put a pointer to the needed istate in the pathspec struct...but then I can think of a ton of reasons why that wouldn't be good either. So yes I think this is probably the right approach, I'm just sorry I made it this messy :/ -- Brandon Williams

Re: [PATCH 16/24] attr: remove index from git_attr_set_direction()

2018-08-13 Thread Brandon Williams
rection(GIT_ATTR_CHECKOUT); > > if (should_update_submodules() && o->update && !o->dry_run) > load_gitmodules_file(index, NULL); > @@ -413,7 +413,7 @@ static int check_updates(struct unpack_trees_options *o) > stop_progress(&progress); > errs |= finish_delayed_checkout(&state); > if (o->update) > - git_attr_set_direction(GIT_ATTR_CHECKIN, NULL); > + git_attr_set_direction(GIT_ATTR_CHECKIN); > return errs != 0; > } > > -- > 2.18.0.1004.g6639190530 > -- Brandon Williams

Re: [PATCH 00/24] Kill the_index part3

2018-08-13 Thread Brandon Williams
the approach this series took vs what your part 1 did so that we can get this change in. -- Brandon Williams

Re: [PATCH v3 3/7] t7411: be nicer to future tests and really clean things up

2018-08-14 Thread Brandon Williams
bmodule lets continue' ' > HEAD b \ > HEAD submodule \ > >actual && > - test_cmp expect_error actual && > - git reset --hard HEAD^ > + test_cmp expect_error actual > ) > ' > > -- > 2.18.0 > -- Brandon Williams

Re: [PATCH v3 4/7] submodule--helper: add a new 'config' subcommand

2018-08-14 Thread Brandon Williams
quot; >expected && > + git submodule--helper config submodule.submodule.url "new_url" > && > + git submodule--helper config submodule.submodule.url >actual && > + test_cmp expected actual > + ) > +' > + > +test_expect_success 'overwriting unstaged submodules config with > "submodule--helper config"' ' > + (cd super && > + echo "newer_url" >expected && > + git submodule--helper config submodule.submodule.url > "newer_url" && > + git submodule--helper config submodule.submodule.url >actual && > + test_cmp expected actual > + ) > +' > + > test_done > -- > 2.18.0 > -- Brandon Williams

Re: [PATCH v3 5/7] submodule: use the 'submodule--helper config' command

2018-08-14 Thread Brandon Williams
--helper config submodule."$sm_name".path "$sm_path" && > + git submodule--helper config submodule."$sm_name".url "$repo" && > if test -n "$branch" > then > - git config -f .gitmodules submodule."$sm_name".branch "$branch" > + git submodule--helper config submodule."$sm_name".branch > "$branch" > fi && > git add --force .gitmodules || > die "$(eval_gettext "Failed to register submodule '\$sm_path'")" > -- > 2.18.0 > -- Brandon Williams

Re: [PATCH v3 7/7] submodule: support reading .gitmodules even when it's not checked out

2018-08-14 Thread Brandon Williams
rl newurl > + ) > +' > + > +test_expect_success 'initialising submodule when the gitmodules config is > not checked out' ' > + (cd super && > + git submodule init > + ) > +' > + > +test_expect_success 'showing submodule summary when the gitmodules config is > not checked out' ' > + (cd super && > + git submodule summary > + ) > +' > + > +test_expect_success 'updating submodule when the gitmodules config is not > checked out' ' > + (cd submodule && > + echo file2 >file2 && > + git add file2 && > + git commit -m "add file2 to submodule" > + ) && > + (cd super && > + git submodule update > + ) > +' > + > +test_expect_success 'not adding submodules when the gitmodules config is not > checked out' ' > + (cd super && > + test_must_fail git submodule add ../new_submodule > + ) > +' > + > +# This test checks that the previous "git submodule add" did not leave the > +# repository in a spurious state when it failed. > +test_expect_success 'init submodule still works even after the previous add > failed' ' > + (cd super && > + git submodule init > + ) > +' > + > +test_done > -- > 2.18.0 > -- Brandon Williams

Re: [PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-14 Thread Brandon Williams
On 08/09, Jeff King wrote: > On Wed, Aug 08, 2018 at 03:33:23PM -0700, Brandon Williams wrote: > > > Commit 0383bbb901 (submodule-config: verify submodule names as paths, > > 2018-04-30) introduced some checks to ensure that submodule names don't > > include direct

Re: Syncing HEAD

2018-08-14 Thread Brandon Williams
-submodules file://... > > might clone the submodules that are in detached HEAD, which is totally > not a long term viable good HEAD, so a subsequent fetch might want > to change the detached HEAD in submodules or re-affix it to branches. > > Unrelated/extended: I think it would be cool to mirror a repository even > more, e.g. it would be cool to be able to fetch (if configured as allowed) > the remote reflog, (not to be confused with you local reflog of the remote). > I think that work would be enabled once reftables are available, which you > have an eye on? -- Brandon Williams

Re: [PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-16 Thread Brandon Williams
> >> > >> Sane? Seems like a sensible thing to do. Let me work up some patches to implement this using config primarily and these other schemes as fallbacks. > > > > I'll keep thinking about it. > > Thanks. > > > FYI: the reduction in configuration was just sent out. > > https://public-inbox.org/git/20180816023100.161626-1-sbel...@google.com/ > for those following along. > > Ciao, > Jonathan -- Brandon Williams

[PATCH] submodule: add config for where gitdirs are located

2018-08-16 Thread Brandon Williams
Introduce the config "submodule..gitdirpath" which is used to indicate where a submodule's gitdir is located inside of a repository's "modules" directory. Signed-off-by: Brandon Williams --- Maybe something like this on top? Do you think we should disallow "

Re: [PATCH 2/2] submodule: munge paths to submodule git directories

2018-08-29 Thread Brandon Williams
t; > time is probably now. > > > > Have we rejected the config approach? > > I did not reject that approach, but am rather waiting for patches. ;-) Note I did send out a patch using this approach, so no need to wait any longer! :D https://public-inbox.org/git/20180816181940.46114-1-bmw...@google.com/ -- Brandon Williams

Re: [RFC PATCH 3/3] grep: don't add submodules to the alternates list

2019-09-21 Thread Brandon Williams
On Tue, Sep 17, 2019 at 6:56 PM Matheus Tavares wrote: > > When grepping with --recurse-submodules, the object directory of the > submodule is added to the in-memory alternates list. This makes git need > to watch out for more packfiles which might bring bad consequences for > memory and performan

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

2018-03-12 Thread Brandon Williams
On 03/01, Junio C Hamano wrote: > Brandon Williams writes: > > > +enum packet_read_status packet_reader_read(struct packet_reader *reader) > > +{ > > + if (reader->line_peeked) { > > + reader->line_peeked = 0; > > + return read

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

2018-03-12 Thread Brandon Williams
On 03/01, Junio C Hamano wrote: > Brandon Williams writes: > > > Documentation/technical/protocol-v2.txt | 171 > > Unlike other things in Documentation/technical/, this is not listed > on TECH_DOCS list in Documentation/Makefile. Shouldn't it be? Ye

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

2018-03-12 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > > diff --git a/builtin/fetch.c b/builtin/fetch.c > > index 850382f55..695fafe06 100644 > > --- a/builtin/fetch.c > > +++ b/builtin/fetch.c > > @@ -332,11 +332,25 @@ static struct ref *get_ref_

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

2018-03-12 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > > 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

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

2018-03-12 Thread Brandon Williams
On 03/01, Junio C Hamano wrote: > Brandon Williams writes: > > > 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 easi

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

2018-03-12 Thread Brandon Williams
On 03/12, Brandon Williams wrote: > On 03/01, Junio C Hamano wrote: > > Brandon Williams writes: > > > > > Factor out the logic for processing shallow, deepen, deepen_since, and > > > deepen_not lines into their own functions to simplify the > > > '

Re: Git Merge contributor summit notes

2018-03-12 Thread Brandon Williams
supporting it). > > I do agree we should have _something_ that is easy to spin up. But it > would be wonderful if git-over-http could become that, and we could just > deprecate git://. I suppose it's possible people build clients without > curl, but I suspect that's an extreme minority these days (most third > party hosters don't seem to offer git:// at all). > > -Peff -- Brandon Williams

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

2018-03-13 Thread Brandon Williams
On 03/13, Jonathan Tan wrote: > On Wed, 28 Feb 2018 15:22:21 -0800 > Brandon Williams wrote: > > > In order to allow for code sharing with the server-side of fetch in > > protocol-v2 convert upload-pack to be a builtin. > > > > Signed-off-by: Brandon Willia

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

2018-03-13 Thread Brandon Williams
On 03/13, Jonathan Tan wrote: > On Wed, 28 Feb 2018 15:22:18 -0800 > Brandon Williams wrote: > > > + if (len < 0) { > > die("protocol error: bad line length character: %.4s", linelen); > > - if (!len) { > > + } else if (!le

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

2018-03-13 Thread Brandon Williams
On 03/05, Jeff King wrote: > On Mon, Mar 05, 2018 at 10:21:55AM -0800, Brandon Williams wrote: > > > > Hmm, so this would accept stuff like "refs/heads/*/foo" but quietly > > > ignore the "/foo" part. > > > > Yeah that's true...t

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

2018-03-13 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > > + ls-refs > > +- > > + > > +`ls-refs` is the command used to request a reference advertisement in v2. > > +Unlike the current reference advertisement, ls-refs takes in arguments > >

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

2018-03-13 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > +static int is_command(const char *key, struct protocol_capability > > **command) > > +{ > > + const char *out; > > + > > + if (skip_prefix(key, "command=", &ou

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

2018-03-13 Thread Brandon Williams
On 03/02, Junio C Hamano wrote: > Brandon Williams writes: > > > + Capabilities > > +~~ > > + > > +There are two different types of capabilities: normal capabilities, > > +which can be used to to convey information or alter the behavior of a >

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

2018-03-13 Thread Brandon Williams
On 03/13, Jonathan Tan wrote: > On Wed, 28 Feb 2018 15:22:37 -0800 > Brandon Williams wrote: > > > +output = *section > > +section = (acknowledgments | packfile) > > + (flush-pkt | delim-pkt) > > + > > +acknowle

Re: [PATCH v4 27/35] transport-helper: introduce stateless-connect

2018-03-14 Thread Brandon Williams
On 03/13, Jonathan Tan wrote: > On Wed, 28 Feb 2018 15:22:44 -0800 > Brandon Williams wrote: > > > +'stateless-connect':: > > + Experimental; for internal use only. > > + Can attempt to connect to a remote server for communication > > +

[PATCH v5 00/35] protocol version 2

2018-03-14 Thread Brandon Williams
1-bmw...@google.com/ Brandon Williams (35): pkt-line: introduce packet_read_with_status pkt-line: allow peeking a packet line without consuming it pkt-line: add delim packet support upload-pack: convert to a builtin upload-pack: factor out processing lines transport: use get_refs_via_conne

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

2018-03-14 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 | 50 +

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

2018-03-14 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 | 51 +-- pkt-line.h | 16

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

2018-03-14 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 | 16 pkt-line.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/pkt-line.c b/pkt-li

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

2018-03-14 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 v5 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-03-14 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 v5 11/35] test-pkt-line: introduce a packet-line test helper

2018-03-14 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 v5 10/35] protocol: introduce enum protocol_version value protocol_v2

2018-03-14 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 v5 12/35] serve: introduce git-serve

2018-03-14 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/Makefile | 1 + Documentation/tech

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

2018-03-14 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 v5 13/35] ls-refs: introduce ls-refs server command

2018-03-14 Thread Brandon Williams
based on provided ref-prefixes. Signed-off-by: Brandon Williams --- Documentation/technical/protocol-v2.txt | 31 +++ Makefile| 1 + ls-refs.c | 96 ls-refs.h | 10

[PATCH v5 18/35] fetch: pass ref prefixes when fetching

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

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

2018-03-14 Thread Brandon Williams
Construct an argv_array of ref prefixes based on the patterns supplied via the command line and pass them to 'transport_get_remote_refs()' to be used when communicating protocol v2 so that the server can limit the ref advertisement based on those prefixes. Signed-off-by: Brando

[PATCH v5 22/35] fetch-pack: support shallow requests

2018-03-14 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 v5 19/35] push: pass ref prefixes when pushing

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

[PATCH v5 26/35] transport-helper: refactor process_connect_service

2018-03-14 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 v5 21/35] fetch-pack: perform a fetch using v2

2018-03-14 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 v5 27/35] transport-helper: introduce stateless-connect

2018-03-14 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 v5 28/35] pkt-line: add packet_buf_write_len function

2018-03-14 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 v5 31/35] http: allow providing extra headers for http requests

2018-03-14 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 5977712712..e1757d62b2 100644 --- a/http.c +++ b/http.c

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

2018-03-14 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 v5 29/35] remote-curl: create copy of the service name

2018-03-14 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 v5 33/35] http: eliminate "# service" line when using protocol v2

2018-03-14 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 v5 34/35] remote-curl: implement stateless-connect command

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

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

2018-03-14 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 v5 23/35] connect: refactor git_connect to only get the protocol version once

2018-03-14 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 v5 25/35] transport-helper: remove name parameter

2018-03-14 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/tra

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

2018-03-14 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 v5 24/35] connect: don't request v2 when pushing

2018-03-14 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 v5 20/35] upload-pack: introduce fetch server command

2018-03-14 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 v5 15/35] transport: convert get_refs_list to take a list of ref prefixes

2018-03-14 Thread Brandon Williams
fs it sends based on the sent prefixes. This list will be ignored when not using protocol v2. Signed-off-by: Brandon Williams --- transport-helper.c | 5 +++-- transport-internal.h | 11 ++- transport.c | 18 +++--- 3 files changed, 24 insertions(+), 10 deleti

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

2018-03-14 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 63c3dbab94..2378dcb38c 100644 --- a/transport.c +++ b/transport.c @@ -118,6 +118,7 @@ struct git_transport_data {

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

2018-03-14 Thread Brandon Williams
Teach transport_get_remote_refs() to accept a list of ref prefixes, which will be sent to the server for use in filtering when using protocol v2. (This list will be ignored when not using protocol v2.) Signed-off-by: Brandon Williams --- builtin/clone.c | 2 +- builtin/fetch.c | 4

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

2018-03-14 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 v5 08/35] connect: discover protocol version outside of get_remote_heads

2018-03-14 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 v5 06/35] transport: use get_refs_via_connect to get refs

2018-03-14 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

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

2018-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams writes: > > > Introduce git-serve, the base server for protocol version 2. > > ... > > Documentation/Makefile | 1 + > > Documentation/technical/protocol-v2.txt | 174 + > &

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

2018-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams writes: > > > +/* > > + * Read a packetized line into a buffer like the 'packet_read()' function > > but > > + * returns an 'enum packet_read_status' which indicates the status of the

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

2018-03-15 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 | 51 +-- pkt-line.h | 16

[PATCH v6 00/35] protocol version 2

2018-03-15 Thread Brandon Williams
Fixed the protocol-v2.txt technical document so that it builds when running "make doc". Brandon Williams (35): pkt-line: introduce packet_read_with_status pkt-line: allow peeking a packet line without consuming it pkt-line: add delim packet support upload-pack: convert to

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

2018-03-15 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 v6 02/35] pkt-line: allow peeking a packet line without consuming it

2018-03-15 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 | 50 +

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

2018-03-15 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 v6 08/35] connect: discover protocol version outside of get_remote_heads

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

2018-03-15 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 | 16 pkt-line.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/pkt-line.c b/pkt-li

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