On 06/22, Jonathan Nieder wrote:
> Hi,
>
> Brandon Williams wrote:
>
> > 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 cli
On 06/22, Antonio Ospite wrote:
> On Fri, 22 Jun 2018 10:13:10 -0700
> Brandon Williams wrote:
>
> [...]
> > Thanks for working on this. I think its a good approach and the end
> > result makes it much harder for arbitrary config to sneak back in to the
> > .gi
series it looks like you should be in
a good place 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
_clone_config config = {
+ .fetchjobs = max_jobs,
+ .recurse_submodules = NULL,
+ };
+ config_from_gitmodules(gitmodules_fetch_clone_config, the_repository,
+ &config);
}
--
Brandon Williams
red
> in
> - * the repository.
> - *
> - * 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
27;config_from_gitmodules' for
> options not strictly related to submodules: "submodule.fetchobjs" does
s/fetchobjs/fetchjobs
--
Brandon Williams
=
> parse_fetch_recurse_submodules_arg(var, value);
There shouldn't be a space before "->" in this line.
--
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
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
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
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
ists is a 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-i
he form of ref names
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
---
Docum
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
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
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
(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
hat v1 of the series 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
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
equest "refs/tags/*" is too broad of a
request and could be requesting 100s of tags 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
for (r = refs; r; r = r->next, i++)
> > 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
in the past with 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
>
> > How is the tag following documented (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
c b/pathspec.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
uess I've gotten pretty good at getting people to 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
.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
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
> appl
y passing
> > '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
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) {
&
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.
> >
> > Sign
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
a look at the series and it looks good. I'm glad we're
getting closer to this set of series being completed. Thanks for
pushing this through :)
--
Brandon Williams
he 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
,
> marked = 1;
>
> /* Filter 'ref' by 'sought' and those that aren't local
> */
> - mark_complete_and_common_ref(args, &ref);
> + mark_complete_and_common_ref(&data, args, &ref);
> filter_refs(args, &ref, sought, nr_sought);
> if (everything_local(args, &ref))
> 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, &data);
> + for_each_cached_alternate(&data,
> + insert_one_alternate_object);
> break;
> case FETCH_SEND_REQUEST:
> - if (send_fetch_request(fd[1], args, ref, &common,
> + if (send_fetch_request(&data, fd[1], args, ref, &common,
> &haves_to_send, &in_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(&reader, &common)) {
> + switch (process_acks(&data, &reader, &common)) {
> case 2:
> state = FETCH_GET_PACK;
> break;
> --
> 2.17.0.768.g1526ddbba1.dirty
>
--
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 explicitly break from th
col 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
}
> }
> done:
> @@ -1300,7 +1300,6 @@ static int process_acks(struct packet_reader *reader,
> struct oidset *common)
> }
>
> if (!strcmp(reader->line, "ready")) {
> - clear_prio_queue(&rev_list);
> received_ready = 1;
> continue;
> }
> --
> 2.17.0.768.g1526ddbba1.dirty
>
--
Brandon Williams
gt; for_each_cached_alternate(insert_one_alternate_object);
>
> /* Filter 'ref' by 'sought' and those that aren't local
> */
> - if (everything_local(args, &ref, sought, nr_sought))
> + mark_complete_and_common_ref(args, &ref);
> + filter_refs(args, &ref, sought, nr_sought);
> + if (everything_local(args, &ref))
> state = FETCH_DONE;
> else
> state = FETCH_SEND_REQUEST;
> --
> 2.17.0.768.g1526ddbba1.dirty
>
--
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
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| 7 ++
Docum
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
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
(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
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
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
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
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: refacto
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::
>
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.
> >
ry *refresh_cache_entry(struct cache_entry *ce,
> -unsigned int options)
> +struct cache_entry *refresh_index_entry(struct index_state *istate,
> + struct cache_entry *ce,
> + unsigned int options)
> {
> - return refresh_cache_ent(&the_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(&the_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
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
>
> if (should_update_submodules() && o->update && !o->dry_run)
> load_gitmodules_file(index, NULL);
> @@ -421,7 +421,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.rc0.333.g22e6ee6cdf
>
--
Brandon Williams
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 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(&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.rc0.333.g22e6ee6cdf
>
--
Brandon Williams
etch: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
client -c protocol.version=2 \
> + fetch "$(pwd)/server" 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
> 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
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
>
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
t; builtin/pull.c | 2 +-
> refspec.c | 13 +
> refspec.h | 5 -
> 4 files changed, 15 insertions(+), 7 deletions(-)
>
> --
> 2.17.0.290.gded63e768a
>
--
Brandon Williams
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| 4 +
Docum
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 with
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
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
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
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
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
(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
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
unpack-trees.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
uct refspec_item *item, const char *refspec, int
> fetch);
> +void refspec_item_init_or_die(struct refspec_item *item, const char
> *refspec, int fetch);
> void 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
et = parse_refspec(&refspec, fetch_refspec_str, REFSPEC_FETCH);
> refspec_item_clear(&refspec);
> return ret;
> }
> --
> 2.18.0.rc0.43.gb85e7bcbff
>
--
Brandon Williams
ex - 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
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:
> Wh
tly fetch most likely because its recorded as a symref 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
Update the config documentation to note the value `2` as an acceptable
value for the protocol.version config.
Signed-off-by: Brandon Williams
---
Documentation/config.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index a05a88fec
ng 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
Signed-off-by: Brandon Willia
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
---
remote-curl.c | 1
> and 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
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
---
remote-curl.c | 1
" header containing only the encoding methods curl
supports.
Signed-off-by: Brandon Williams
---
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.c
inde
l of 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
ries 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
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
---
builtin/fetch.c | 13 +
refspec.c | 29 +
refspec.h | 4
transport.c | 21
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
---
builtin/fetch.c| 10 +-
t/t5702-prot
short 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-prefix
Convert the logic in 'transport_push()' which calculates a list of
ref-prefixes to use 'struct refspec'.
Signed-off-by: Brandon Williams
---
transport.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/transport.c b/transport.c
index
Convert 'prune_refs()' to take a 'struct refspec' as a parameter instead
of a list of 'struct refspec_item'.
Signed-off-by: Brandon Williams
---
builtin/fetch.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/builtin/fetch.c b/b
Convert send-pack.c to store refspecs in a 'struct refspec' instead of
as an array of 'const char *'.
Signed-off-by: Brandon Williams
---
builtin/send-pack.c | 24 +++-
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/builtin/send-pack.c b
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
---
builtin/push.c | 38 +++---
1 file changed, 15 insertions(+), 23 deleti
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
---
builtin/fetch.c | 2 +-
builtin/remote.c | 3 +--
remote.c | 18 +-
remote.h
Convert 'push_unpushed_submodules()' to take a 'struct refspec' as a
parameter instead of an array of 'const char *'.
Signed-off-by: Brandon Williams
---
submodule.c | 19 +--
submodule.h | 3 ++-
transport.c | 2 +-
3 files changed, 12 insert
Convert http-push.c to store refspecs in a 'struct refspec' instead of
in an array of 'const char *'.
Signed-off-by: Brandon Williams
---
http-push.c | 17 -
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/http-push.c b/http-push.c
index f308ce0
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
---
builtin/send-pack.c | 2 --
transport.c | 24
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
---
builtin/push.c | 3 +--
transport.c| 17 +++--
transport.h| 2 +-
3 files changed,
Convert 'check_push_refs()' to take a 'struct refspec' as a parameter
instead of an array of 'const char *'.
Signed-off-by: Brandon Williams
---
remote.c| 14 +-
remote.h| 2 +-
transport.c | 2 +-
3 files changed, 7 insertions(+), 11 deletio
Convert 'match_push_refs()' to take a 'struct refspec' as a parameter
instead of an array of 'const char *'.
Signed-off-by: Brandon Williams
---
builtin/remote.c| 3 +--
builtin/send-pack.c | 2 +-
http-push.c | 3 +--
remote.c| 21 +
Convert 'query_refspecs()' to take a 'struct refspec' as a parameter instead
of a list of 'struct refspec_item'.
Signed-off-by: Brandon Williams
---
builtin/push.c | 3 +--
remote.c | 10 +-
remote.h | 2 +-
3 files changed, 7 insertions(+)
Convert 'fetch_one()' to use 'struct refspec'.
Signed-off-by: Brandon Williams
---
builtin/fetch.c | 46 +++---
1 file changed, 19 insertions(+), 27 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 7a1637d35..18
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
---
builtin/push.c | 31 ++---
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
---
builtin/fetch.c | 2 +-
remote.c| 5 -
remote.h| 2 --
3 files changed, 1 inser
101 - 200 of 2393 matches
Mail list logo