[PATCH 3/5] commit-graph: add free_commit_graph

2018-06-21 Thread Jonathan Tan
Signed-off-by: Jonathan Tan --- builtin/commit-graph.c | 2 ++ commit-graph.c | 24 ++-- commit-graph.h | 2 ++ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 37420ae0fd..9c2d55221c

[PATCH 1/5] object-store: add missing include

2018-06-21 Thread Jonathan Tan
Signed-off-by: Jonathan Tan --- object-store.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object-store.h b/object-store.h index d683112fd7..f0b77146e4 100644 --- a/object-store.h +++ b/object-store.h @@ -2,6 +2,9 @@ #define OBJECT_STORE_H #include "oidmap.h" +#inclu

[PATCH 0/5] Object store refactoring: commit graph

2018-06-21 Thread Jonathan Tan
didn't modify the function that writes commit graphs - perhaps that can be done in a subsequent series. Jonathan Tan (5): object-store: add missing include commit-graph: add missing forward declaration commit-graph: add free_commit_graph commit-graph: store graph in struct object_store

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

2018-06-19 Thread Jonathan Tan
> On 06/15, Jonathan Tan wrote: > > > > Supporting patterns would mean that we would possibly be able to > > eliminate the ls-refs step, thus saving at least a RTT. (Originally I > > thought that supporting patterns would also allow us to tolerate refs > > being

Re: The state of the object store series

2018-06-19 Thread Jonathan Tan
> Floating on the mailing list, not cooking yet: One more is my bitmap one here: https://public-inbox.org/git/cover.1528397984.git.jonathanta...@google.com/ It's not in any branch yet, as far as I can tell, so I've just sent out an e-mail letting Junio know [1]. [1]

Re: What's cooking in git.git (Jun 2018, #05; Mon, 18)

2018-06-19 Thread Jonathan Tan
> Here are the topics that have been cooking. Commits prefixed with > '-' are only in 'pu' (proposed updates) while commits prefixed with > '+' are in 'next'. The ones marked with '.' do not appear in any of > the integration branches, but I am still holding onto them. Would it be possible to

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

2018-06-19 Thread Jonathan Tan
[snip] > > in which we have rarely-updated branches that we still want to fetch > > (e.g. an annotated tag when we fetch refs/tags/* or a Gerrit > > refs/changes/* branch), having the ref advertisement first means that we > > can omit them from our "want" or "want-ref" list. But not having them >

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

2018-06-18 Thread Jonathan Tan
> Jonathan Tan writes: > > >> Wouldn't that allow us not having to advertise the whole tags > >> namespace only to implement the tag following? > > > > Yes, it would, but as far as I can tell, it would add an extra burden on > > the server to walk all re

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

2018-06-18 Thread Jonathan Tan
> Jonathan Tan writes: > > > When performing tag following, in addition to using the server's > > "include-tag" capability to send tag objects (and emulating it if the > > server does not support that capability), "git fetch" relies upon the > >

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

2018-06-18 Thread Jonathan Tan
> okay. Thinking long term, we may want to introduce a capability that > can filter the tag space, e.g. "want-refs-since refs/tags/*" > as a client directive as then the client only asks for new (newly > created/appearing) tags instead of all tags. I don't think refs normally have a

Re: [PATCH v2 1/2] t5702: test fetch with multiple refspecs at a time

2018-06-18 Thread Jonathan Tan
On Mon, Jun 18, 2018 at 11:30 AM, Stefan Beller wrote: >> +test_expect_success 'fetch supports various ways of have lines' ' >> + rm -rf server client trace && > > Can we move these deletions to test_when_finished of the previous(?) test > as well as have them here in a test_when_finished

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

2018-06-15 Thread Jonathan Tan
(replying to the original since my e-mail is about design) > This version of ref-in-want is a bit more restrictive than what Jonathan > originally proposed (only full ref names are allowed instead of globs > and OIDs), but it is meant to accomplish the same goal (solve the issues > of refs

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

2018-06-14 Thread Jonathan Tan
> @@ -1122,6 +1124,7 @@ static int do_fetch(struct transport *transport, > int autotags = (transport->remote->fetch_tags == 1); > int retcode = 0; > const struct ref *remote_refs; > + struct ref *new_remote_refs = NULL; Above, you use the name "updated_remote_refs" - it's

[PATCH v3 5/7] fetch-pack: make negotiation-related vars local

2018-06-14 Thread Jonathan Tan
when using a transport that does not support tag following), in that different priority queues will now be used in each invocation, instead of reusing the possibly non-empty one. Signed-off-by: Jonathan Tan --- fetch-pack.c | 116 ++- 1 file changed

[PATCH v3 2/7] fetch-pack: clear marks before re-marking

2018-06-14 Thread Jonathan Tan
one before any marking (whether by rev_list_insert_ref_oid() or mark_complete_and_common_ref()). Signed-off-by: Jonathan Tan --- fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 5c87bb8bb..2812499a5 100644 --- a/fetch-pa

[PATCH v3 3/7] fetch-pack: directly end negotiation if ACK ready

2018-06-14 Thread Jonathan Tan
unconditionally. [1] The rationale is further described in the originating commit f2cba9299b ("fetch-pack: Finish negotation if remote replies "ACK %s ready"", 2011-03-14). Signed-off-by: Jonathan Tan --- fetch-pack.c | 9 + 1 file changed, 5 insertions(+), 4 deletio

[PATCH v3 7/7] fetch-pack: introduce negotiator API

2018-06-14 Thread Jonathan Tan
to negotiator/default.c, and it can be seen that the lines replaced by negotiator->X() calls are present in the X() functions respectively. Signed-off-by: Jonathan Tan --- Makefile | 2 + fetch-negotiator.c | 8 ++ fetch-negotiator.h | 57 fetch-pack.c |

[PATCH v3 4/7] fetch-pack: use ref adv. to prune "have" sent

2018-06-14 Thread Jonathan Tan
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 --- fetch-

[PATCH v3 0/7] Refactor fetch negotiation into its own API

2018-06-14 Thread Jonathan Tan
patch 8 into patch 7; this means that the comments are not moved verbatim, but for the reviewer, verbatim-ness of comments is probably not that important anyway Jonathan Tan (7): fetch-pack: split up everything_local() fetch-pack: clear marks before re-marking fetch-pack: directly en

[PATCH v3 1/7] fetch-pack: split up everything_local()

2018-06-14 Thread Jonathan Tan
was introduced in a1c6d7c1a7 ("fetch-pack: restore save_commit_buffer after use", 2017-12-08), is a concern of the parse_object() call in mark_complete_and_common_ref(), so it has been moved from the end of everything_local() to the end of mark_complete_and_common_ref(). Signed-off-by: Jonathan Tan

[PATCH v3 6/7] fetch-pack: move common check and marking together

2018-06-14 Thread Jonathan Tan
-by: Jonathan Tan --- fetch-pack.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 473e415c5..fb76d4017 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -505,11 +505,14 @@ static int find_common(struct negotiation_state *ns

[PATCH] list-objects: check if filter is NULL before using

2018-06-11 Thread Jonathan Tan
In partial_clone_get_default_filter_spec(), the core_partial_clone_filter_default variable may be NULL; ensure that it is not NULL before using it. Signed-off-by: Jonathan Tan --- This was noticed by someone else at $DAY_JOB when trying to use a partial clone with no core.partialclonefilter set

Re: [PATCH 1/2] pack-bitmap: remove bitmap_git global variable

2018-06-11 Thread Jonathan Tan
On Sat, 9 Jun 2018 02:04:38 -0400 Jeff King wrote: > This function used to be idempotent, so any code which wanted to use the > global bitmap_git could call it "just in case". After your patch, it's > not. I think it's probably OK, since such functions would generally now > take a bitmap_git

[PATCH 2/2] pack-bitmap: add free function

2018-06-07 Thread Jonathan Tan
to another field within the same struct. The documentation for that field has been updated to clarify that. Signed-off-by: Jonathan Tan --- builtin/pack-objects.c | 1 + builtin/rev-list.c | 2 ++ pack-bitmap-write.c| 4 pack-bitmap.c | 35

[PATCH 0/2] Object store refactoring: make bitmap_git not global

2018-06-07 Thread Jonathan Tan
reduced. Jonathan Tan (2): pack-bitmap: remove bitmap_git global variable pack-bitmap: add free function builtin/pack-objects.c | 7 +- builtin/rev-list.c | 13 +- pack-bitmap-write.c| 10 +- pack-bitmap.c | 344 - pack-bitmap.h

[PATCH 1/2] pack-bitmap: remove bitmap_git global variable

2018-06-07 Thread Jonathan Tan
if an unnecessarily long-lived "pack" field in struct bitmap_index still points to it. The bitmap API is also clearer in that we need to first obtain a struct bitmap_index, then we use it. Helped-by: Stefan Beller Signed-off-by: Jonathan Tan --- builtin/pack-objects.c | 6 +- builtin/rev-list.c

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

2018-06-06 Thread Jonathan Tan
Signed-off-by: Jonathan Tan --- negotiator/default.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/negotiator/default.c b/negotiator/default.c index b8f45cf78..a9e52c943 100644 --- a/negotiator/default.c +++ b/negotiator/default.c @@ -46,11 +46,10 @@ static

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

2018-06-06 Thread Jonathan Tan
that patch, this struct definition and several functions will be moved to a negotiation-specific file, and this allows the move to be verbatim. Signed-off-by: Jonathan Tan --- fetch-pack.c | 104 +-- 1 file changed, 59 insertions(+), 45 deletions(-)

[PATCH v2 7/8] fetch-pack: introduce negotiator API

2018-06-06 Thread Jonathan Tan
to negotiator/default.c, and it can be seen that the lines replaced by negotiator->X() calls are present in the X() functions respectively. Signed-off-by: Jonathan Tan --- Makefile | 2 + fetch-negotiator.c | 8 ++ fetch-negotiator.h | 57 fetch-pack.c |

[PATCH v2 2/8] fetch-pack: clear marks before re-marking

2018-06-06 Thread Jonathan Tan
one before any marking (whether by rev_list_insert_ref_oid() or mark_complete_and_common_ref()). Signed-off-by: Jonathan Tan --- fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 5c87bb8bb..2812499a5 100644 --- a/fetch-pa

[PATCH v2 0/8] Refactor fetch negotiation into its own API

2018-06-06 Thread Jonathan Tan
ge: comments should have ' *' at the start of each > > line (could do in a preparatory patch or a followup). > > I'll add a followup. I'm now not sure of the value of making a change just to update formatting, but I added the followup commit anyway - it can be easily dropped if we deci

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

2018-06-06 Thread Jonathan Tan
rationale is further described in the originating commit f2cba9299b ("fetch-pack: Finish negotation if remote replies "ACK %s ready"", 2011-03-14). Signed-off-by: Jonathan Tan --- fetch-pack.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fetch-pack.

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

2018-06-06 Thread Jonathan Tan
was introduced in a1c6d7c1a7 ("fetch-pack: restore save_commit_buffer after use", 2017-12-08), is a concern of the parse_object() call in mark_complete_and_common_ref(), so it has been moved from the end of everything_local() to the end of mark_complete_and_common_ref(). Signed-off-by: Jonathan Tan

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

2018-06-06 Thread Jonathan Tan
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 --- fetch-pack.c | 6 +++--- t/t550

[PATCH v2 6/8] fetch-pack: move common check and marking together

2018-06-06 Thread Jonathan Tan
-by: Jonathan Tan --- fetch-pack.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index c31644bb9..4a4ec4da3 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -499,11 +499,14 @@ static int find_common(struct data *data, struct fetch_pack_args *args

Re: [PATCH 6/6] fetch-pack: introduce negotiator API

2018-06-05 Thread Jonathan Tan
On Tue, Jun 5, 2018 at 5:37 PM, Jonathan Nieder wrote: >> This patch is written to be more easily reviewed: static functions are >> moved verbatim from fetch-pack.c to negotiator/default.c, and it can be >> seen that the lines replaced by negotiator->X() calls are present in the >> X() functions

Re: [PATCH 5/6] fetch-pack: move common check and marking together

2018-06-05 Thread Jonathan Tan
On Tue, Jun 5, 2018 at 5:01 PM, Jonathan Nieder wrote: > I like it. I think it should be possible to describe the benefit of > this patch without reference to the specifics of the subsequent one. > Maybe something like: > > When receiving 'ACK continue' for a common commit, >

Re: [PATCH 4/6] fetch-pack: make negotiation-related vars local

2018-06-05 Thread Jonathan Tan
On Tue, Jun 5, 2018 at 4:35 PM, Jonathan Nieder wrote: > Jonathan Tan wrote: > >> Reduce the number of global variables by making the priority queue and >> the count of non-common commits in it local, passing them as a struct to >> various functions where necessary. >

Re: [PATCH 3/6] fetch-pack: in protocol v2, enqueue commons first

2018-06-05 Thread Jonathan Tan
On Tue, Jun 5, 2018 at 4:30 PM, Jonathan Nieder wrote: > I get lost in the above description. I suspect it's doing a good job > of describing the code, instead of answering the question I really > have about what is broken and what behavior we want instead. > > E.g. are there some commands that

Re: [PATCH 2/6] fetch-pack: truly stop negotiation upon ACK ready

2018-06-05 Thread Jonathan Tan
On Tue, 5 Jun 2018 16:16:34 -0700 Jonathan Nieder wrote: > Hi, > > 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]. This appears > &

Re: [PATCH 1/6] fetch-pack: clear marks before everything_local()

2018-06-05 Thread Jonathan Tan
On Tue, 5 Jun 2018 16:08:21 -0700 Jonathan Nieder wrote: > Hi, > > Jonathan Tan wrote: > > > If tag following is required when using a transport that does not > > support tag following, fetch_pack() will be invoked twice in the same > > process, necessitating

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

2018-06-05 Thread Jonathan Tan
uations. This also necessitates a change another test which tested ref advertisement filtering using tag refs - since tag refs are sent by default now, the test has been switched to using branch refs instead. Signed-off-by: Jonathan Tan --- builtin/fetch.c| 2 +- t/t5702-protocol-v2.sh |

[PATCH v2 0/2] Fix protocol v2 tag following with CLI refspec

2018-06-05 Thread Jonathan Tan
ith ref-in-want (for example, in your latest series [1]) we might be able to restore performance, because the server can send refs/tags/X with the packfile instead of sending all refs/tags/X refs initially to the client. [1] https://public-inbox.org/git/20180605175144.4225-1-bmw...@google.com/

[PATCH v2 1/2] t5702: test fetch with multiple refspecs at a time

2018-06-05 Thread Jonathan Tan
Extend the protocol v2 tests to also test fetches with multiple refspecs specified. This also covers the previously uncovered cases of fetching with prefix matching and fetching by SHA-1. Signed-off-by: Jonathan Tan --- t/t5702-protocol-v2.sh | 47 ++ 1

[PATCH 0/2] Fix protocol v2 tag following with CLI refspec

2018-06-05 Thread Jonathan Tan
] https://public-inbox.org/git/20180531072339.ga43...@aiede.svl.corp.google.com/ Jonathan Tan (2): t5702: test fetch with multiple refspecs at a time fetch: send "refs/tags/" prefix upon CLI refspecs builtin/fetch.c| 2 +- t/t5702-protocol-

[PATCH 1/2] t5702: test fetch with multiple refspecs at a time

2018-06-05 Thread Jonathan Tan
Extend the protocol v2 tests to also test fetches with multiple refspecs specified. This also covers the previously uncovered cases of fetching with prefix matching and fetching by SHA-1. Signed-off-by: Jonathan Tan --- t/t5702-protocol-v2.sh | 47 ++ 1

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

2018-06-05 Thread Jonathan Tan
e ref-prefixes when using a configured refspec", 2018-05-18) ensured that "refs/tags/" is always sent as a ref prefix when "git fetch" is invoked with no refspecs, but not when "git fetch" is invoked with refspecs. Extend that functionality to make it work in both si

[PATCH 6/6] fetch-pack: introduce negotiator API

2018-06-04 Thread Jonathan Tan
to negotiator/default.c, and it can be seen that the lines replaced by negotiator->X() calls are present in the X() functions respectively. Signed-off-by: Jonathan Tan --- Makefile | 2 + fetch-negotiator.c | 7 ++ fetch-negotiator.h | 45 ++ fetch-pack.c |

[PATCH 5/6] fetch-pack: move common check and marking together

2018-06-04 Thread Jonathan Tan
This enables the calculation of was_common and the invocation to mark_common() to be abstracted into a single call to the negotiator API (to be introduced in a subsequent patch). Signed-off-by: Jonathan Tan --- fetch-pack.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH 4/6] fetch-pack: make negotiation-related vars local

2018-06-04 Thread Jonathan Tan
that patch, this struct definition and several functions will be moved to a negotiation-specific file, and this allows the move to be verbatim. Signed-off-by: Jonathan Tan --- fetch-pack.c | 104 +-- 1 file changed, 59 insertions(+), 45 deletions(-)

[PATCH 3/6] fetch-pack: in protocol v2, enqueue commons first

2018-06-04 Thread Jonathan Tan
consistent with do_fetch_pack(), and to avoid sending unnecessary "have" lines. Signed-off-by: Jonathan Tan --- fetch-pack.c | 6 +++--- t/t5500-fetch-pack.sh | 35 +++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/fetch-pack.c b/fetch-pa

[PATCH 0/6] Refactor fetch negotiation into its own API

2018-06-04 Thread Jonathan Tan
/20180521204340.260572-1-jonathanta...@google.com/ Jonathan Tan (6): fetch-pack: clear marks before everything_local() fetch-pack: truly stop negotiation upon ACK ready fetch-pack: in protocol v2, enqueue commons first fetch-pack: make negotiation-related vars local fetch-pack: move common check

[PATCH 1/6] fetch-pack: clear marks before everything_local()

2018-06-04 Thread Jonathan Tan
Signed-off-by: Jonathan Tan --- fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index a320ce987..1358973a4 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -336,9 +336,6 @@ static int find_common(struct fetch_pack_args *args,

[PATCH 2/6] fetch-pack: truly stop negotiation upon ACK ready

2018-06-04 Thread Jonathan Tan
tely to processing the packfile upon "ACK %s ready". The clearing of rev_list here is thus redundant, and this patch also removes it. [1] The rationale is further described in the originating commit f2cba9299b ("fetch-pack: Finish negotation if remote replies "ACK %s ready"",

Re: [RFC PATCH] fetch-pack: space out sent "haves" in negotiation

2018-05-29 Thread Jonathan Tan
On Wed, 23 May 2018 12:42:10 +0900 Junio C Hamano wrote: > Somehow this feels more like a WIP than RFC, primarily for two > reasons. It was unclear what "edge" computation is trying to do; it > seems way under-explained, especially the part that takes min-max > while. merging two candidates.

Re: [PATCH] submodule: do not pass null OID to setup_revisions

2018-05-24 Thread Jonathan Tan
On Thu, 24 May 2018 16:07:49 -0700 Stefan Beller <sbel...@google.com> wrote: > Hi Jonathan, > > On Thu, May 24, 2018 at 1:47 PM, Jonathan Tan <jonathanta...@google.com> > wrote: > > If "git pull --recurse-submodules --rebase" is invoked when the current

[PATCH] submodule: do not pass null OID to setup_revisions

2018-05-24 Thread Jonathan Tan
te submodule changes only)", 2017-06-23), which also introduced this feature. This is because cmd_pull() in builtin/pull.c thus invokes submodule_touches_in_range() with a null OID as the first parameter. Ensure that this case works, and document what happens in this case. Signed-of

Re: [RFC PATCH] fetch-pack: space out sent "haves" in negotiation

2018-05-22 Thread Jonathan Tan
On Mon, 21 May 2018 15:57:18 -0700 Stefan Beller wrote: > In an ideal world, the server and client would both estimate the potential > reduction of the packfile to send, and base the decision if to continue > negotiating on the trade off if the packfile reduction savings are

[RFC PATCH] fetch-pack: space out sent "haves" in negotiation

2018-05-21 Thread Jonathan Tan
e corresponding remote-tracking tips. This can be done simultaneously with the approach in this patch, but if we were to evaluate only one first, the ancestor-or-descendant-of-remote-tracking-tip approach might be the better one to do first. Signed-off-by: Jonathan Tan <jonathanta

Re: [PATCH 0/8] Reroll of sb/diff-color-move-more

2018-05-17 Thread Jonathan Tan
On Thu, 17 May 2018 12:46:45 -0700 Stefan Beller wrote: > Stefan Beller (8): > xdiff/xdiff.h: remove unused flags > xdiff/xdiffi.c: remove unneeded function declarations > diff.c: do not pass diff options as keydata to hashmap > diff.c: adjust hash function signature

Re: [PATCH v4 00/13] object store: alloc

2018-05-10 Thread Jonathan Tan
On Thu, 10 May 2018 10:32:09 -0700 Stefan Beller wrote: > > - I would call them release_commit() and release_tag(), to match > >strbuf_release(). > > Why not commit_release and tag_release to also have the same order > of words as in strbuf_release ? At this point in

Re: [PATCH v4 00/13] object store: alloc

2018-05-10 Thread Jonathan Tan
On Wed, 9 May 2018 17:40:11 -0700 Stefan Beller wrote: > if (obj->type == OBJ_TREE) > - release_tree_node((struct tree*)obj); > + free_tree_buffer((struct tree*)obj); > else if (obj->type == OBJ_COMMIT) > -

Re: [PATCHv2 0/4] Rebooting pc/submodule-helper-foreach

2018-05-09 Thread Jonathan Tan
On Tue, 8 May 2018 17:29:48 -0700 Stefan Beller wrote: > v2: > * rebased onto origin/master > * dropped leftover "toplevel" variable from experimentation > * reworded the commit message for the first patch extensively > * dropped the third patch > * see "branch-diff" below.

Re: [PATCH v3 13/13] alloc: allow arbitrary repositories for alloc functions

2018-05-08 Thread Jonathan Tan
On Tue, 8 May 2018 12:37:36 -0700 Stefan Beller wrote: > +void clear_alloc_state(struct alloc_state *s) > +{ > + while (s->slab_nr > 0) { > + s->slab_nr--; > + free(s->slabs[s->slab_nr]); > + } I should have caught this earlier, but you need

Re: [PATCH v2 13/13] alloc: allow arbitrary repositories for alloc functions

2018-05-08 Thread Jonathan Tan
On Mon, 7 May 2018 15:59:16 -0700 Stefan Beller wrote: > + for (i = 0; i < o->obj_hash_size; i++) { > + struct object *obj = o->obj_hash[i]; > + > + if (!obj) > + continue; > + > + if (obj->type == OBJ_TREE) { > +

Re: [PATCH v2 01/13] repository: introduce parsed objects field

2018-05-08 Thread Jonathan Tan
On Mon, 7 May 2018 15:59:04 -0700 Stefan Beller wrote: > /* > - * Holds any information related to accessing the raw object content. > + * Holds any information needed to retrieve the raw content > + * of objects. The object_parser uses this to get

Re: [PATCH 1/5] submodule foreach: correct '$path' in nested submodules from a subdirectory

2018-05-04 Thread Jonathan Tan
On Thu, 3 May 2018 11:12:27 -0700 Stefan Beller wrote: > >> There are three different possible solutions that have more value: > >> (a) The path value is documented as the path from the toplevel of the > >> superproject to the mount point of the submodule. If 'the' refers

Re: [PATCH v2 1/3] upload-pack: fix error message typo

2018-05-04 Thread Jonathan Tan
On Fri, 04 May 2018 11:24:39 +0900 Junio C Hamano wrote: > Hmm, when somebody breaks "git server serve", we probably would not > want to see the binary spewed to the output while debugging it. So > I'd probably keep the redirection---it may be an improvement to use > ">out"

[PATCH v3 2/3] upload-pack: read config when serving protocol v2

2018-05-03 Thread Jonathan Tan
The upload-pack code paths never call git_config() with upload_pack_config() when protocol v2 is used, causing options like uploadpack.packobjectshook to not take effect. Ensure that this function is called. Signed-off-by: Jonathan Tan <jonathanta...@google.com> --- t/t5702-protocol-v2.s

[PATCH v3 3/3] {fetch,upload}-pack: support filter in protocol v2

2018-05-03 Thread Jonathan Tan
quot; only if uploadpack.allowfilter is configured. Like in the legacy protocol, the client continues with a warning if "--filter" is specified, but the server does not advertise it. Signed-off-by: Jonathan Tan <jonathanta...@google.com> --- Documentation/technical/protocol-v2.

[PATCH v3 1/3] upload-pack: fix error message typo

2018-05-03 Thread Jonathan Tan
Fix a typo in an error message. Also, this line was introduced in 3145ea957d2c ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan <jonathanta.

[PATCH v3 0/3] Supporting partial clones in protocol v2

2018-05-03 Thread Jonathan Tan
Changes from v2: followed all Stefan's comments. Jonathan Tan (3): upload-pack: fix error message typo upload-pack: read config when serving protocol v2 {fetch,upload}-pack: support filter in protocol v2 Documentation/technical/protocol-v2.txt | 9 ++ fetch-pack.c

Re: [PATCH v2 2/3] upload-pack: read config when serving protocol v2

2018-05-03 Thread Jonathan Tan
On Thu, 3 May 2018 12:08:16 -0700 Stefan Beller wrote: > test_path_is_missing ? Thanks for the pointer. Done. > > + GIT_TRACE=/tmp/y git -c protocol.version=2 clone > > "file://$(pwd)/server" client && > > Why do we redirect GIT_TRACE outside the test suite? do we

Re: [PATCH v2 1/3] upload-pack: fix error message typo

2018-05-03 Thread Jonathan Tan
On Thu, 3 May 2018 11:58:59 -0700 Stefan Beller wrote: > > + test_must_fail git -C server serve --stateless-rpc /dev/null > > 2>err && > > Minor nit: > Why do we pipe stdout to /dev/null ? Usually there's a binary packfile produced, but not in this case. I'll remove

Re: [PATCH 5/5] submodule: port submodule subcommand 'foreach' from shell to C

2018-05-03 Thread Jonathan Tan
On Wed, 2 May 2018 17:53:58 -0700 Stefan Beller wrote: > + argv_array_pushf(, "path=%s; %s", > + path, info->argv[0]); Do we need to quote the path here? (For example, what if path has a quotation mark?) Also, would it be useful to

Re: [PATCH 3/5] submodule foreach: clarify the '$toplevel' variable documentation

2018-05-03 Thread Jonathan Tan
On Wed, 2 May 2018 17:53:56 -0700 Stefan Beller wrote: > $name is the name of the relevant submodule section in `.gitmodules`, > $sm_path is the path of the submodule as recorded in the superproject, > $sha1 is the commit as recorded in the superproject,

Re: [PATCH 2/5] submodule foreach: document '$sm_path' instead of '$path'

2018-05-03 Thread Jonathan Tan
On Wed, 2 May 2018 17:53:55 -0700 Stefan Beller wrote: > foreach [--recursive] :: > Evaluates an arbitrary shell command in each checked out submodule. > - The command has access to the variables $name, $path, $sha1 and > + The command has access to the

Re: [PATCH 1/5] submodule foreach: correct '$path' in nested submodules from a subdirectory

2018-05-03 Thread Jonathan Tan
On Wed, 2 May 2018 17:53:54 -0700 Stefan Beller wrote: > From: Prathamesh Chavan > > When running 'git submodule foreach --recursive' from a subdirectory of > your repository, nested submodules get a bogus value for $path: I know I said in a previous

Re: [PATCH 13/13] alloc: allow arbitrary repositories for alloc functions

2018-05-02 Thread Jonathan Tan
On Tue, 1 May 2018 14:34:03 -0700 Stefan Beller wrote: > +void *allocate_alloc_state(void) > +{ > + return xcalloc(1, sizeof(struct alloc_state)); > +} > + > +void clear_alloc_state(struct alloc_state *s) > +{ > + while (s->slab_nr > 0) { > +

Re: [PATCH 12/13] object: allow create_object to handle arbitrary repositories

2018-05-02 Thread Jonathan Tan
On Tue, 1 May 2018 14:34:02 -0700 Stefan Beller <sbel...@google.com> wrote: > Signed-off-by: Jonathan Nieder <jrnie...@gmail.com> > Signed-off-by: Stefan Beller <sbel...@google.com> Reviewed-by: Jonathan Tan <jonathanta...@google.com> Downloading this patch set

Re: [PATCH 04/13] alloc: add repository argument to alloc_blob_node

2018-05-02 Thread Jonathan Tan
On Tue, 1 May 2018 14:33:54 -0700 Stefan Beller wrote: > Signed-off-by: Stefan Beller Add the same boilerplate explanation to this and subsequent commits. If editing it for every new function name is cumbersome, maybe use this shortened version: This

Re: [PATCH 01/13] repository: introduce object parser field

2018-05-02 Thread Jonathan Tan
On Tue, 1 May 2018 14:33:51 -0700 Stefan Beller wrote: > Git's object access code can be thought of as containing two layers: > the raw object store provides access to raw object content, while the > higher level obj_hash code parses raw objects and keeps track of >

[PATCH v2 3/3] {fetch,upload}-pack: support filter in protocol v2

2018-05-01 Thread Jonathan Tan
quot; only if uploadpack.allowfilter is configured. Like in the legacy protocol, the client continues with a warning if "--filter" is specified, but the server does not advertise it. Signed-off-by: Jonathan Tan <jonathanta...@google.com> --- Documentation/technical/protocol-v2.

[PATCH v2 0/3] Supporting partial clones in protocol v2

2018-05-01 Thread Jonathan Tan
hole, I just made the uploadpack.packobjectshook not have any spaces, just like in t5544. Jonathan Tan (3): upload-pack: fix error message typo upload-pack: read config when serving protocol v2 {fetch,upload}-pack: support filter in protocol v2 Documentation/technical/protocol-v

[PATCH v2 2/3] upload-pack: read config when serving protocol v2

2018-05-01 Thread Jonathan Tan
The upload-pack code paths never call git_config() with upload_pack_config() when protocol v2 is used, causing options like uploadpack.packobjectshook to not take effect. Ensure that this function is called. Signed-off-by: Jonathan Tan <jonathanta...@google.com> --- t/t5702-protocol-v2.s

[PATCH v2 1/3] upload-pack: fix error message typo

2018-05-01 Thread Jonathan Tan
Fix a typo in an error message. Also, this line was introduced in 3145ea957d2c ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan <jonathanta.

Re: [PATCH 1/2] upload-pack: fix error message typo

2018-05-01 Thread Jonathan Tan
On Tue, 1 May 2018 15:22:20 -0700 Jonathan Tan <jonathanta...@google.com> wrote: > +test_expect_success 'unexpected lines are not allowed in fetch request' ' > + git init server && > + > + # Custom request that tries to filter even though it is not advertise

[PATCH 2/2] {fetch,upload}-pack: support filter in protocol v2

2018-05-01 Thread Jonathan Tan
quot; only if uploadpack.allowfilter is configured. Like in the legacy protocol, the client continues with a warning if "--filter" is specified, but the server does not advertise it. Signed-off-by: Jonathan Tan <jonathanta...@google.com> --- Documentation/technical/protocol-v2.

[PATCH 0/2] Supporting partial clones in protocol v2

2018-05-01 Thread Jonathan Tan
thing I am a little unhappy about is the fact that the upload-pack config has to be read in multiple places, but perhaps there is no choice about that. Jonathan Tan (2): upload-pack: fix error message typo {fetch,upload}-pack: support filter in protocol v2 Documentation/technical/protocol-v2

[PATCH 1/2] upload-pack: fix error message typo

2018-05-01 Thread Jonathan Tan
Fix a typo in an error message. Also, this line was introduced in 3145ea957d2c ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan <jonathanta.

Re: [PATCH v3 1/3] merge: update documentation for {merge,diff}.renameLimit

2018-04-26 Thread Jonathan Tan
Tan's > commit 89973554b52c ("diffcore-rename: make diff-tree -l0 mean > -l", 2017-11-29)), and doesn't actually drop the limit to 0. > cc'ing Jonathan Tan for his thoughts. Documenting that the value of 0 is special does make sense to me. I think this patch can go in as-is, though - it is already an improvement.

Re: [PATCHv3 0/9] object store: oid_object_info is the next contender

2018-04-25 Thread Jonathan Tan
On Wed, 25 Apr 2018 11:20:57 -0700 Stefan Beller <sbel...@google.com> wrote: > v3: > * fixed and extended the commit message of last commit > * fixed the last patch, as Jonathan Tan suggested, see interdiff: Thanks, all my comments have been addressed. Reviewed-by: Jonathan

Re: [PATCH 7/7] diff.c: add --color-moved-ignore-space-delta option

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 16:23:28 -0700 Stefan Beller wrote: > >> s/missmatch/mismatch/ > >> Also, what is this used for? > > > > The mismatch should be used for (thanks for catching!) > > checking if the remainder of a line is the same, although a boolean > > may be not the

Re: [PATCH 5/7] diff.c: add a blocks mode for moved code detection

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 15:37:51 -0700 Stefan Beller wrote: > These can be combined independently, so would > you expect the user to expect two options for them? > For example "--color-moved=zebra" could be split > into "--skip-small --alternate-blocks" Yes, this is a good

Re: [PATCHv2 9/9] cache.h: allow oid_object_info to handle arbitrary repositories

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 14:59:09 -0700 Stefan Beller wrote: > This involves also adapting oid_object_info_extended and a some > internal functions that are used to implement these. It all has to > happen in one patch, because of a single recursive chain of calls visits > all

Re: [PATCHv2 0/7] Moved code detection: ignore space on uniform indentation

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 14:03:23 -0700 Stefan Beller wrote: > v2: > I think I have addressed Jonathans feedback > * by using a string instead of counting the first character only. > * refined tests slightly (easier to read) > * moved white space handling for moved blocks into its

Re: [PATCH 7/7] diff.c: add --color-moved-ignore-space-delta option

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 14:03:30 -0700 Stefan Beller wrote: > +--color-moved-[no-]ignore-space-prefix-delta:: > + Ignores whitespace when comparing lines when performing the move > + detection for --color-moved. This ignores uniform differences > + of white space at

Re: [PATCH 6/7] diff.c: decouple white space treatment from move detection algorithm

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 14:03:29 -0700 Stefan Beller wrote: > As we change the default, we'll adjust the tests. This statement is probably better written as: In some existing tests, options like --ignore-space-at-eol were used to control the color of the output. They have

Re: [PATCH 5/7] diff.c: add a blocks mode for moved code detection

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 14:03:28 -0700 Stefan Beller wrote: > Suggested-by: Ævar Arnfjörð Bjarmason > (https://public-inbox.org/git/87o9j0uljo@evledraar.gmail.com/) > Signed-off-by: Stefan Beller Firstly, I don't know if this is the

Re: [PATCH 9/9] cache.h: allow sha1_object_info to handle arbitrary repositories

2018-04-24 Thread Jonathan Tan
On Tue, 24 Apr 2018 11:42:33 -0700 Brandon Williams <bmw...@google.com> wrote: > On 04/24, Jonathan Tan wrote: > > On Mon, 23 Apr 2018 16:43:27 -0700 > > Stefan Beller <sbel...@google.com> wrote: > > > > > This involves also adapting sha1_object_info_ex

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