Re: [PATCH 02/13] oidset2: create oidset subclass with object length and pathname

2017-09-22 Thread Brandon Williams
d objects in a partial/narrow > clone/fetch. > > Signed-off-by: Jeff Hostetler I think it may be better to create an 'oidmap' instead of an 'oidset+some specific other bits' that way, in the future, we have a generalized data structure which we can use to provide a

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

2017-09-22 Thread Brandon Williams
s what it got is not a ref), > and after the first call to process_dummy_ref() we'd be in the > "expecting ref (or other)" state---and the state transition can > happen in this caller, not in process_dummy_ref() or process_ref(). > > Inside process_dummy_ref() and process_ref(), there would be a call > to the same helper that notices and extracts the server capability > and stores it (or barfs against the second line that advertises the > capability, by noticing that server_capabilities is not NULL). > > Wouldn't that make the presentation of the state machine cleaner? I mentioned this when looking at v2 of this patch, that it would probably be cleaner to remove passing the state variable around the place and updating it inside a helper function. It would just make the logic simpler to follow if 'state' is updated directly instead of indirectly. -- Brandon Williams

Re: [PATCH 4/3] branch: fix "copy" to never touch HEAD

2017-09-22 Thread Brandon Williams
amp;& > git branch -C c1 c2 && > - test $(git rev-parse --abbrev-ref HEAD) = c2 > + test $(git rev-parse --abbrev-ref HEAD) = c1 > ' > > -test_expect_success 'git branch -C c1 c2 should add entries to > .git/logs/HEAD' ' > +test_expect_success 'git branch -C c1 c2 should never touch HEAD' ' > msg="Branch: copied refs/heads/c1 to refs/heads/c2" && > - grep "$msg$" .git/logs/HEAD > + ! grep "$msg$" .git/logs/HEAD > ' > > test_expect_success 'git branch -C master should work when master is checked > out' ' > -- > 2.14.1-929-g25eae544e9 > The rest of the patch lgtm. I agree that this is probably a better UI than without this patch. Especially since the vanilla behavior of git branch is to create a new branch without moving you to that new branch. -- Brandon Williams

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

2017-09-21 Thread Brandon Williams
switch (state) { > + case EXPECTING_REF: > + if (process_ref(&state, len, &list, flags, extra_have)) > + break; > + /* fallthrough */ > + case EXPECTING_SHALLOW: > + if (process_shallow(&state, 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(&ref->old_oid, &old_oid); > - *list = ref; > - list = &ref->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 wrote: > > > On Wed, 13 Sep 2017 14:54:43 -0700 > > Brandon Williams wrote: > > > > > A normal request to git-daemon is structured as > > > "command path/to/repo

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

2017-09-21 Thread Brandon Williams
ds to be stored 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^{}&

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

2017-09-20 Thread Brandon Williams
ture patch will introduce a version string sent by the server during its first response which can then cause a client to unnecessarily die if a 'capabilities^{}' line sent as the first ref. Teach 'get_remote_heads()' to instead die if a 'capabilities^{}' line is sent after a

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
bal protocol.version 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 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. > > > > Also introduce the

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 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 73bb33a94 (daemon: Strictly pa

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

2017-09-18 Thread Brandon Williams
te-index --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
quot; ' > + git clone . downstream_rename && > + ( > + 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
+ if (!submodule || > !unsorted_string_list_lookup(&changed_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(&submodule_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
rsion 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
ake. I do want 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 --- 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/interop/i5700-protocol

[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 ---

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

2017-09-13 Thread Brandon Williams
#x27; and having the server whitelist this envvar. Signed-off-by: Brandon Williams --- connect.c | 37 ++-- t/t5700-protocol-v1.sh | 223 + 2 files changed, 255 insertions(+), 5 deletions(-) create mode 100755 t/t5700-protocol-v1

[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 --- pkt-

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

2017-09-13 Thread Brandon Williams
tocol version being spoken. Signed-off-by: Brandon Williams --- 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 52c63ebfd..aebe77cc3 1

[PATCH 0/8] protocol transition

2017-09-13 Thread Brandon Williams
le://, ssh://, 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: int

[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 --- conn

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

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

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

2017-09-13 Thread Brandon Williams
o a server. 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 --- Documentation/config.txt | 16 +++ Documentation/git.txt| 5

Re: RFC v3: Another proposed hash function transition plan

2017-09-11 Thread Brandon Williams
cords > these "mechanically derivable but expensive to compute" pieces of > information incorrectly. > > I am leaning towards saying "yes, catching in fsck is enough" and > suggesting to add generation 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
K: this call 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 wrote: > > + > > + version = getenv("GIT_PROTOCOL"); > > + if (!strcmp(version, "2")) > > + upload_pack_v2(); > > + > > I

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

2017-08-30 Thread Brandon Williams
4 +- > repository.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
t; while (pathbuf.len && pathbuf.buf[pathbuf.len - 1] == '/') > strbuf_setlen(&pathbuf, pathbuf.len - 1); > > - if (!alt_odb_usable(&pathbuf, normalized_objdir)) { > + if (!alt_odb_usable(the_repository, &pathbuf, normalized_objdir)) { > strbuf_release(&pathbuf); > 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 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 > >> with > >>

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
en with a doubly-linked list. It's still > 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
whether we > >can safely pass the variables 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

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
t; git_config_clear(); > > out_free: > - if (lock) > - rollback_lock_file(lock); > + rollback_lock_file(&lock); > 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(&lock)); > 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
efs` from the > 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
> - removed = 1; > - if (!removed) { > - /* > - * All packed entries disappeared while we were > - * acquiring the lock. > - */ > - clear_packed_ref_cache(refs); > - return 0; > - } > - > - /* Write what remains */ > - return commit_packed_refs(&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
error(_("could not delete reference %s: %s"), > + refnames->items[0].string, err.buf); > + else > + error(_("could not delete references: %s"), err.buf); > + } > + > + ref_transaction_free(transaction); > + strbuf_release(&err); > + 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
atch-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
&& > >> + test_must_fail git push "$HTTPD_URL_USER_PASS/smart/test_repo.git" > >> +HEAD:scrub_err 2>stderr && > >> + grep "^error: failed to push 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 writes: > > > > > + /* If using a new version put that stuff here after a second > > > null byte */ > > > + strbuf_addch(&request, '\0

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 writes: > > > + /* If using a new version put that stuff here after a second > > null byte */ > > + strbuf_addch(&request, '\0'); > > + strbuf_addf(&request, "v

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

2017-08-25 Thread Brandon Williams
ext', that would help. I was hoping that we > could get it out to the masses 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 --- t/lib-proto-disable.sh | 1 + t/t5601-clone.sh | 10 +- t/t5602-clone-remote-exec.sh | 4 ++-- 3 files changed, 8 insertions

[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 --- http.c | 7 +++ t/t5551-http-fetch-smart.sh | 2 ++ 2 files changed, 9 insertions(+) diff --git a/http.c b/http.c index fa8666a21..504a14a5a 100644

[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 --- pkt-line.c | 21 + pkt-line.h | 1 + 2 files changed, 22 insertions(+) diff --git a/pkt-line.c b/pkt-line.c index cf98f371b..875524ab8 100644 --- a

[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 --- builtin/fetch-pack.c | 4 +- builtin/s

[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 --- pkt-line.c | 6 ++ pkt-line.h | 1 + 2 files changed, 7 insertions(+) diff --git a/pkt-line.c b/pkt

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

2017-08-24 Thread Brandon Williams
Signed-off-by: Brandon Williams --- 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(const char *var, const

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

2017-08-24 Thread Brandon Williams
#x27; and having the server whitelist this envvar. Signed-off-by: Brandon Williams --- connect.c | 31 ++- daemon.c | 28 +--- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/connect.c b/connect.c index 49b28b83b..d609267be 100

[RFC 0/7] transitioning to protocol v2

2017-08-24 Thread Brandon Williams
blems. Any comments/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 heade

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

2017-08-22 Thread Brandon Williams
quot;reset --hard" must > ignore the .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
ept cleaner as it only has a single 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
aps it should only init submodules who don't already have an explicit active flag set. > > > > I tried to make it work here: > > https://public-inbox.org/git/89ab8aa3-8e19-46ba-b169-d1ea4cf4a...@gmail.com/ > > (A) you need to set expect 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
refname: > > */ > > if (refs_verify_refname_available( > > - &refs->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(&changed_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(&submodule_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
7;, NULL, 0); > + link_alt_odb_entries(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 = &alt_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
ic void link_alt_odb_entries(const char *alt, int > len, int sep, > strbuf_release(&objdirbuf); > } > > -void read_info_alternates(const char * relative_base, int depth) > +static void read_info_alternates(const char * relative_base, int depth) > { > char

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 wrote: > >>Add a '.clang-format' file which outlines the git project's coding > >>style. This can be used with cl

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'

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

2017-08-14 Thread Brandon Williams
which option to tweak for that. I'm sure that the problem would fix itself if all the bit fields where defined on their own lines: unsigned force : 1; unsigned not_new : 1; ... etc ... I'm sure there are a bunch of other things that we'd need to tweak before this is ready to be used 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 --- .clang-format | 165 ++

[PATCH v2 0/2] clang-format

2017-08-14 Thread Brandon Williams
king to get it right. 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

[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 --- Makefile | 4 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index

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

2017-08-11 Thread Brandon Williams
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
gned pack_local:1, > - pack_keep:1, > - freshened:1, > - 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
until it finds 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 -- 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 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, then I can > >

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

2017-08-10 Thread Brandon Williams
he 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 > wrote: > > Hi Brandon, > > > > On Mon, 7 Aug 2017, Brandon Williams wrote: > > > >> Add a '.clang-format' file which outlines the git project's coding &

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 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 st

[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 --- I'm sure this sort of thing comes up every so often on the lis

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 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 routine falls back to

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 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 > > correct function to us

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

2017-08-04 Thread Brandon Williams
On 08/04, Junio C Hamano wrote: > Brandon Williams 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. > > > > Signe

[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 --- 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 Willia

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

2017-08-03 Thread Brandon Williams
ubmodule_from_name()'. Signed-off-by: Brandon Williams --- 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

[PATCH v2 00/15] submodule-config cleanup

2017-08-03 Thread Brandon Williams
determined from a string (which 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_submod

[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 --- submodule-config.h | 1 - t/helper/test-submodule-config.c | 6 t/t7411

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

2017-08-03 Thread Brandon Williams
havior in order to be consistent with how the submodule-config is populated, via calling 'gitmodules_config()' or 'repo_read_gitmodules()'. Signed-off-by: Brandon Williams --- 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 --- builtin/submodule--helper.c | 15 +++ 1 file changed, 11 insertions(+), 4 del

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

2017-08-03 Thread Brandon Williams
the boilerplate of initializing 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: Brando

[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 --- builtin/fetch.c | 1 - submodule.c | 24 +--- 2 files changed

[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 --- builtin/checkout.c | 1 - b

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

2017-08-03 Thread Brandon Williams
ry's config on top 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 --- builtin/submodule--helper.c | 1 - submodule.c | 25 ++--- submodu

[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
he entries. 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 --- unpack-trees.c | 43 +++

[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 --- submodule.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git

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

2017-08-03 Thread Brandon Williams
s which use the unpack-trees logic (checkout, read-tree, reset). Signed-off-by: Brandon Williams --- builtin/checkout.c | 2 +- submodule.c| 1 - unpack-trees.c | 38 -- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/built

[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 --- builtin/submodule--helper.c | 23 +++--

[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 --- 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_files_to_cache(const ch

[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 --- Documentation/git-grep.txt | 7 - builtin/grep.c | 396 ++--- cache.h

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

2017-08-02 Thread Brandon Williams
y's config. 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.

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

2017-08-02 Thread Brandon Williams
of a worktree before attempting to load the .gitmodules file. Signed-off-by: Brandon Williams --- 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 +++

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