Re: [PATCH 0/7] Restrict the usage of config_from_gitmodules()

2018-06-22 Thread Brandon Williams
lace to read the .gitmodules file from other places (not just in the worktree). As you've mentioned here I also agree we could do without the last patch but I'll leave that up to you. Other than a couple typos I found I think this series looks good! Thanks again for revisiting this. -- Brandon Williams

Re: [PATCH 7/7] submodule-config: cleanup backward compatibility helpers

2018-06-22 Thread Brandon Williams
.fetchjobs = max_jobs, + .recurse_submodules = NULL, + }; + config_from_gitmodules(gitmodules_fetch_clone_config, the_repository, + ); } -- Brandon Williams

Re: [PATCH 6/7] submodule-config: reuse config_from_gitmodules in repo_read_gitmodules

2018-06-22 Thread Brandon Williams
t; - * > - * Runs the provided config function on the '.gitmodules' file found in the > - * working directory. > - */ > -static void config_from_gitmodules(config_fn_t fn, struct repository *repo, > void *data) > -{ > - if (repo->worktree) { > - char *file = repo_worktree_path(repo, GITMODULES_FILE); > - git_config_from_file(fn, file, data); > - free(file); > - } > -} > - > struct fetch_config { > int *max_children; > int *recurse_submodules; > -- > 2.18.0 > -- Brandon Williams

Re: [PATCH 3/7] submodule-config: add helper to get 'update-clone' config from .gitmodules

2018-06-22 Thread Brandon Williams
from_gitmodules' for > options not strictly related to submodules: "submodule.fetchobjs" does s/fetchobjs/fetchjobs -- Brandon Williams

Re: [PATCH 2/7] submodule-config: add helper function to get 'fetch' config from .gitmodules

2018-06-22 Thread Brandon Williams
odules) = > parse_fetch_recurse_submodules_arg(var, value); There shouldn't be a space before "->" in this line. -- Brandon Williams

[PATCH v2] docs: link to gitsubmodules

2018-06-20 Thread Brandon Williams
Add a link to gitsubmodules(7) under the `submodule.active` entry in git-config(1). Signed-off-by: Brandon Williams --- Documentation/config.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index ab641bf5a

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

2018-06-20 Thread Brandon Williams
Implement ref-in-want on the client side so that when a server supports the "ref-in-want" feature, a client will send "want-ref" lines for each reference the client wants to fetch. Signed-off-by: Brandon Williams --- fetch-pack.c

[PATCH v3 7/8] fetch-pack: put shallow info in output parameter

2018-06-20 Thread Brandon Williams
to sometimes generate the ref map twice: once from the list of refs provided by the remote (as is currently done) and potentially once from the new list of refs that the fetch mechanism provides. Signed-off-by: Brandon Williams --- builtin/clone.c | 4 ++-- builtin/fetch.c | 28

[PATCH v3 0/8] ref-in-want

2018-06-20 Thread Brandon Williams
hard error on the server. I went back and forth many times on what the right thing to do here is and decided that a hard error works much cleaner for the time being. * Some typos. Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want u

[PATCH v3 6/8] fetch: refactor to make function args narrower

2018-06-20 Thread Brandon Williams
struct. Signed-off-by: Brandon Williams --- builtin/fetch.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index ee8b87c78..b600e1f10 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c

[PATCH v3 2/8] upload-pack: implement ref-in-want

2018-06-20 Thread Brandon Williams
through a new "want-ref " parameter. At the conclusion of negotiation, the server will send a list of all of the wanted references (as provided by "want-ref" lines) in addition to the generated packfile. Signed-off-by: Brandon Williams --- Documentation/config.txt

[PATCH v3 4/8] fetch: refactor the population of peer ref OIDs

2018-06-20 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36

[PATCH v3 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-20 Thread Brandon Williams
Add an 'unpack-sideband' subcommand to the test-pkt-line helper to enable unpacking packet line data sent multiplexed using a sideband. Signed-off-by: Brandon Williams --- t/helper/test-pkt-line.c | 33 + 1 file changed, 33 insertions(+) diff --git a/t/helper

[PATCH v3 5/8] fetch: refactor fetch_refs into two functions

2018-06-20 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

[PATCH v3 3/8] upload-pack: test negotiation with changing repository

2018-06-20 Thread Brandon Williams
(which will be introduced to the client in subsequent commits), and ensures that subsequent commits do not change existing behavior. As part of this effort, a mechanism to substitute strings in a single HTTP response is added. Signed-off-by: Brandon Williams --- t/lib-httpd.sh

Re: [PATCH 0/8] ref-in-want

2018-06-19 Thread Brandon Williams
eries did and have it be a hard error? I've gone back and forth on what I think we should do so I'd like to hear at least one more opinion :) -- Brandon Williams

Re: [PATCH v2 2/8] upload-pack: implement ref-in-want

2018-06-19 Thread Brandon Williams
On 06/19, Junio C Hamano wrote: > Brandon Williams writes: > > > I also think that we should keep this first implementation of > > ref-in-want simple and *not* include patterns, even if that's what we > > may want someday down the road. Adding a new capability in th

Re: [PATCH v2 2/8] upload-pack: implement ref-in-want

2018-06-19 Thread Brandon Williams
ags when all we really wanted was to get the one or two new tags which are present on the remote (because we already have all the other tags present locally). So I think the best way is to limit these patterns to the ls-refs request where we can then discover the few tags we're missing and then request just those tags explicitly, keeping the resulting packfile smaller. Thoughts? -- Brandon Williams

Re: [PATCH v2 7/8] fetch-pack: put shallow info in output parameter

2018-06-19 Thread Brandon Williams
> > if (status[i]) > > - sought[i]->status = REF_STATUS_REJECT_SHALLOW; > > + r->status = REF_STATUS_REJECT_SHALLOW; > > You use i here without initializing it to 0. t5703 also fails with this > patch - probably related to this, but I didn't check. Oh yeah that's definitely a bug, thanks for catching that. > > If you initialize i here, I don't think you need to initialize it to 0 > at the top of this function. -- Brandon Williams

Re: [PATCH 0/8] ref-in-want

2018-06-19 Thread Brandon Williams
th the shallow features and later capabilities were added to add different ways to request shallow fetches. That being said, if we find that this feature doesn't work as-is and needs the extra complexity of patterns from the start then they should be added. But it doesn't seem like there's a concrete reason at the moment. -- Brandon Williams

Re: [PATCH v2 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

2018-06-18 Thread Brandon Williams
nted (i.e. when is the user least > > surprised that we do not tag-follow all and unconditionally)? > > It's documented under the --no-tags option in the man page for git > fetch. I'm not sure what you mean by the user being surprised. -- Brandon Williams

Re: [PATCH 15/15] cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch

2018-06-18 Thread Brandon Williams
athspec.c > index 27cd606786..6997707477 100644 > --- a/pathspec.c > +++ b/pathspec.c > @@ -1,4 +1,3 @@ > -#define NO_THE_INDEX_COMPATIBILITY_MACROS > #include "cache.h" > #include "config.h" > #include "dir.h" > diff --git a/read-cache.c b/read-cache.c > index 372588260e..2a84ad0797 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -3,7 +3,6 @@ > * > * Copyright (C) Linus Torvalds, 2005 > */ > -#define NO_THE_INDEX_COMPATIBILITY_MACROS > #include "cache.h" > #include "config.h" > #include "tempfile.h" > diff --git a/submodule.c b/submodule.c > index 939d6870ec..c6ae29379d 100644 > --- a/submodule.c > +++ b/submodule.c > @@ -1,4 +1,3 @@ > -#define NO_THE_INDEX_COMPATIBILITY_MACROS > > #include "cache.h" > #include "repository.h" > diff --git a/t/helper/test-dump-untracked-cache.c > b/t/helper/test-dump-untracked-cache.c > index bd92fb305a..56a5ce8abb 100644 > --- a/t/helper/test-dump-untracked-cache.c > +++ b/t/helper/test-dump-untracked-cache.c > @@ -1,3 +1,4 @@ > +#define USE_THE_INDEX_COMPATIBILITY_MACROS > #include "cache.h" > #include "dir.h" > > diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h > index 7116ddfb94..a7ff69e9f3 100644 > --- a/t/helper/test-tool.h > +++ b/t/helper/test-tool.h > @@ -1,6 +1,8 @@ > #ifndef __TEST_TOOL_H__ > #define __TEST_TOOL_H__ > > +#define USE_THE_INDEX_COMPATIBILITY_MACROS > + > int cmd__chmtime(int argc, const char **argv); > int cmd__config(int argc, const char **argv); > int cmd__ctype(int argc, const char **argv); > diff --git a/tree.c b/tree.c > index 244eb5e665..b5ed7bc22b 100644 > --- a/tree.c > +++ b/tree.c > @@ -1,4 +1,3 @@ > -#define NO_THE_INDEX_COMPATIBILITY_MACROS > #include "cache.h" > #include "cache-tree.h" > #include "tree.h" > diff --git a/unpack-trees.c b/unpack-trees.c > index 3a85a02a77..fd09e812a2 100644 > --- a/unpack-trees.c > +++ b/unpack-trees.c > @@ -1,4 +1,3 @@ > -#define NO_THE_INDEX_COMPATIBILITY_MACROS > #include "cache.h" > #include "argv-array.h" > #include "repository.h" > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH 00/15] Kill the_index part 1, expose it

2018-06-18 Thread Brandon Williams
go down rabbit holes. First Stefan with the object store refactoring and now you with the index stuff. All because I wanted git to be more object oriented and have less global state ;) -- Brandon Williams

Re: Adding nested repository with slash adds files instead of gitlink

2018-06-18 Thread Brandon Williams
pec.c, which has > been replaced with something else in bw/pathspec-sans-the-index. If > you have time, try a version without those changes (e.g. v2.13 or > before) to see if it's a possible culprit. I just tested this with v2.13 and saw the same issue. I don't actually think this ever worked in the way you want it to Heiko. Maybe git add needs to be taught to be more intelligent when trying to add a submodule which doesn't exist in the index. -- Brandon Williams

Re: [PATCH v2 0/8] ref-in-want

2018-06-18 Thread Brandon Williams
On 06/15, Junio C Hamano wrote: > Brandon Williams writes: > > > Changes in v2: > > * issuing a want-ref line to a ref which doesn't exist is just ignored. > > * fixed some typos > > Do I lock some (logical) prerequisite changes? On 2.18-rc2 they > apply cle

Re: [PATCH 10/35] commit: add repository argument to lookup_commit

2018-06-14 Thread Brandon Williams
'struct index_state *' throughout library code, and sometimes I pass > > 'struct repository *' instead when I see that code uses more things > > that just the index. And I have started to replace the_repository in > > some places with a function argument. > > > > If some of my patches come first while you have not finished > > repository conversion (very likely), you and I will have to pay > > attention to this more often. -- Brandon Williams

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

2018-06-14 Thread Brandon Williams
On 06/14, Stefan Beller wrote: > On Wed, Jun 13, 2018 at 2:39 PM Brandon Williams wrote: > > > +static void receive_wanted_refs(struct packet_reader *reader, struct ref > > *refs) > > +{ > ... > > + > > + for (r = refs; r; r = r->next) { &

Re: [PATCH v2 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-14 Thread Brandon Williams
On 06/14, Stefan Beller wrote: > On Wed, Jun 13, 2018 at 2:39 PM Brandon Williams wrote: > > > > Add an 'unpack-sideband' subcommand to the test-pkt-line helper to > > enable unpacking packet line data sent multiplexed using a sideband. > > > > Signed-off-by:

Re: [PATCH v2 2/8] upload-pack: implement ref-in-want

2018-06-14 Thread Brandon Williams
On 06/14, Stefan Beller wrote: > Hi Brandon, > On Wed, Jun 13, 2018 at 2:39 PM Brandon Williams wrote: > > negotiation, which may happen if, for example, the desired repository is > > provided by multiple Git servers in a load-balancing arrangement. > > ... and the repo

Re: [PATCH v2 00/31] object-store: lookup_commit

2018-06-14 Thread Brandon Williams
it looks good. I'm glad we're getting closer to this set of series being completed. Thanks for pushing this through :) -- Brandon Williams

Re: [PATCH v2 8/8] negotiator/default: use better style in comments

2018-06-14 Thread Brandon Williams
et the next rev to send, ignoring the common. > -*/ > - > + * Get the next rev to send, ignoring the common. > + */ > static const struct object_id *get_rev(struct data *data) > { > struct commit *commit = NULL; > -- > 2.17.0.768.g1526ddbba1.dirty > Don't have this be a separate patch, squash it into the previous patch. -- Brandon Williams

Re: [PATCH v2 5/8] fetch-pack: make negotiation-related vars local

2018-06-14 Thread Brandon Williams
mark_complete_and_common_ref(, args, ); > filter_refs(args, , sought, nr_sought); > if (everything_local(args, )) > state = FETCH_DONE; > else > state = FETCH_SEND_REQUEST; > > - for_each_ref(rev_list_insert_ref_oid, NULL); > - for_each_cached_alternate(insert_one_alternate_object); > + for_each_ref(rev_list_insert_ref_oid, ); > + for_each_cached_alternate(, > + insert_one_alternate_object); > break; > case FETCH_SEND_REQUEST: > - if (send_fetch_request(fd[1], args, ref, , > + if (send_fetch_request(, fd[1], args, ref, , > _to_send, _vain)) > state = FETCH_GET_PACK; > else > @@ -1411,7 +1425,7 @@ static struct ref *do_fetch_pack_v2(struct > fetch_pack_args *args, > break; > case FETCH_PROCESS_ACKS: > /* Process ACKs/NAKs */ > - switch (process_acks(, )) { > + switch (process_acks(, , )) { > case 2: > state = FETCH_GET_PACK; > break; > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH v2 3/8] fetch-pack: directly end negotiation if ACK ready

2018-06-14 Thread Brandon Williams
On 06/14, Brandon Williams wrote: > On 06/06, Jonathan Tan wrote: > > When "ACK %s ready" is received, find_common() clears rev_list in an > > attempt to stop further "have" lines from being sent [1]. It is much > > more readable to expl

Re: [PATCH v2 4/8] fetch-pack: use ref adv. to prune "have" sent

2018-06-14 Thread Brandon Williams
otocol v0, then everything_local() would enqueue it with > COMMON_REF | SEEN. The addition of COMMON_REF ensures that its parents > are not sent as "have" lines. > > Change the order in do_fetch_pack_v2() to be consistent with > do_fetch_pack(), and to avoid sending unnecessary "have" lines. > > Signed-off-by: Jonathan Tan > --- -- Brandon Williams

Re: [PATCH v2 3/8] fetch-pack: directly end negotiation if ACK ready

2018-06-14 Thread Brandon Williams
> } > done: > @@ -1300,7 +1300,6 @@ static int process_acks(struct packet_reader *reader, > struct oidset *common) > } > > if (!strcmp(reader->line, "ready")) { > - clear_prio_queue(_list); > received_ready = 1; > continue; > } > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH v2 1/8] fetch-pack: split up everything_local()

2018-06-14 Thread Brandon Williams
h_cached_alternate(insert_one_alternate_object); > > /* Filter 'ref' by 'sought' and those that aren't local > */ > - if (everything_local(args, , sought, nr_sought)) > + mark_complete_and_common_ref(args, ); > + filter_refs(args, , sought, nr_sought); > + if (everything_local(args, )) > state = FETCH_DONE; > else > state = FETCH_SEND_REQUEST; > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

[PATCH v2 6/8] fetch: refactor to make function args narrower

2018-06-13 Thread Brandon Williams
struct. Signed-off-by: Brandon Williams --- builtin/fetch.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index ee8b87c78..b600e1f10 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c

[PATCH v2 2/8] upload-pack: implement ref-in-want

2018-06-13 Thread Brandon Williams
parameter. At the conclusion of negotiation, the server will send a list of all of the wanted references (as provided by "want-ref" lines) in addition to the generated packfile. Signed-off-by: Brandon Williams --- Documentation/config.txt| 7 ++ Documentation/technical/p

[PATCH v2 7/8] fetch-pack: put shallow info in output parameter

2018-06-13 Thread Brandon Williams
to sometimes generate the ref map twice: once from the list of refs provided by the remote (as is currently done) and potentially once from the new list of refs that the fetch mechanism provides. Signed-off-by: Brandon Williams --- builtin/clone.c | 4 ++-- builtin/fetch.c | 23

[PATCH v2 5/8] fetch: refactor fetch_refs into two functions

2018-06-13 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

[PATCH v2 3/8] upload-pack: test negotiation with changing repository

2018-06-13 Thread Brandon Williams
(which will be introduced to the client in subsequent commits), and ensures that subsequent commits do not change existing behavior. As part of this effort, a mechanism to substitute strings in a single HTTP response is added. Signed-off-by: Brandon Williams --- t/lib-httpd.sh

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

2018-06-13 Thread Brandon Williams
Implement ref-in-want on the client side so that when a server supports the "ref-in-want" feature, a client will send "want-ref" lines for each reference the client wants to fetch. Signed-off-by: Brandon Williams --- fetch-pack.c

[PATCH v2 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-13 Thread Brandon Williams
Add an 'unpack-sideband' subcommand to the test-pkt-line helper to enable unpacking packet line data sent multiplexed using a sideband. Signed-off-by: Brandon Williams --- t/helper/test-pkt-line.c | 37 + 1 file changed, 37 insertions(+) diff --git a/t

[PATCH v2 4/8] fetch: refactor the population of peer ref OIDs

2018-06-13 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36

[PATCH v2 0/8] ref-in-want

2018-06-13 Thread Brandon Williams
Changes in v2: * issuing a want-ref line to a ref which doesn't exist is just ignored. * fixed some typos Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test negotiation with changing repository fetch: refactor

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/07, Ævar Arnfjörð Bjarmason wrote: > > On Wed, Jun 06 2018, Brandon Williams wrote: > > > On 06/05, Ævar Arnfjörð Bjarmason wrote: > >> > >> On Tue, Jun 05 2018, Brandon Williams wrote: > >> > >> > +uploadpack.allowRefInWant

Re: [PATCH 2/8] upload-pack: implement ref-in-want

2018-06-06 Thread Brandon Williams
On 06/05, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jun 05 2018, Brandon Williams wrote: > > > +uploadpack.allowRefInWant:: > > + If this option is set, `upload-pack` will support the `ref-in-want` > > + feature of the protocol version 2 `fetch` command. > &

Re: [PATCH v3 17/20] cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
t; + struct cache_entry *ce, > + unsigned int options) > { > - return refresh_cache_ent(_index, ce, options, NULL, NULL); > + return refresh_cache_ent(istate, ce, options, NULL, NULL); > } > > > diff --git a/resolve-undo.c b/resolve-undo.c > index 5e4c8c5f75..9c45fe5d1d 100644 > --- a/resolve-undo.c > +++ b/resolve-undo.c > @@ -146,7 +146,7 @@ int unmerge_index_entry_at(struct index_state *istate, > int pos) > struct cache_entry *nce; > if (!ru->mode[i]) > continue; > - nce = make_cache_entry(ru->mode[i], ru->oid[i].hash, > + nce = make_cache_entry(_index, ru->mode[i], ru->oid[i].hash, > name, i + 1, 0); > if (matched) > nce->ce_flags |= CE_MATCHED; > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Duy Nguyen wrote: > On Wed, Jun 6, 2018 at 6:50 PM, Brandon Williams wrote: > > On 06/06, Nguyễn Thái Ngọc Duy wrote: > >> Make the attr API take an index_state instead of assuming the_index in > >> attr code. All call sites are converted blindly to keep the p

Re: [PATCH v3 15/20] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Brandon Williams
t;update && !o->dry_run) > load_gitmodules_file(index, NULL); > @@ -421,7 +421,7 @@ static int check_updates(struct unpack_trees_options *o) > stop_progress(); > errs |= finish_delayed_checkout(); > if (o->update) > - git_attr_set_direction(GIT_ATTR_CHECKIN, NULL); > + git_attr_set_direction(GIT_ATTR_CHECKIN); > return errs != 0; > } > > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
> if (!check) > check = attr_check_initl("conflict-marker-size", NULL); > - if (!git_check_attr(path, check) && check->items[0].value) { > + if (!git_check_attr(_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 a69241b25d..e835e78dd5 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(_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(_index, pathname, attr_whitespace_rule)) { > const char *value; > > value = attr_whitespace_rule->items[0].value; > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

2018-06-05 Thread Brandon Williams
ref-prefix to_fetch" trace && > + grep "fetch> ref-prefix refs/tags/" trace && > + grep "fetch> include-tag" trace && > + > + git -C client cat-file -e $(git -C client rev-parse annotated_tag) > +' > + > # Test protocol v2 with 'http://' transport > # > . "$TEST_DIRECTORY"/lib-httpd.sh > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs

2018-06-05 Thread Brandon Williams
rver" to_fetch:to_fetch && > + > + grep "fetch> ref-prefix to_fetch" trace && > + grep "fetch> ref-prefix refs/tags/" trace && > + grep "fetch> include-tag" trace && > + > + git -C client cat-file -e $(git -C client rev-parse annotated_tag) > +' > + > # Test protocol v2 with 'http://' transport > # > . "$TEST_DIRECTORY"/lib-httpd.sh > -- > 2.17.0.768.g1526ddbba1.dirty > -- Brandon Williams

Re: [PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
submodule.active:: > A repeated field which contains a pathspec used to match against a > submodule's path to determine if the submodule is of interest to git > - commands. See linkgit:git-submodule[1] for details. > + commands. See linkgit:gitsubmodules[7] for details. > > submodule.recurse:: > Specifies if commands recurse into submodules by default. This Yep this is what I meant. -- Brandon Williams

Re: [PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
On 06/05, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jun 05 2018, Brandon Williams wrote: > > > Add a link to gitsubmodules(7) under the `submodule.active` entry in > > git-config(1). > > Did you mean to change either the subject or content of this patch? Your >

[PATCH] docs: link to gitsubmodules

2018-06-05 Thread Brandon Williams
Add a link to gitsubmodules(7) under the `submodule.active` entry in git-config(1). Signed-off-by: Brandon Williams --- Documentation/config.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index ab641bf5a

Re: [PATCH 0/3] refspec: refactor & fix free() behavior

2018-06-05 Thread Brandon Williams
l.c | 2 +- > refspec.c | 13 + > refspec.h | 5 - > 4 files changed, 15 insertions(+), 7 deletions(-) > > -- > 2.17.0.290.gded63e768a > -- Brandon Williams

[PATCH 2/8] upload-pack: implement ref-in-want

2018-06-05 Thread Brandon Williams
parameter. At the conclusion of negotiation, the server will send a list of all of the wanted references (as provided by "want-ref" lines) in addition to the generated packfile. Signed-off-by: Brandon Williams --- Documentation/config.txt| 4 + Documentation/technical/p

[PATCH 0/8] ref-in-want

2018-06-05 Thread Brandon Williams
full ref names are allowed instead of globs and OIDs), but it is meant to accomplish the same goal (solve the issues of refs changing during negotiation). Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test negotiation

[PATCH 1/8] test-pkt-line: add unpack-sideband subcommand

2018-06-05 Thread Brandon Williams
Add an 'unpack-sideband' subcommand to the test-pkt-line helper to enable unpacking packet line data sent multiplexed using a sideband. Signed-off-by: Brandon Williams --- t/helper/test-pkt-line.c | 37 + 1 file changed, 37 insertions(+) diff --git a/t

[PATCH 5/8] fetch: refactor fetch_refs into two functions

2018-06-05 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. Signed-off-by: Brandon Williams --- builtin/fetch.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c

[PATCH 7/8] fetch-pack: put shallow info in output parameter

2018-06-05 Thread Brandon Williams
to sometimes generate the ref map twice: once from the list of refs provided by the remote (as is currently done) and potentially once from the new list of refs that the fetch mechanism provides. Signed-off-by: Brandon Williams --- builtin/clone.c | 4 ++-- builtin/fetch.c | 23

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

2018-06-05 Thread Brandon Williams
Implement ref-in-want on the client side so that when a server supports the "ref-in-want" feature, a client will send "want-ref" lines for each reference the client wants to fetch. Signed-off-by: Brandon Williams --- fetch-pack.c

[PATCH 6/8] fetch: refactor to make function args narrower

2018-06-05 Thread Brandon Williams
struct. Signed-off-by: Brandon Williams --- builtin/fetch.c | 52 - 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index ee8b87c78..b600e1f10 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c

[PATCH 3/8] upload-pack: test negotiation with changing repository

2018-06-05 Thread Brandon Williams
(which will be introduced to the client in subsequent commits), and ensures that subsequent commits do not change existing behavior. As part of this effort, a mechanism to substitute strings in a single HTTP response is added. Signed-off-by: Brandon Williams --- t/lib-httpd.sh

[PATCH 4/8] fetch: refactor the population of peer ref OIDs

2018-06-05 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36

Re: [PATCH 6/6] Forbid "the_index" in dir.c and unpack-trees.c

2018-06-05 Thread Brandon Williams
es.c > @@ -1,4 +1,6 @@ > #define NO_THE_INDEX_COMPATIBILITY_MACROS > +/* Do not use the_index here, you probably want o->src_index */ > +#define NO_GLOBAL_INDEX > #include "cache.h" > #include "argv-array.h" > #include "repository.h" > -- > 2.18.0.rc0.333.g22e6ee6cdf > -- Brandon Williams

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-05 Thread Brandon Williams
oid refspec_item_clear(struct refspec_item *item); > void refspec_init(struct refspec *rs, int fetch); > void refspec_append(struct refspec *rs, const char *refspec); > > I.e. let's fix the bug, but with this admittedly more verbose fix we're > left with exactly two memset() in refspec.c, one for each type of struct > that's initialized by the API. > > The reason this is difficult now is because the current API conflates > the init function with an init_or_die, which is what most callers want, > so let's just split those concerns up. Then we're left with one init > function that does the memset. -- Brandon Williams

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Brandon Williams
s) > int valid_fetch_refspec(const char *fetch_refspec_str) > { > struct refspec_item refspec; > - int ret = parse_refspec(, fetch_refspec_str, REFSPEC_FETCH); > + int ret; > + > + memset(, 0, sizeof(refspec)); > + ret = parse_refspec(, fetch_refspec_str, REFSPEC_FETCH); > refspec_item_clear(); > return ret; > } > -- > 2.18.0.rc0.43.gb85e7bcbff > -- Brandon Williams

Re: [PATCH/RFC/BUG] unpack-trees.c: do not use "the_index"

2018-06-04 Thread Brandon Williams
2018-04-23) and could > >>> potentially break things again... > > I'm pretty sure your patch is correct. Adding Brandon Williams to the > cc for comment since his patches came up in the analysis below... > > >> Actually, I don't think the patch will break anything in the

Re: [PATCH] fetch: do not pass ref-prefixes for fetch by exact SHA1

2018-05-31 Thread Brandon Williams
Thanks for finding this, I don't know how I missed moving that bit over when factoring it out. Well I guess I sort of rewrote it and combined two pieces of logic so that's how. Anyway, this looks right and thanks for adding the test. On Thu, May 31, 2018 at 12:23 AM, Jonathan Nieder wrote: >

Re: Is origin/HEAD only being created on clone a bug? #leftoverbits

2018-05-29 Thread Brandon Williams
mref locally which points at origin/master. This means that when you fetch origin/master, origin/HEAD will also but updated just because its locally a pointer to origin/master. With that said, yes we should probably fix this issue with fetch because I added symref support to protocol v2 so now symref information for refs other than HEAD can be sent across the wire but the client just throws that info away at the moment. -- Brandon Williams

[PATCH] config: document value 2 for protocol.version

2018-05-22 Thread Brandon Williams
Update the config documentation to note the value `2` as an acceptable value for the protocol.version config. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/config.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/config.txt b/Documentation/conf

[PATCH v2 1/2] remote-curl: accept all encodings supported by curl

2018-05-22 Thread Brandon Williams
ing to verify that it supports the a requested encoding, instead set the curl option `CURLOPT_ENCODING` with an empty string indicating that curl should send an "Accept-Encoding" header containing only the encodings supported by curl. Reported-by: Anton Golubev <anton.golu...@gmail.com> Sign

[PATCH v2 2/2] remote-curl: accept compressed responses with protocol v2

2018-05-22 Thread Brandon Williams
Configure curl to accept compressed responses when using protocol v2 by setting `CURLOPT_ENCODING` to "", which indicates that curl should send an "Accept-Encoding" header with all supported compression encodings. Signed-off-by: Brandon Williams <bmw...@google.com> -

Re: [PATCH 1/2] remote-curl: accept all encoding supported by curl

2018-05-22 Thread Brandon Williams
typically a HTTP client doesn't know which compression methods the > server offers. Not sure this is actually true to the same extent for git. > > -- > > / daniel.haxx.se -- Brandon Williams

[PATCH 2/2] remote-curl: accept compressed responses with protocol v2

2018-05-21 Thread Brandon Williams
Configure curl to accept compressed responses when using protocol v2 by setting `CURLOPT_ENCODING` to "", which indicates that curl should send an "Accept-Encoding" header with all supported compression encodings. Signed-off-by: Brandon Williams <bmw...@google.com> -

[PATCH 1/2] remote-curl: accept all encoding supported by curl

2018-05-21 Thread Brandon Williams
only the encoding methods curl supports. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 2 +- remote-curl.c | 2 +- t/t5551-http-fetch-smart.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http.c b/http

Re: [PATCH v2 02/18] Add a new builtin: branch-diff

2018-05-21 Thread Brandon Williams
the discussion but from what I can tell the point of this command is to generate a diff based on two different versions of a series, so why not call it 'series-diff'? :) -- Brandon Williams

Re: [PATCH 02/11] repository: introduce repo_read_index_or_die

2018-05-21 Thread Brandon Williams
> series as we want to move away from _die() in top level code but this > series moves more towards it. I've heard every once in a while that we want to move toward this but I don't believe there is an actual effort along those lines just yet. For that to be the case we would need a clearly defined error handling methodology (aside from the existing "die"ing behavior), which we don't currently have. > > I don't know. > > Stefan -- Brandon Williams

[PATCH 1/2] refspec: consolidate ref-prefix generation logic

2018-05-16 Thread Brandon Williams
) and is roughly the same so lets consolidate this logic and make it general enough that it can be used for both the push and fetch cases. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 13 + refspec.c | 29 + refspec.h

[PATCH 2/2] fetch: generate ref-prefixes when using a configured refspec

2018-05-16 Thread Brandon Williams
Teach fetch to generate ref-prefixes, to be used for server-side filtering of the ref-advertisement, based on the configured fetch refspec ('remote..fetch') when no user provided refspec exists. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c| 10 +++

[PATCH 0/2] generating ref-prefixes for configured refspecs

2018-05-16 Thread Brandon Williams
series extends this to generate the ref-prefixes even for the refspecs which are configured in 'remote..fetch'. This series is based on the v2 of the refspec refactoring series. Brandon Williams (2): refspec: consolidate ref-prefix generation logic fetch: generate ref-prefixes when using

[PATCH v2 08/36] transport: convert transport_push to use struct refspec

2018-05-16 Thread Brandon Williams
Convert the logic in 'transport_push()' which calculates a list of ref-prefixes to use 'struct refspec'. Signed-off-by: Brandon Williams <bmw...@google.com> --- transport.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/transport.c b/transport.c

[PATCH v2 22/36] fetch: convert prune_refs to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'prune_refs()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/builtin/fetch.c b/builtin/f

[PATCH v2 31/36] send-pack: store refspecs in a struct refspec

2018-05-16 Thread Brandon Williams
Convert send-pack.c to store refspecs in a 'struct refspec' instead of as an array of 'const char *'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/send-pack.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/builtin/send-pa

[PATCH v2 29/36] push: convert to use struct refspec

2018-05-16 Thread Brandon Williams
Convert the refspecs in builtin/push.c to be stored in a 'struct refspec' instead of being stored in a list of 'struct refspec_item's. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/push.c | 38 +++--- 1 file changed, 15 insertions(

[PATCH v2 23/36] remote: convert get_stale_heads to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'get_stale_heads()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 2 +- builtin/remote.c | 3 +-- remote.c | 18 +- remote.h | 2

[PATCH v2 36/36] submodule: convert push_unpushed_submodules to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'push_unpushed_submodules()' to take a 'struct refspec' as a parameter instead of an array of 'const char *'. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 19 +-- submodule.h | 3 ++- transport.c | 2 +- 3 files changed, 12 insertions(

[PATCH v2 33/36] http-push: store refspecs in a struct refspec

2018-05-16 Thread Brandon Williams
Convert http-push.c to store refspecs in a 'struct refspec' instead of in an array of 'const char *'. Signed-off-by: Brandon Williams <bmw...@google.com> --- http-push.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/http-push.c b/http-push.c

[PATCH v2 32/36] transport: remove transport_verify_remote_names

2018-05-16 Thread Brandon Williams
Remove 'transprot_verify_remote_names()' because all callers have migrated to using 'struct refspec' which performs the same checks in 'parse_refspec()'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/send-pack.c | 2 -- transport.c

[PATCH v2 30/36] transport: convert transport_push to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'transport_push()' to take a 'struct refspec' as a parameter instead of an array of strings which represent refspecs. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/push.c | 3 +-- transport.c| 17 +++-- transport.h| 2 +- 3 files chan

[PATCH v2 34/36] remote: convert match_push_refs to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'match_push_refs()' to take a 'struct refspec' as a parameter instead of an array of 'const char *'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/remote.c| 3 +-- builtin/send-pack.c | 2 +- http-push.c | 3 +-- remote.c

[PATCH v2 35/36] remote: convert check_push_refs to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'check_push_refs()' to take a 'struct refspec' as a parameter instead of an array of 'const char *'. Signed-off-by: Brandon Williams <bmw...@google.com> --- remote.c| 14 +- remote.h| 2 +- transport.c | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-)

[PATCH v2 25/36] remote: convert query_refspecs to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'query_refspecs()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/push.c | 3 +-- remote.c | 10 +- remote.h | 2 +- 3 files changed, 7 insertions(+), 8 del

[PATCH v2 17/36] fetch: convert fetch_one to use struct refspec

2018-05-16 Thread Brandon Williams
Convert 'fetch_one()' to use 'struct refspec'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 46 +++--- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 7a1637d35..187

[PATCH v2 28/36] push: check for errors earlier

2018-05-16 Thread Brandon Williams
Move the error checking for using the "--mirror", "--all", and "--tags" options earlier and explicitly check for the presence of the flags instead of checking for a side-effect of the flag. Signed-off-by: Brandon Williams <bmw...@goo

[PATCH v2 15/36] remote: remove add_prune_tags_to_fetch_refspec

2018-05-16 Thread Brandon Williams
Remove 'add_prune_tags_to_fetch_refspec()' function and instead have the only caller directly add the tag refspec using 'refspec_append()'. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 2 +- remote.c| 5 - remote.h| 2 -- 3 files chan

[PATCH v2 27/36] remote: convert match_explicit_refs to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'match_explicit_refs()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmw...@google.com> --- remote.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/remote.c b/remote.c index 9eb

[PATCH v2 26/36] remote: convert get_ref_match to take a struct refspec

2018-05-16 Thread Brandon Williams
Convert 'get_ref_match()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmw...@google.com> --- remote.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/remote.c b/re

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