Re: [PATCH v2] connect: in ref advertisement, shallows are last

2017-09-21 Thread Brandon Williams
/ > + case EXPECTING_SHALLOW: > + if (process_shallow(, shallow_points)) > + break; > + die("protocol error: unexpected '%s'", packet_buffer); > + default: > + die("unexpected state %d", state); > } > - > - if (!check_ref(name, flags)) > - continue; > - > - if (got_dummy_ref_with_capabilities_declaration) > - die("protocol error: unexpected ref after > capabilities^{}"); > - > - ref = alloc_ref(buffer + GIT_SHA1_HEXSZ + 1); > - oidcpy(>old_oid, _oid); > - *list = ref; > - list = >next; > } > > annotate_refs_with_symref_info(*orig_list); > -- > 2.14.1.728.g20a5b67d5.dirty > -- Brandon Williams

Re: [PATCH 3/8] daemon: recognize hidden request arguments

2017-09-21 Thread Brandon Williams
On 09/20, Jonathan Tan wrote: > On Wed, 20 Sep 2017 17:24:43 -0700 > Jonathan Tan <jonathanta...@google.com> wrote: > > > On Wed, 13 Sep 2017 14:54:43 -0700 > > Brandon Williams <bmw...@google.com> wrote: > > > > > A normal request to git-daemon is

Re: [PATCH 2/2] Document the string_list structure

2017-09-21 Thread Brandon Williams
ored in the util feild). Just pointing that out, and I'm happy with this and the previous patch. > struct string_list { > struct string_list_item *items; > unsigned int nr, alloc; > -- > 2.14.1.821.g8fa685d3b7-goog > -- Brandon Williams

Re: [PATCH 1.5/8] connect: die when a capability line comes after a ref

2017-09-20 Thread Brandon Williams
On 09/20, Jeff King wrote: > On Wed, Sep 20, 2017 at 11:48:32AM -0700, Brandon Williams wrote: > > > Commit eb398797c (connect: advertized capability is not a ref, > > 2016-09-09) taught 'get_remote_heads()' to recognize that the > > 'capabilities^{}' line

[PATCH 1.5/8] connect: die when a capability line comes after a ref

2017-09-20 Thread Brandon Williams
ed-off-by: Brandon Williams <bmw...@google.com> --- This is a fix to the bug we found when internally deploying this series. It just makes it so that a capability line wont cause a client to error out if its not the first response, because it won't be the first response come protocol v1. c

Re: [PATCH v2] Improve performance of git status --ignored

2017-09-19 Thread Brandon Williams
if (cdir.fdir) > @@ -2108,7 +2143,7 @@ int read_directory(struct dir_struct *dir, struct > index_state *istate, >*/ > dir->untracked = NULL; > if (!len || treat_leading_path(dir, istate, path, len, pathspec)) > - read_directory_recursive(dir, istate, path, len, untracked, 0, > pathspec); > + read_directory_recursive(dir, istate, path, len, untracked, 0, > 0, pathspec); > QSORT(dir->entries, dir->nr, cmp_dir_entry); > QSORT(dir->ignored, dir->ignored_nr, cmp_dir_entry); > > -- > 2.7.4 > -- Brandon Williams

Re: [PATCH 2/8] protocol: introduce protocol extention mechanisms

2017-09-18 Thread Brandon Williams
rsion v1,v0 > > instead compared to the proposed configuration above. > (Even better yet, then people could play around with "v1 only" > and see how it falls apart on old servers) Except we can't start with an explicit whitelist because we must fallback to v0 if v1 isn't supported otherwise we would break people. That is unless we have the semantics of: If not configured v0 will be used, otherwise only use the configured protocol versions. -- Brandon Williams

Re: [PATCH 2/8] protocol: introduce protocol extention mechanisms

2017-09-18 Thread Brandon Williams
On 09/13, Stefan Beller wrote: > On Wed, Sep 13, 2017 at 2:54 PM, Brandon Williams <bmw...@google.com> wrote: > > Create protocol.{c,h} and provide functions which future servers and > > clients can use to determine which protocol to use or is being used. > > > >

Re: [PATCH 3/8] daemon: recognize hidden request arguments

2017-09-18 Thread Brandon Williams
On 09/13, Stefan Beller wrote: > On Wed, Sep 13, 2017 at 2:54 PM, Brandon Williams <bmw...@google.com> wrote: > > A normal request to git-daemon is structured as > > "command path/to/repo\0host=..\0" and due to a bug in an old version of > > git-daemon 73bb33a

Re: [PATCH 2/4] push, fetch: error out for submodule entries not pointing to commits

2017-09-18 Thread Brandon Williams
x --cacheinfo 16 "$tag" gar/bage && > + git -C work commit -m "bad commit" && > + test_when_finished "git -C work reset --hard HEAD^" && > + test_must_fail git -C work push --recurse-submodules=on-demand > ../pub.git master 2>err && > + test_i18ngrep "is a tag, not a commit" err > +' > + > test_expect_success 'push fails if recurse submodules option passed as yes' ' > ( > cd work/gar/bage && > -- > 2.14.1.690.gbb1197296e > -- Brandon Williams

Re: [RFC PATCH v2 1/2] implement fetching of moved submodules

2017-09-18 Thread Brandon Williams
+ ( > + cd downstream_rename && > + git submodule update --init && > +# NEEDSWORK: we omitted --recursive for the submodule update here since > +# that does not work. See test 7001 for mv "moving nested submodules" > +# for details. Once that is fixed we should add the --recursive option > +# here. > + git checkout -b rename && > + git mv submodule submodule_renamed && > + ( > + cd submodule_renamed && > + git checkout -b rename_sub && > + echo a >a && > + git add a && > + git commit -ma && > + git push origin rename_sub && > + git rev-parse HEAD >../../expect > + ) && > + git add submodule_renamed && > + git commit -m "update renamed submodule" && > + git push origin rename > + ) && > + ( > + cd downstream && > + git fetch --recurse-submodules=on-demand && > + ( > + cd submodule && > + git rev-parse origin/rename_sub >../../actual > + ) > + ) && > + test_cmp expect actual > +' > + > test_done > -- > 2.14.1.145.gb3622a4 > -- Brandon Williams

Re: [RFC PATCH v2 2/2] submodule: simplify decision tree whether to or not to fetch

2017-09-18 Thread Brandon Williams
dule || > !unsorted_string_list_lookup(_submodule_names, >submodule->name)) > continue; > default_argv = "on-demand"; > + break; > + case RECURSE_SUBMODULES_ON: > + default_argv = "yes"; > + break; > + case RECURSE_SUBMODULES_OFF: > + continue; > } > > strbuf_addf(_path, "%s/%s", spf->work_tree, ce->name); > -- > 2.14.1.145.gb3622a4 > -- Brandon Williams

Re: [PATCH] protocol: make parse_protocol_version() private

2017-09-18 Thread Brandon Williams
alue); > extern enum protocol_version get_protocol_version_config(void); > extern enum protocol_version determine_protocol_version_server(void); > extern enum protocol_version determine_protocol_version_client(const char > *server_response); > -- > 2.14.0 -- Brandon Williams

Re: RFC v3: Another proposed hash function transition plan

2017-09-14 Thread Brandon Williams
to echo what jonathan has said in other parts of this thread, that the transition plan itself doesn't depend on which hash function we end up going with in the end. I fully expect that for the transition plan to succeed that we'll have infrastructure for dropping in different hash functions so that we can do some sort of benchmarking before selecting one to use. This would also give us the ability to more easily transition to another hash function when the time comes. -- Brandon Williams

[PATCH 8/8] i5700: add interop test for protocol transition

2017-09-13 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- t/interop/i5700-protocol-transition.sh | 68 ++ 1 file changed, 68 insertions(+) create mode 100755 t/interop/i5700-protocol-transition.sh diff --git a/t/interop/i5700-protocol-transition.sh b/t/i

[PATCH 7/8] http: tell server that the client understands v1

2017-09-13 Thread Brandon Williams
Tell a server that protocol v1 can be used by sending the http header 'Git-Protocol' indicating this. Also teach the apache http server to pass through the 'Git-Protocol' header as an environment variable 'GIT_PROTOCOL'. Signed-off-by: Brandon Williams <bmw...@google.com> --- c

[PATCH 6/8] connect: tell server that the client understands v1

2017-09-13 Thread Brandon Williams
having the server whitelist this envvar. Signed-off-by: Brandon Williams <bmw...@google.com> --- connect.c | 37 ++-- t/t5700-protocol-v1.sh | 223 + 2 files changed, 255 insertions(+), 5 deletions(-) create mode 10075

[PATCH 1/8] pkt-line: add packet_write function

2017-09-13 Thread Brandon Williams
Add a function which can be used to write the contents of an arbitrary buffer. This makes it easy to build up data in a buffer before writing the packet instead of formatting the entire contents of the packet using 'packet_write_fmt()'. Signed-off-by: Brandon Williams <bmw...@google.

[PATCH 5/8] connect: teach client to recognize v1 server response

2017-09-13 Thread Brandon Williams
Teach a client to recognize that a server understands protocol v1 by looking at the first pkt-line the server sends in response. This is done by looking for the response "version 1" send by upload-pack or receive-pack. Signed-off-by: Brandon Williams <bmw...@google.com> ---

[PATCH 4/8] upload-pack, receive-pack: introduce protocol version 1

2017-09-13 Thread Brandon Williams
version being spoken. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/receive-pack.c | 14 ++ upload-pack.c | 17 - 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 52c

[PATCH 0/8] protocol transition

2017-09-13 Thread Brandon Williams
://, and http://. I have also included an interop test to ensure that sending the version request out of band doesn't cause issues with older servers. Any and all comments and feedback are welcome, thanks! Brandon Williams (8): pkt-line: add packet_write function protocol: introduce protocol

[PATCH 3/8] daemon: recognize hidden request arguments

2017-09-13 Thread Brandon Williams
rguments and set 'GIT_PROTOCOL' accordingly. Signed-off-by: Brandon Williams <bmw...@google.com> --- daemon.c | 71 +++- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/daemon.c b/daemon.c index 30747075f..250dbf82c

[PATCH 2/8] protocol: introduce protocol extention mechanisms

2017-09-13 Thread Brandon Williams
. Unknown keys and values must be tolerated. This mechanism is used to communicate which version of the wire protocol a client would like to use with a server. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/config.txt | 16 +++ Documentation/git.txt| 5 Ma

Re: RFC v3: Another proposed hash function transition plan

2017-09-11 Thread Brandon Williams
tion number to sha3-content of the commit > objects, and to add even the "original sha1 name" thing if we find > good use of it. But I cannot shake this nagging feeling off that I > am missing some huge problems that adding these fields and opening > ourselves to more classes of broken objects. > > Thoughts? > > -- Brandon Williams

Re: [PATCH 09/10] set_git_dir: handle feeding gitdir to itself

2017-09-07 Thread Brandon Williams
can essentially be set_git_dir(get_git_dir()) > - * which can cause some problems when trying to free the old value of > - * gitdir. > - */ > set_git_dir(remove_leading_path(git_dir, work_tree)); > initialized = 1; > } > -- > 2.14.1.721.gc5bc1565f1 > -- Brandon Williams

Re: [RFC 7/7] upload-pack: ack version 2

2017-09-01 Thread Brandon Williams
On 09/01, Bryan Turner wrote: > On Thu, Aug 24, 2017 at 3:53 PM, Brandon Williams <bmw...@google.com> wrote: > > + > > + version = getenv("GIT_PROTOCOL"); > > + if (!strcmp(version, "2")) > > + upload_pack_v2(); &

Re: [PATCH 00/39] per-repository object store, part 1

2017-08-30 Thread Brandon Williams
y.h| 7 ++ > server-info.c | 8 +- > sha1_file.c | 165 > > sha1_name.c | 11 ++- > streaming.c | 5 +- > transport.c | 4 +- > 32 files changed, 344 insertions(+), 217 deletions(-) > create mode 100644 contrib/coccinelle/packed_git.cocci > create mode 100644 object-store.h > > -- > 2.14.1.581.gf28d330327 > -- Brandon Williams

Re: [PATCH 07/39] sha1_file: add repository argument to alt_odb_usable

2017-08-30 Thread Brandon Williams
,7 @@ static int link_alt_odb_entry(const char *entry, const > char *relative_base, > while (pathbuf.len && pathbuf.buf[pathbuf.len - 1] == '/') > strbuf_setlen(, pathbuf.len - 1); > > - if (!alt_odb_usable(, normalized_objdir)) { > + if (!alt_odb_usable(the_repository, , normalized_objdir)) { > strbuf_release(); > return -1; > } > -- > 2.14.1.581.gf28d330327 > -- Brandon Williams

Re: [RFC 0/7] transitioning to protocol v2

2017-08-30 Thread Brandon Williams
On 08/30, Bryan Turner wrote: > On Fri, Aug 25, 2017 at 10:29 AM, Jeff King <p...@peff.net> wrote: > > On Thu, Aug 24, 2017 at 03:53:21PM -0700, Brandon Williams wrote: > > > >> The biggest question I'm trying to answer is if these are reasonable ways > >> w

Re: [PATCH] config: use a static lock_file struct

2017-08-30 Thread Brandon Williams
On 08/30, Jeff King wrote: > On Wed, Aug 30, 2017 at 12:57:31PM -0700, Brandon Williams wrote: > > > > And I think we're fine there even with a doubly-linked list. It's still > > > the single update of the "next" pointer that controls that second > > >

Re: [PATCH] config: use a static lock_file struct

2017-08-30 Thread Brandon Williams
l > the single update of the "next" pointer that controls that second > traversal. > > -Peff I know it was mentioned earlier but if this is a critical section, and it would be bad if it was interrupted, then couldn't we turn off interrupts before attempting to remove an item from the list? -- Brandon Williams

Re: [RFC 0/7] transitioning to protocol v2

2017-08-30 Thread Brandon Williams
ables to current implementations unconditionally > >and get a reasonable outcome. > > Right. I just spoke with our server folks and, currently, our SSH > support quietly eats ALL variables. So we're safe :-) > > I'm starting a conversation with them to pass them thru so we can > be ready for this. (Assuming we choose to go this way.) Perfect! Thanks again. -- Brandon Williams

Re: [RFC 0/7] transitioning to protocol v2

2017-08-29 Thread Brandon Williams
On 08/29, Jeff Hostetler wrote: > > > On 8/25/2017 1:35 PM, Jonathan Nieder wrote: > >Hi, > > > >Jeff King wrote: > >>On Thu, Aug 24, 2017 at 03:53:21PM -0700, Brandon Williams wrote: > > > >>>Another version of Git's wire protocol is a

Re: [PATCH] config: use a static lock_file struct

2017-08-29 Thread Brandon Williams
On 08/29, Brandon Williams wrote: > On 08/29, Jeff King wrote: > > On Tue, Aug 29, 2017 at 02:53:41PM -0400, Jeff King wrote: > > > > > It looks like the config code has a minor-ish leak. Patch to follow. > > > > Here it is. > > > > -- >8 --

Re: [PATCH] config: use a static lock_file struct

2017-08-29 Thread Brandon Williams
; - if (lock) > - rollback_lock_file(lock); > + rollback_lock_file(); > free(filename_buf); > if (contents) > munmap(contents, contents_sz); > @@ -2669,7 +2659,7 @@ int git_config_set_multivar_in_file_gently(const char > *config_filename, > return ret; > > write_err_out: > - ret = write_error(get_lock_file_path(lock)); > + ret = write_error(get_lock_file_path()); > goto out_free; > > } > -- > 2.14.1.721.gc5bc1565f1 > -- Brandon Williams

Re: [PATCH 00/10] Implement transactions for the packed ref store

2017-08-29 Thread Brandon Williams
; same source. Overall the patches look sane to me, though I don't believe I'm qualified in this area to give you a complete thumbs up since I don't understand the refs code super well yet. I do like reading patch from you as you do a great job of laying out what you are doing in code, comments and commit messages, something I'm trying to get better at :) -- Brandon Williams

Re: [PATCH 09/10] packed-backend: rip out some now-unused code

2017-08-29 Thread Brandon Williams
* acquiring the lock. > - */ > - clear_packed_ref_cache(refs); > - return 0; > - } > - > - /* Write what remains */ > - return commit_packed_refs(>base, err); > -} > - > static int packed_init_db(struct ref_store *ref_store, struct strbuf *err) > { > /* Nothing to do. */ > diff --git a/refs/packed-backend.h b/refs/packed-backend.h > index 7af2897757..61687e408a 100644 > --- a/refs/packed-backend.h > +++ b/refs/packed-backend.h > @@ -23,12 +23,4 @@ int packed_refs_lock(struct ref_store *ref_store, int > flags, struct strbuf *err) > void packed_refs_unlock(struct ref_store *ref_store); > int packed_refs_is_locked(struct ref_store *ref_store); > > -void add_packed_ref(struct ref_store *ref_store, > - const char *refname, const struct object_id *oid); > - > -int commit_packed_refs(struct ref_store *ref_store, struct strbuf *err); > - > -int repack_without_refs(struct ref_store *ref_store, > - struct string_list *refnames, struct strbuf *err); > - > #endif /* REFS_PACKED_BACKEND_H */ > -- > 2.14.1 > -- Brandon Williams

Re: [PATCH 04/10] packed_delete_refs(): implement method

2017-08-29 Thread Brandon Williams
%s: %s"), > + refnames->items[0].string, err.buf); > + else > + error(_("could not delete references: %s"), err.buf); > + } > + > + ref_transaction_free(transaction); > + strbuf_release(); > + return ret; > } > > static int packed_pack_refs(struct ref_store *ref_store, unsigned int flags) > -- > 2.14.1 > -- Brandon Williams

Re: [PATCH] Add t/helper/test-write-cache to .gitignore

2017-08-28 Thread Brandon Williams
e > /test-urlmatch-normalization > /test-wildmatch > +/test-write-cache > -- > 2.14.1.581.gf28d330327-goog > -- Brandon Williams

Re: [PATCH/RFC] push: anonymize URL in error output

2017-08-25 Thread Brandon Williams
h some refs" stderr >act && > >> + test_i18ncmp exp act > >> +' > >> +rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" > > > > Similarly, this "rm" should probably be a test_when_finished in the > > block with the write_script (unless you really need to carry it over > > several test_expect blocks, in which case there should be an explicit > > test_expect cleaning it up). > Thanks! You're right. I just followed examples in the file. > Updated [1], will send with the next patch version. > > > > > Instead of grepping for the exact error, should we instead grep for the > > password to make sure it is not present on _any_ line? > > > > -Peff > > > One possible issue I see is that this will make it overlap with the > 'push status output scrubs password' case above. But if it's not a > problem, I can replace last two lines with just a 'test_i18ngrep !' > > [1]: > https://github.com/sainaen/git/blob/af17713/t/t5541-http-push-smart.sh#L380-L392 -- Brandon Williams

Re: [RFC 3/7] protocol: tell server that the client understands v2

2017-08-25 Thread Brandon Williams
On 08/25, Brandon Williams wrote: > On 08/25, Junio C Hamano wrote: > > Brandon Williams <bmw...@google.com> writes: > > > > > + /* If using a new version put that stuff here after a second > > > null byte */ > > > + strbuf_addch(,

Re: [RFC 3/7] protocol: tell server that the client understands v2

2017-08-25 Thread Brandon Williams
On 08/25, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > + /* If using a new version put that stuff here after a second > > null byte */ > > + strbuf_addch(, '\0'); > > +

Re: [RFC 0/7] transitioning to protocol v2

2017-08-25 Thread Brandon Williams
behind a feature flag, and dangle it in > front of them with "this will improve fetch performance if you turn it > on". But that carrot implies going all the way through the follow-on > steps of designing the performance-improving v2 extensions and getting > them implemented on the server side. We run 'next' here so we will be able to get at least a little bit of feedback from a small subset of users. -- Brandon Williams

[RFC 4/7] t: fix ssh tests to cope with using '-o SendEnv=GIT_PROTOCOL'

2017-08-24 Thread Brandon Williams
Update some of our tests to cope with ssh being launched with the option to send the protocol version. Signed-off-by: Brandon Williams <bmw...@google.com> --- t/lib-proto-disable.sh | 1 + t/t5601-clone.sh | 10 +- t/t5602-clone-remote-exec.sh | 4 ++-- 3

[RFC 5/7] http: send Git-Protocol-Version header

2017-08-24 Thread Brandon Williams
Tell a serve that protocol v2 can be used by sending an http header indicating this. Signed-off-by: Brandon Williams <bmw...@google.com> --- http.c | 7 +++ t/t5551-http-fetch-smart.sh | 2 ++ 2 files changed, 9 insertions(+) diff --git a/http.c b/http.c index fa8

[RFC 2/7] pkt-line: add strbuf_packet_read

2017-08-24 Thread Brandon Williams
Add function which can be used to read the contents of a single pkt-line into a strbuf. Signed-off-by: Brandon Williams <bmw...@google.com> --- pkt-line.c | 21 + pkt-line.h | 1 + 2 files changed, 22 insertions(+) diff --git a/pkt-line.c b/pkt-line.c index cf9

[RFC 6/7] transport: teach client to recognize v2 server response

2017-08-24 Thread Brandon Williams
Teach a client to recognize that a server understand protocol v2 by looking at the first pkt-line the server sends in response. This is done by looking for the response "version 2" sent by upload-pack. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fe

[RFC 1/7] pkt-line: add packet_write function

2017-08-24 Thread Brandon Williams
Add a function which can be used to write the contents of an arbitrary buffer. This makes it easy to build up data in a strbuf before writing the packet. Signed-off-by: Brandon Williams <bmw...@google.com> --- pkt-line.c | 6 ++ pkt-line.h | 1 + 2 files changed, 7 insertions(+) diff

[RFC 7/7] upload-pack: ack version 2

2017-08-24 Thread Brandon Williams
Signed-off-by: Brandon Williams <bmw...@google.com> --- upload-pack.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/upload-pack.c b/upload-pack.c index 7efff2fbf..0f853152f 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -1032,9 +1032,15 @@ static int upload_pack_config

[RFC 3/7] protocol: tell server that the client understands v2

2017-08-24 Thread Brandon Williams
having the server whitelist this envvar. Signed-off-by: Brandon Williams <bmw...@google.com> --- connect.c | 31 ++- daemon.c | 28 +--- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 49b28b83b..d6

[RFC 0/7] transitioning to protocol v2

2017-08-24 Thread Brandon Williams
/discussion is welcome! Brandon Williams (7): pkt-line: add packet_write function pkt-line: add strbuf_packet_read protocol: tell server that the client understands v2 t: fix ssh tests to cope with using '-o SendEnv=GIT_PROTOCOL' http: send Git-Protocol-Version header transport: teach client

Re: What's cooking in git.git (Aug 2017, #05; Tue, 22)

2017-08-22 Thread Brandon Williams
e .update thing"), this is now good to go, I presume? > Please yell at me that I am clueless if that is not the case ;-) Yep I came to the same conclusion that you did so this should be good to go! -- Brandon Williams

Re: [PATCH] pull: respect submodule update configuration

2017-08-22 Thread Brandon Williams
ngle entry added. As stefan mentioned you can specify a value for 'submodule.active' to take as an arg to --recurse-submodules (the default being '.' or all submodules) so you can do clever things like group submodules using attributes, you can even repeat the flag to provided a more complex pathspec. Hopefully that answers your question :D -- Brandon Williams

Re: [PATCH] pull: respect submodule update configuration

2017-08-21 Thread Brandon Williams
there as well, to have sub{2,4,5} be expected > there as well. > > (B) That may hint at another (UX) bug. > > The test case there uses "git submodule update --init". > The init flag will set all submodules to active. > > Maybe you want > > git config submodule.active ":(exclude)sub0" > git config --add submodule.active ":(exclude)sub2" > git config --add submodule.active "." > # Read: anything except sub0 and sub2 are interesting > > git submodule update > # no init flag, needed even for new submodules IIUC -- Brandon Williams

Re: [PATCH] files-backend: cheapen refname_available check when locking refs

2017-08-17 Thread Brandon Williams
*/ > > if (refs_verify_refname_available( > > - >base, refname, > > + refs->packed_ref_store, refname, > > extras, skip, err)) > > goto error_return; > > } > > This seems too easy to be true. :) But I think it matches what we were > doing before 524a9fdb51 (so it's correct), and the performance numbers > don't lie. > > -Peff -- Brandon Williams

Re: [RFC PATCH 2/2] submodule: simplify decision tree whether to or not to fetch

2017-08-17 Thread Brandon Williams
default: > > + case RECURSE_SUBMODULES_DEFAULT: > > + case RECURSE_SUBMODULES_ON_DEMAND: > > + if (!submodule || > > !unsorted_string_list_lookup(_submodule_names, > > submodule->name)) > > continue; > > default_argv = "on-demand"; > > + break; > > + case RECURSE_SUBMODULES_ON: > > + default_argv = "yes"; > > + break; > > + case RECURSE_SUBMODULES_OFF: > > + continue; > > } > > > > strbuf_addf(_path, "%s/%s", spf->work_tree, > > ce->name); > > -- > > 2.0.0.274.g6b2cd91 > > -- Brandon Williams

Re: [PATCH] convert add_to_alternates_file to use repository struct

2017-08-15 Thread Brandon Williams
(r, reference, strlen(reference), > + '\n', NULL, 0); > } > free(alts); > } > @@ -540,7 +545,8 @@ void add_to_alternates_memory(const char *reference) > */ > prepare_alt_odb(); > > - link_alt_odb_entries(reference, strlen(reference), '\n', NULL, 0); > + link_alt_odb_entries(the_repository, reference, strlen(reference), > + '\n', NULL, 0); > } > > /* > @@ -643,7 +649,8 @@ void prepare_alt_odb(void) > if (!alt) alt = ""; > > alt_odb_tail = _odb_list; > - link_alt_odb_entries(alt, strlen(alt), PATH_SEP, NULL, 0); > + link_alt_odb_entries(the_repository, alt, strlen(alt), > + PATH_SEP, NULL, 0); > > read_info_alternates(get_object_directory(), 0); > } > -- > 2.14.0.rc0.3.g6c2e499285 > -- Brandon Williams

Re: [PATCH] sha1_file: make read_info_alternates static

2017-08-15 Thread Brandon Williams
t; { > char *map; > size_t mapsz; > -- > 2.14.0.rc0.3.g6c2e499285 > Looks good to me. Only nit is I would fix the style to not have a space after the '*' ;) -- Brandon Williams

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Brandon Williams
On 08/15, Ben Peart wrote: > > > On 8/14/2017 6:02 PM, Stefan Beller wrote: > >On Mon, Aug 14, 2017 at 2:30 PM, Brandon Williams <bmw...@google.com> wrote: > >>Add a '.clang-format' file which outlines the git project's coding > >>style. This can be u

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-15 Thread Brandon Williams
On 08/15, Ben Peart wrote: > > > On 8/14/2017 5:30 PM, Brandon Williams wrote: > >Add a '.clang-format' file which outlines the git project's coding > >style. This can be used with clang-format to auto-format .c and .h > >files to conform with git's style. > > &

Re: [PATCH v2 2/2] Makefile: add style build rule

2017-08-14 Thread Brandon Williams
by all contributors. Specifically the penalties to help determine when to break a line. > > > Anyway, we cannot have perfect checker from the day one, and > > considering this is an initial attempt, I'd say it is a good start. -- Brandon Williams

Re: [PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-14 Thread Brandon Williams
On 08/14, Jeff King wrote: > On Mon, Aug 14, 2017 at 06:48:31PM -0400, Jeff King wrote: > > > On Mon, Aug 14, 2017 at 02:30:45PM -0700, Brandon Williams wrote: > > > > > +# Align escaped newlines as far left as possible > > > +# #define A \ >

Re: [PATCH v2 0/2] clang-format

2017-08-14 Thread Brandon Williams
On 08/14, Brandon Williams wrote: > Changes in v2: > * Changed a couple rules to be more inline with our coding style. > * Added a Makefile build rule to run git-clang-format on the diff of the >working tree to suggest style changes. > > I found that the llvm project also

[PATCH v2 1/2] clang-format: outline the git project's coding style

2017-08-14 Thread Brandon Williams
Add a '.clang-format' file which outlines the git project's coding style. This can be used with clang-format to auto-format .c and .h files to conform with git's style. Signed-off-by: Brandon Williams <bmw...@google.com> --- .clang-format

[PATCH v2 0/2] clang-format

2017-08-14 Thread Brandon Williams
. Brandon Williams (2): clang-format: outline the git project's coding style Makefile: add style build rule .clang-format | 165 ++ Makefile | 4 ++ 2 files changed, 169 insertions(+) create mode 100644 .clang-format

[PATCH v2 2/2] Makefile: add style build rule

2017-08-14 Thread Brandon Williams
Add the 'style' build rule which will run git-clang-format on the diff between HEAD and the current worktree. The result is a diff of suggested changes. Signed-off-by: Brandon Williams <bmw...@google.com> --- Makefile | 4 1 file changed, 4 insertions(+) diff --git a/Makefile b/Ma

Re: [RFC] clang-format: outline the git project's coding style

2017-08-11 Thread Brandon Williams
not search enough, "clang-tidy-diff.py --fix" should be all that is > needed I believe clang-tidy is different from clang-format am I mistaken? -- Brandon Williams

Re: [RFC] clang-format: outline the git project's coding style

2017-08-11 Thread Brandon Williams
do_not_close:1; > + unsigned pack_local : 1, > + pack_keep : 1, > + freshened : 1, > + do_not_close : 1; > unsigned char sha1[20]; > struct revindex_entry *revindex; > /* something like ".git/objects/pack/x.pack" */ > @@ -1767,10 +1767,10 @@ struct object_info { > union { > /* >* struct { > - * ... Nothing to expose in this case > + * ... Nothing to expose in this case >* } cached; >* struct { > - * ... Nothing to expose in this case > + * ... Nothing to expose in this case >* } loose; >*/ > struct { -- Brandon Williams

Re: [PATCH v1 1/1] dir: teach status to show ignored directories

2017-08-11 Thread Brandon Williams
inds an untracked file. However, as > the directory is ignored, all the contained contents are also marked > excluded. For ignored directories that contain a large number of files, > this can take some time. > > Signed-off-by: Jameson Miller <jam...@microsoft.com> -- Brandon Williams

Re: [RFC] clang-format: outline the git project's coding style

2017-08-10 Thread Brandon Williams
On 08/10, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > On 08/10, Junio C Hamano wrote: > > > >> I vaguely recall that there was a discussion to have SubmitGit wait > >> for success from Travis CI; if that is already in place

Re: [RFC] clang-format: outline the git project's coding style

2017-08-10 Thread Brandon Williams
lowly the code base would begin to have a uniform style. At some point we may want to then reformat the remaining sections of the code base. At this point we could have some automated bot that fixes style. I'm sure I missed a step in there somewhere though. -- Brandon Williams

Re: [RFC] clang-format: outline the git project's coding style

2017-08-08 Thread Brandon Williams
On 08/08, Stefan Beller wrote: > On Tue, Aug 8, 2017 at 5:05 AM, Johannes Schindelin > <johannes.schinde...@gmx.de> wrote: > > Hi Brandon, > > > > On Mon, 7 Aug 2017, Brandon Williams wrote: > > > >> Add a '.clang-format' file which outlines the git p

Re: [RFC] clang-format: outline the git project's coding style

2017-08-08 Thread Brandon Williams
On 08/08, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Add a '.clang-format' file which outlines the git project's coding > > style. This can be used with clang-format to auto-format .c and .h > > files to conform with git's style.

[RFC] clang-format: outline the git project's coding style

2017-08-07 Thread Brandon Williams
Add a '.clang-format' file which outlines the git project's coding style. This can be used with clang-format to auto-format .c and .h files to conform with git's style. Signed-off-by: Brandon Williams <bmw...@google.com> --- I'm sure this sort of thing comes up every so often on th

Re: [PATCH v2 10/15] diff: stop allowing diff to have submodules configured in .git/config

2017-08-04 Thread Brandon Williams
On 08/03, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Traditionally a submodule is comprised of a gitlink as well as a > > corresponding entry in the .gitmodules file. Diff doesn't follow this > > paradigm as its config callback ro

Re: [PATCH v2 02/15] submodule: don't use submodule_from_name

2017-08-04 Thread Brandon Williams
On 08/03, Stefan Beller wrote: > On Thu, Aug 3, 2017 at 11:19 AM, Brandon Williams <bmw...@google.com> wrote: > > The function 'submodule_from_name()' is being used incorrectly here as a > > submodule path is being used instead of a submodule name. Since the > &

Re: [PATCH] clone: teach recursive clones to respect -q

2017-08-04 Thread Brandon Williams
On 08/04, Junio C Hamano wrote: > Brandon Williams <bmw...@google.com> writes: > > > Teach 'git clone --recurse-submodules' to respect the '-q' option by > > passing down the quiet flag to the process which handles cloning of > > submodules. > > >

[PATCH] clone: teach recursive clones to respect -q

2017-08-03 Thread Brandon Williams
Teach 'git clone --recurse-submodules' to respect the '-q' option by passing down the quiet flag to the process which handles cloning of submodules. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/clone.c| 3 +++ t/t7400-submodule-basic.sh | 6 ++ 2 files c

[PATCH v2 01/15] t7411: check configuration parsing errors

2017-08-03 Thread Brandon Williams
Check for configuration parsing errors in '.gitmodules' in t7411, which is explicitly testing the submodule-config subsystem, instead of in t7400. Also explicitly use the test helper instead of relying on the gitmodules file from being read in status. Signed-off-by: Brandon Williams <

[PATCH v2 02/15] submodule: don't use submodule_from_name

2017-08-03 Thread Brandon Williams
-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/submodule.c b/submodule.c index 5139b9256..19bd13bb2 100644 --- a/submodule.c +++ b/submodule.c @@ -1177,8 +1177,6 @@ static int get_next_submodule(struct child_proce

[PATCH v2 00/15] submodule-config cleanup

2017-08-03 Thread Brandon Williams
is all update-clone needed). Brandon Williams (15): t7411: check configuration parsing errors submodule: don't use submodule_from_name add, reset: ensure submodules can be added or reset submodule--helper: don't overlay config in remote_submodule_branch submodule--helper: don't overlay

[PATCH v2 11/15] submodule-config: remove support for overlaying repository config

2017-08-03 Thread Brandon Williams
All callers have been migrated to explicitly read any configuration they need. The support for handling it automatically in submodule-config is no longer needed. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule-config.h | 1 - t/helper/test-submodule-co

[PATCH v2 10/15] diff: stop allowing diff to have submodules configured in .git/config

2017-08-03 Thread Brandon Williams
to be consistent with how the submodule-config is populated, via calling 'gitmodules_config()' or 'repo_read_gitmodules()'. Signed-off-by: Brandon Williams <bmw...@google.com> --- diff.c| 3 --- t/t4027-diff-submodule.sh | 67

[PATCH v2 04/15] submodule--helper: don't overlay config in remote_submodule_branch

2017-08-03 Thread Brandon Williams
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directly for the branch field. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 15 +++ 1 file changed, 11 insertions

[PATCH v2 13/15] submodule-config: lazy-load a repository's .gitmodules file

2017-08-03 Thread Brandon Williams
the submodule-config system before using it, so instead let's perform lazy-loading of the submodule-config system. Remove the calls to reading the gitmodules file from ls-files to show that lazy-loading the .gitmodules file works. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/ls-f

[PATCH v2 06/15] fetch: don't overlay config with submodule-config

2017-08-03 Thread Brandon Williams
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directly for the fetch_recurse field. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/fetch.c | 1 - submodule.c | 24 +--- 2

[PATCH v2 15/15] submodule: remove gitmodules_config

2017-08-03 Thread Brandon Williams
Now that the submodule-config subsystem can lazily read the gitmodules file we no longer need to explicitly pre-read the gitmodules by calling 'gitmodules_config()' so let's remove it. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/checkout.c | 1 - b

[PATCH v2 07/15] submodule: don't rely on overlayed config when setting diffopts

2017-08-03 Thread Brandon Williams
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directory for the ignore field. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-)

[PATCH v2 09/15] submodule: remove submodule_config callback routine

2017-08-03 Thread Brandon Williams
of the submodule-config. This also makes it more difficult to accidentally add non-submodule specific configuration to the .gitmodules file. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.c | 1 - submodule.c | 25 ++--- submo

[PATCH v2 12/15] submodule-config: move submodule-config functions to submodule-config.c

2017-08-03 Thread Brandon Williams
Migrate the functions used to initialize the submodule-config to submodule-config.c so that the callback routine used in the initialization process can be static and prevent it from being used outside of initializing the submodule-config through the main API. Signed-off-by: Brandon Williams <

[PATCH v2 14/15] unpack-trees: improve loading of .gitmodules

2017-08-03 Thread Brandon Williams
. Because of this let's not rely on callers of 'check_updates()' to read the gitmodules file before calling 'check_updates()' and handle the reading explicitly. Signed-off-by: Brandon Williams <bmw...@google.com> --- unpack-trees.c | 43 +++ 1 file c

[PATCH v2 08/15] unpack-trees: don't respect submodule.update

2017-08-03 Thread Brandon Williams
-tree, reset). Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/checkout.c | 2 +- submodule.c| 1 - unpack-trees.c | 38 -- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c

[PATCH v2 03/15] add, reset: ensure submodules can be added or reset

2017-08-03 Thread Brandon Williams
g. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/add.c | 1 + builtin/reset.c | 1 + 2 files changed, 2 insertions(+) diff --git a/builtin/add.c b/builtin/add.c index e888fb8c5..6f271512f 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -116,6 +116,7 @@ int add_file

[PATCH v2 05/15] submodule--helper: don't overlay config in update-clone

2017-08-03 Thread Brandon Williams
Don't rely on overlaying the repository's config on top of the submodule-config, instead query the repository's config directly for the url and the update strategy configuration. Signed-off-by: Brandon Williams <bmw...@google.com> --- builtin/submodule--helper.

[PATCH v4 10/10] grep: recurse in-process using 'struct repository'

2017-08-02 Thread Brandon Williams
Convert grep to use 'struct repository' which enables recursing into submodules to be handled in-process. Signed-off-by: Brandon Williams <bmw...@google.com> --- Documentation/git-grep.txt | 7 - builtin/grep.c | 396 ++--- c

[PATCH v4 05/10] submodule: remove submodule.fetchjobs from submodule-config parsing

2017-08-02 Thread Brandon Williams
. Remove the 'submodule.fetchjobs' configuration option from the general submodule-config parsing and instead rely on using the 'config_from_gitmodules()' in order to maintain backwards compatibility with this config being placed in the '.gitmodules' file. Signed-off-by: Brandon Williams <

[PATCH v4 09/10] submodule: merge repo_read_gitmodules and gitmodules_config

2017-08-02 Thread Brandon Williams
. Signed-off-by: Brandon Williams <bmw...@google.com> --- submodule.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/submodule.c b/submodule.c index 3b0e70c51..9d5eacaf9 100644 --- a/submodule.c +++ b/submodule.c @@ -230,23 +230,6 @

[PATCH v4 06/10] submodule: remove fetch.recursesubmodules from submodule-config parsing

2017-08-02 Thread Brandon Williams
Remove the 'fetch.recursesubmodules' configuration option from the general submodule-config parsing and instead rely on using 'config_from_gitmodules()' in order to maintain backwards compatibility with this config being placed in the '.gitmodules' file. Signed-off-by: Brandon Williams <

[PATCH v4 03/10] cache.h: add GITMODULES_FILE macro

2017-08-02 Thread Brandon Williams
Add a macro to be used when specifying the '.gitmodules' file and convert any existing hard coded '.gitmodules' file strings to use the new macro. Signed-off-by: Brandon Williams <bmw...@google.com> Signed-off-by: Stefan Beller <sbel...@google.com> --- cache.h| 1 + submodu

[PATCH v4 08/10] submodule: check for unmerged .gitmodules outside of config parsing

2017-08-02 Thread Brandon Williams
Add 'is_gitmodules_unmerged()' function which can be used to determine in the '.gitmodules' file is unmerged based on the passed in index instead of relying on a global variable which is set during the submodule-config parsing. Signed-off-by: Brandon Williams <bmw...@google.com> --- submo

<    5   6   7   8   9   10   11   12   13   14   >