Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
builtin/replace.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/builtin/replace.c b/builtin
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
diff.c | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/diff.c b/diff.c
index
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
combine-diff.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/combine-diff.c b/combine-diff.c
index bc08c4c5b
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
tempfile.c | 12 ++--
tempfile.h | 34 +-
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
builtin/remote.c | 66
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/builtin/remote.c
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams
---
apply.c | 54 +++---
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/apply.c b/apply.c
On 02/14, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > Rename C++ keyword in order to bring the codebase closer to being able
> > to be compiled with a C++ compiler.
> >
> > Signed-off-by: Brandon Williams
> > ---
>
> The patch is not a
() per file
>
> builtin/grep.c | 25 -
> grep.c | 8 ++--
> 2 files changed, 18 insertions(+), 15 deletions(-)
>
> --
> 2.15.1
>
--
Brandon Williams
asier to write the patches (which most of them are already written)
and to review because you can use the #define trick to make some sort of
guarantees.
After we have successfully completed the migration to f(repo), then we
can revisit the subsystems which want to have a clearer abstraction
layer and make the jump to f(repo->object_store).
--
Brandon Williams
pd
>
> @@ -260,6 +269,15 @@ test_expect_success 'push options work properly across
> http' '
> test_cmp expect actual
> '
>
> +test_expect_success 'push options keep quoted characters intact (http)' '
> + mk_http_pair true &&
> +
> + test_commit -C test_http_clone one &&
> + git -C test_http_clone push --push-option="\"embedded quotes\"" origin
> master &&
> + echo "\"embedded quotes\"" >expect &&
> + test_cmp expect
> "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options
> +'
> +
> stop_httpd
>
> test_done
> --
> 2.16.2.552.gea2a3cf654
--
Brandon Williams
Update the documentation for the 'submodule.recurse' config to identify
that the clone command does not respect it.
Signed-off-by: Brandon Williams
---
Documentation/config.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Doc
On 02/06, Brandon Williams wrote:
> Changes in v3:
> * There were some comments about how the protocol should be designed
>stateless first. I've made this change and instead of having to
>supply the `stateless-rpc=true` capability to force stateless
>behavio
ause cache.h includes
> repository.h which in turn includes the object-store.h
Nice. Always love seeing cache.h get smaller
--
Brandon Williams
for (alt = alt_odb_list; alt; alt = alt->next)
> + for (alt = the_repository->objects.alt_odb_list;
> + alt; alt = alt->next)
Indentation on this line looks odd.
--
Brandon Williams
_odb_list);
> + o->alt_odb_list = o->alt_odb_list->next;
> + }
> +}
> +
> void raw_object_store_clear(struct raw_object_store *o)
> {
> free(o->objectdir);
> +
> + free_alt_odbs(o);
> + o->alt_odb_tail = NULL;
> }
> --
> 2.16.1.291.g4437f3f132-goog
>
--
Brandon Williams
ca598d6..6a2c57045c 100644
> --- a/packfile.h
> +++ b/packfile.h
> @@ -63,7 +63,7 @@ extern void close_pack_index(struct packed_git *);
>
> extern unsigned char *use_pack(struct packed_git *, struct pack_window **,
> off_t, unsigned long *);
> extern void close_pack_windows(struct packed_git *);
> -extern void close_all_packs(void);
> +extern void close_all_packs(struct raw_object_store *o);
> extern void unuse_pack(struct pack_window **);
> extern void clear_delta_base_cache(void);
> extern struct packed_git *add_packed_git(const char *path, size_t path_len,
> int local);
> --
> 2.16.1.291.g4437f3f132-goog
>
--
Brandon Williams
_count = count;
> }
> - return count;
> + return the_repository->objects.approximate_object_count;
> }
>
> static void *get_next_packed_git(const void *p)
> @@ -901,7 +900,7 @@ void prepare_packed_git(void)
>
> void reprepare_packed_git(void)
> {
> - approximate_object_count_valid = 0;
> + the_repository->objects.approximate_object_count_valid = 0;
> the_repository->objects.packed_git_initialized = 0;
> prepare_packed_git();
> }
> --
> 2.16.1.291.g4437f3f132-goog
>
--
Brandon Williams
ive_base,
> - int depth)
> +static void read_info_alternates(struct repository *r,
> + const char *relative_base,
> + int depth)
> {
> char *path;
> struct strbuf buf = STRBUF_INIT;
> @@ -516,7 +512,7 @@ static void read_info_alternates_the_repository(const
> char *relative_base,
> return;
> }
>
> - link_alt_odb_entries(the_repository, buf.buf, '\n', relative_base,
> depth);
> + link_alt_odb_entries(r, buf.buf, '\n', relative_base, depth);
> strbuf_release(&buf);
> free(path);
> }
> --
> 2.16.1.291.g4437f3f132-goog
>
--
Brandon Williams
le.h or
something like that at some point as that seems like a better place for
the function than in the object-store.h file?
--
Brandon Williams
o 'type_name'
>
> Avoid using identifiers that clash with C++ keywords. Even though
> it is not a goal to compile Git with C++ compilers, changes like
> this help use of code analysis tools that targets C++ on our
> codebase.
>
> Is the 'fixup!' cleanly squashable to the problematic one, or does
> this series require another reroll to get it in a good enough shape?
Yeah the fixup patch looks good to me. I don't think there was anything
else that needed attention so it should be in good shape with the fixup
patch.
--
Brandon Williams
hrough the code and couldn’t determine it one way or
> another, but my money is on that looking something like `000aversion 1\n` on
> the wire.
Yes the version string goes along with the ref_list in v1 like so:
# service=
version 1
ref_list
This is because it is part of the payload which is actually delivered to
the git fetch/push binary where as the "# service" bit is used by the
remote helper to identify smart vs not smart servers.
>
> --
> Dorian Taylor
> Make things. Make sense.
> https://doriantaylor.com
>
--
Brandon Williams
On 02/22, Jeff King wrote:
> On Wed, Feb 21, 2018 at 01:44:22PM -0800, Jonathan Tan wrote:
>
> > On Tue, 6 Feb 2018 17:12:41 -0800
> > Brandon Williams wrote:
> >
> > > In order to allow for code sharing with the server-side of fetch in
> > > proto
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:45 -0800
> Brandon Williams wrote:
>
> > - get_remote_heads(fd[0], NULL, 0, &ref, 0, NULL, &shallow);
> > +
> > + packet_reader_init(&reader, fd[0], NULL, 0,
> > +
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:51 -0800
> Brandon Williams wrote:
>
> > +extern struct ref **get_remote_refs(int fd_out, struct packet_reader
> > *reader,
> > + struct ref **list, int for_push,
> > +
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:52 -0800
> Brandon Williams wrote:
>
> > @@ -21,7 +22,8 @@ struct transport_vtable {
> > * the ref without a huge amount of effort, it should store it
> > * in the ref's old_sha1 fie
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:53 -0800
> Brandon Williams wrote:
>
> > -const struct ref *transport_get_remote_refs(struct transport *transport)
> > +const struct ref *transport_get_remote_refs(struct
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:13:05 -0800
> Brandon Williams wrote:
>
> > Introduce the transport-helper capability 'stateless-connect'. This
> > capability indicates that the transport-helper can be requested to run
> > the
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:57 -0800
> Brandon Williams wrote:
>
> > +want
> > + Indicates to the server an object which the client wants to
> > + retrieve.
>
> Mention that the client can "want" anything e
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:13:07 -0800
> Brandon Williams wrote:
>
> > Make a copy of the service name being requested instead of relying on
> > the buffer pointed to by the passed in 'const char *' to remain
> > unchanged.
>
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:13:09 -0800
> Brandon Williams wrote:
>
> > @@ -172,6 +172,8 @@ struct http_get_options {
> > * for details.
> > */
> > struct strbuf *base_url;
> > +
> > + struct string_list *e
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:13:12 -0800
> Brandon Williams wrote:
>
> > +test_expect_success 'push with http:// and a config of v2 does not request
> > v2' '
> > + # Till v2 for push is designed, make sure that if a client
On 02/22, Brandon Williams wrote:
> On 02/21, Jonathan Tan wrote:
> > On Tue, 6 Feb 2018 17:13:12 -0800
> > Brandon Williams wrote:
> >
> > > +test_expect_success 'push with http:// and a config of v2 does not
> > > request v2' '
>
On 02/22, Stefan Beller wrote:
> On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote:
> > One of the design goals of protocol-v2 is to improve the semantics of
> > flush packets. Currently in protocol-v1, flush packets are used both to
> > indicate a break in a list of pa
On 02/22, Stefan Beller wrote:
> On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote:
> > Factor out the logic for processing shallow, deepen, deepen_since, and
> > deepen_not lines into their own functions to simplify the
> > 'receive_needs()' function in additi
On 02/22, Jonathan Tan wrote:
> On Thu, 22 Feb 2018 10:26:47 -0800
> Brandon Williams wrote:
>
> > On 02/21, Jonathan Tan wrote:
> > > On Tue, 6 Feb 2018 17:12:53 -0800
> > > Brandon Williams wrote:
> > >
> > > > -const
On 02/22, Jeff King wrote:
> On Tue, Feb 06, 2018 at 05:12:50PM -0800, Brandon Williams wrote:
>
> > +ls-refs takes in the following parameters wrapped in packet-lines:
> > +
> > +symrefs
> > + In addition to the object pointed by it, show the underlying
On 02/23, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:13:00 -0800
> Brandon Williams wrote:
>
> > @@ -1090,6 +1110,10 @@ static int send_fetch_request(int fd_out, const
> > struct fetch_pack_args *args,
> > if (prefer_ofs_delta)
> > pack
em builtins, because it
doesn't make much sense for v2 to straddle that line. I mean you could
do some complicated advertising of commands based on the endpoint you
hit, but then what does that mean if you're hitting the git-serve
endpoint where you should presumably be able to do any operation.
--
Brandon Williams
On 02/22, Stefan Beller wrote:
> On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote:
>
> > +static void pack_line(const char *line)
> > +{
> > + if (!strcmp(line, "") || !strcmp(line, "\n"))
>
> From our in-office discussion:
e
> die (_("The server uses a different protocol version than we can
> speak: %s\n"),
> reader->line);
> so I would think here it is reasonable to add _(translation).
This should be a BUG as it shouldn't ever be unknown at this point. And
I'll also drop that comment.
--
Brandon Williams
On 02/21, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:49 -0800
> Brandon Williams wrote:
>
> > .gitignore | 1 +
> > Documentation/technical/protocol-v2.txt | 114 +++
> > Makefile
On 02/22, Jeff King wrote:
> On Tue, Feb 06, 2018 at 05:12:49PM -0800, Brandon Williams wrote:
>
> > +In protocol v2 communication is command oriented. When first contacting a
> > +server a list of capabilities will advertised. Some of these capabilities
> > +will be com
On 02/23, Stefan Beller wrote:
> On Fri, Feb 23, 2018 at 1:30 PM, Brandon Williams wrote:
> > On 02/22, Stefan Beller wrote:
> >> > +static enum protocol_version discover_version(struct packet_reader
> >> > *reader)
> >> > +{
> >> ...
>
On 02/23, Stefan Beller wrote:
> On Wed, Feb 21, 2018 at 4:51 PM, Brandon Williams wrote:
> > On 02/20, Stefan Beller wrote:
> >> Add a repository argument to allow sha1_file_name callers to be more
> >> specific about which repository to handle. This is a small mechani
g without a repository, assuming SHA-1 hash"));
> > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
> > + }
>
> Again, same concern. I can imagine scripts that will blow up loudly if
> git diff --no-index spews things to standard error.
>
> I'm not opposed to making this more visible, but I wonder if maybe it
> should only be visible to developers or such. The only way I can think
> of doing is that is with an advice options, but maybe there's a better
> way.
> --
> brian m. carlson / brian with sandals: Houston, Texas, US
> https://www.crustytoothpaste.net/~bmc | My opinion only
> OpenPGP: https://keybase.io/bk2204
--
Brandon Williams
On 02/22, Brandon Williams wrote:
> On 02/22, Jeff King wrote:
> > On Tue, Feb 06, 2018 at 05:12:50PM -0800, Brandon Williams wrote:
> >
> > > +ls-refs takes in the following parameters wrapped in packet-lines:
> > > +
> > > +symrefs
> > >
> > + the_repository->index = &the_index;
> > + repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
> > +}
>
> I see what you did here, and I like it.
I thought this would be a good idea to do eventually but back when I
first introduced struct repository there wasn't enough to justify it
till now. This definitely makes it much easier to read the
initialization and I prefer this over the initializer. Thanks for
working on this :)
--
Brandon Williams
On 02/23, Jonathan Tan wrote:
> On Tue, 6 Feb 2018 17:12:58 -0800
> Brandon Williams wrote:
>
> > + while ((oid = get_rev())) {
> > + packet_buf_write(req_buf, "have %s\n", oid_to_hex(oid));
> > + if (++haves_added >= INIT
pports infix matching, or maybe
> we'll never need it. :)
>
> Sincerely,
> Jonathan
>
> [1]
> https://public-inbox.org/git/CAJo=hjszcam9sipdvr7tmd-fd2v2w6_pvmq791egcdsdkq0...@mail.gmail.com/#t
--
Brandon Williams
e
interface as similar as possible to make it easy to convert to using it
as well as having no need to clean anything up (because the struct is
really just a wrapper and doesn't own anything).
--
Brandon Williams
On 02/26, Jonathan Nieder wrote:
> Brandon Williams wrote:
>
> > Remove code duplication and use the existing 'get_refs_via_connect()'
> > function to retrieve a remote's heads in 'fetch_refs_via_pack()' and
> > 'git_trans
On 02/27, Jonathan Tan wrote:
> On Fri, 23 Feb 2018 13:33:15 -0800
> Brandon Williams wrote:
>
> > On 02/21, Jonathan Tan wrote:
> > > As someone who is implementing the server side of protocol V2 in JGit, I
> > > now have a bit more insight into this :-)
> &g
On 02/26, Jonathan Nieder wrote:
> Hi,
>
> Brandon Williams wrote:
>
> > Introduce protocol_v2, a new value for 'enum protocol_version'.
> > Subsequent patches will fill in the implementation of protocol_v2.
> >
> > Signed-off-by: Brandon Williams
3 @@ struct upload_pack_data {
> > struct object_array wants;
> > struct oid_array haves;
> >
> > + struct object_array shallows;
> > + struct string_list deepen_not;
> > + int depth;
> > + timestamp_t deepen_since;
> > + int deepen_rev_list;
> > + int deepen_relative;
>
> Nice.
>
> Comments describing deepen_Rev_list and deepen_relative would be nice.
>
> Are those boolean? Can they be unsigned:1 to make that
> self-explanatory?
They are boolean but are passed via reference at some points so they
can't be bit flags.
>
> [...]
> > @@ -1080,12 +1101,14 @@ struct upload_pack_data {
> > unsigned done : 1;
> > };
> >
> > -#define UPLOAD_PACK_DATA_INIT { OBJECT_ARRAY_INIT, OID_ARRAY_INIT, 0, 0,
> > 0, 0, 0, 0 }
> > +#define UPLOAD_PACK_DATA_INIT { OBJECT_ARRAY_INIT, OID_ARRAY_INIT,
> > OBJECT_ARRAY_INIT, STRING_LIST_INIT_DUP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
>
> Long line, "make style" should be able to fix it.
>
I'll fix this.
--
Brandon Williams
On 02/26, Jonathan Nieder wrote:
> Brandon Williams wrote:
> > static char *server_capabilities;
> > +static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT;
>
> Can a quick doc comment describe these and how they relate?
>
> Is only one of them set, base
int fd[2],
> > + const struct ref *orig_ref,
> > + struct ref **sought, int nr_sought,
> > + char **pack_lockfile)
> > +{
> > + struct ref *ref = copy_ref_list(orig_ref);
> > + enum fetch_state state = FETCH_CHECK_LOCAL;
> > + struct oidset common = OIDSET_INIT;
> > + struct packet_reader reader;
> > + int in_vain = 0;
> > + packet_reader_init(&reader, fd[0], NULL, 0,
> > + PACKET_READ_CHOMP_NEWLINE);
> > +
> > + while (state != FETCH_DONE) {
> > + switch (state) {
> > + case FETCH_CHECK_LOCAL:
> > + sort_ref_list(&ref, ref_compare_name);
> > + QSORT(sought, nr_sought, cmp_ref_by_name);
> > +
> > + /* v2 supports these by default */
>
> Is there a doc that says what is all on by default?
Yeah protocol-v2.txt should say all of that.
>
> Thanks,
> Stefan
--
Brandon Williams
On 02/27, Jonathan Nieder wrote:
> Brandon Williams wrote:
> > On 02/26, Jonathan Nieder wrote:
> >> Brandon Williams wrote:
>
> >>> +++ b/transport.c
> >>> @@ -230,12 +230,8 @@ static int fetch_refs_via_pack(struct transport
> >>&
t_path_from_env(INDEX_ENVIRONMENT, repo->gitdir,
> - "index", !repo->ignore_env);
> -}
> -
> static void expand_base_dir(char **out, const char *in,
> const char *base_dir, const char *def_in)
> {
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
et_gitdir(struct repository *repo,
> + const char *root,
> + const struct set_gitdir_args *optional);
> extern void repo_set_worktree(struct repository *repo, const char *path);
> extern void repo_set_hash_algo(struct repository *repo, int algo);
> extern int repo_init(struct repository *repo, const char *gitdir, const char
> *worktree);
> diff --git a/setup.c b/setup.c
> index c5d55dcee4..6fac1bb58a 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -1116,8 +1116,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
> const char *gitdir = getenv(GIT_DIR_ENVIRONMENT);
> if (!gitdir)
> gitdir = DEFAULT_GIT_DIR_ENVIRONMENT;
> - repo_set_gitdir(the_repository, gitdir);
> - setup_git_env();
> + setup_git_env(gitdir);
> }
> if (startup_info->have_repository)
> repo_set_hash_algo(the_repository, repo_fmt.hash_algo);
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
*cb)
>
> void prepare_alt_odb(struct repository *r)
> {
> - const char *alt;
> -
> if (r->objects.alt_odb_tail)
> return;
>
> - alt = getenv(ALTERNATE_DB_ENVIRONMENT);
> -
> r->objects.alt_odb_tail = &r->objects.alt_odb_list;
> - link_alt_odb_entries(r, alt, PATH_SEP, NULL, 0);
> + link_alt_odb_entries(r, r->objects.alternate_db, PATH_SEP, NULL, 0);
>
> read_info_alternates(r, r->objects.objectdir, 0);
> }
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
e but
initializing a repo object otherwise you would have had a bit more
difficult time getting rid of it :)
Thanks!
>
> /* Indicate if a repository has a different 'commondir' from 'gitdir' */
> unsigned different_commondir:1;
> --
> 2.16.1.435.g8f24da2e1a
>
--
Brandon Williams
> since we have been changing the protocol.version number to a new value
> like 20180226 each time a minor tweak to the protocolv2 RFC occured.
>
> The bit I have doubts about is whether to warn. What do you think?
Patch looks good to me. And I don't have a strong preference either way
for whether to warn or not.
--
Brandon Williams
On 02/27, Jonathan Nieder wrote:
> Brandon Williams wrote:
>
> > Add the 'packet_buf_write_len()' function which allows for writing an
> > arbitrary length buffer into a 'struct strbuf' and formatting it in
> > packet-line format.
>
> Makes se
On 02/28, Duy Nguyen wrote:
> On Wed, Feb 28, 2018 at 8:02 AM, Brandon Williams wrote:
> > On 02/27, Jonathan Nieder wrote:
> >> If I share my .gitconfig or .git/config file between multiple machines
> >> (or between multiple Git versions on a single machine) and se
ns
> sha1_file.c: move delayed getenv(altdb) back to setup_git_env()
> repository: delete ignore_env member
>
> cache.h| 2 +-
> environment.c | 31 +--
> object-store.h | 5 ++-
> object.c | 1 +
> repository.c | 84 --
> repository.h | 21 +++--
> setup.c| 3 +-
> sha1_file.c| 6 +---
> 8 files changed, 87 insertions(+), 66 deletions(-)
>
> --
> 2.16.1.399.g632f88eed1
>
--
Brandon Williams
On 02/27, Jonathan Nieder wrote:
> Brandon Williams wrote:
>
> > Introduce the transport-helper capability 'stateless-connect'. This
> > capability indicates that the transport-helper can be requested to run
> > the 'stateless-connect' command
On 02/27, Jonathan Nieder wrote:
> Hi,
>
> Brandon Williams wrote:
>
> > Teach remote-curl the 'stateless-connect' command which is used to
> > establish a stateless connection with servers which support protocol
> > version 2. This allows remote-
In order to allow for code sharing with the server-side of fetch in
protocol-v2 convert upload-pack to be a builtin.
Signed-off-by: Brandon Williams
---
Makefile | 3 +-
builtin.h | 1 +
builtin/upload-pack.c | 67 ++
git.c
x27;t
use objects from configured alternates.
Brandon Williams (35):
pkt-line: introduce packet_read_with_status
pkt-line: allow peeking a packet line without consuming it
pkt-line: add delim packet support
upload-pack: convert to a builtin
upload-pack: factor out processing lines
transport:
st line
without consuming the first ref sent in the protocol_v0 case so that the
protocol version the server is speaking can be determined outside of
'get_remote_heads()' in a future patch.
Signed-off-by: Brandon Williams
---
connect.c | 173 ++-
_status'
type. This allows for easily identifying between special and normal
packets as well as errors. It also enables easily adding a new special
packet in the future.
Signed-off-by: Brandon Williams
---
pkt-line.c | 55 --
pkt-line.h | 16
Introduce a packet-line test helper which can either pack or unpack an
input stream into packet-lines and writes out the result to stdout.
Signed-off-by: Brandon Williams
---
Makefile | 1 +
t/helper/test-pkt-line.c | 64
2 files changed
Remove code duplication and use the existing 'get_refs_via_connect()'
function to retrieve a remote's heads in 'fetch_refs_via_pack()' and
'git_transport_push()'.
Signed-off-by: Brandon Williams
---
transport.c | 18 --
1 file changed, 4 i
Factor out the logic for processing shallow, deepen, deepen_since, and
deepen_not lines into their own functions to simplify the
'receive_needs()' function in addition to making it easier to reuse some
of this logic when implementing protocol_v2.
Signed-off-by: Brandon Williams
-
eserved to indicate the end of a response.
Documentation for how this packet will be used in protocol v2 will
included in a future patch.
Signed-off-by: Brandon Williams
---
pkt-line.c | 17 +
pkt-line.h | 3 +++
2 files changed, 20 insertions(+)
diff --git a/pkt-line.c b/pkt-li
t the completion of a command, a client can request that
another command be executed or can terminate the connection by sending a
flush packet.
Signed-off-by: Brandon Williams
---
.gitignore | 1 +
Documentation/technical/protocol-v2.txt | 171
Mak
enables a caller to be able to peek a single line at a time
using 'packet_reader_peek()' and having a caller consume a line by
calling 'packet_reader_read()'.
Signed-off-by: Brandon Williams
---
pkt-line.c | 59 +
ned-off-by: Brandon Williams
---
transport.c | 35 ++-
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/transport.c b/transport.c
index 63c3dbab9..2378dcb38 100644
--- a/transport.c
+++ b/transport.c
@@ -118,6 +118,7 @@ struct git_transport_data {
Introduce protocol_v2, a new value for 'enum protocol_version'.
Subsequent patches will fill in the implementation of protocol_v2.
Signed-off-by: Brandon Williams
---
builtin/fetch-pack.c | 2 ++
builtin/receive-pack.c | 6 ++
builtin/send-pack.c| 3 +++
builtin/upload-p
ned-off-by: Brandon Williams
---
builtin/fetch-pack.c | 16 +++-
builtin/send-pack.c | 17 +++--
connect.c| 27 ++-
connect.h| 3 +++
remote-curl.c| 20 ++--
remote.h | 5 +++--
transport.c
Teach the client to be able to request a remote's refs using protocol
v2. This is done by having a client issue a 'ls-refs' request to a v2
server.
Signed-off-by: Brandon Williams
---
builtin/upload-pack.c | 10 +--
connect.c
fs it sends based on the sent patterns.
Signed-off-by: Brandon Williams
---
transport-helper.c | 5 +++--
transport-internal.h | 9 -
transport.c | 16 +---
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/transport-helper.c b/transport-help
Construct a list of ref patterns to be passed to 'get_refs_list()' from
the refspec to be used during the push. This list of ref patterns will
be used to allow the server to filter the ref advertisement when
communicating using protocol v2.
Signed-off-by: Brandon Williams
---
transp
based on provided ref-patterns.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 36 ++
Makefile| 1 +
ls-refs.c | 144
ls-refs.h | 9
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
When communicating with a v2 server, perform a fetch by requesting the
'fetch' command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 68 +-
builtin/fetch-pack.c| 2 +-
fetch-pack.c
When an http info/refs request is made, requesting that protocol v2 be
used, don't send a "# service" line since this line is not part of the
v2 spec.
Signed-off-by: Brandon Williams
---
http-backend.c | 8 ++--
remote-curl.c | 3 +++
2 files changed, 9 insertions(+), 2 del
as a pass through to convert requests to http.
Signed-off-by: Brandon Williams
---
remote-curl.c | 205 -
t/t5702-protocol-v2.sh | 45 +
2 files changed, 249 insertions(+), 1 deletion(-)
diff --git a/remote-curl.c b/remote-curl.c
index
ful in the next patch where we can have centralized
logic which determines if we need to request a different protocol
version than what the user has configured.
Signed-off-by: Brandon Williams
---
connect.c | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
di
Enable shallow clones and deepen requests using protocol version 2 if
the server 'fetch' command supports the 'shallow' feature.
Signed-off-by: Brandon Williams
---
connect.c| 22
connect.h| 2 +
was removed the parameter
was no longer necessary but wasn't removed. Clean up 'recvline_fh()'
parameter list by removing the 'name' parameter.
Signed-off-by: Brandon Williams
---
transport-helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t
Make a copy of the service name being requested instead of relying on
the buffer pointed to by the passed in 'const char *' to remain
unchanged.
Currently, all service names are string constants, but a subsequent
patch will introduce service names from external sources.
Signed-off-b
Add a way for callers to request that extra headers be included when
making http requests.
Signed-off-by: Brandon Williams
---
http.c | 8
http.h | 7 +++
2 files changed, 15 insertions(+)
diff --git a/http.c b/http.c
index 597771271..e1757d62b 100644
--- a/http.c
+++ b/http.c
Introduce the 'fetch' server command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 128
serve.c | 2 +
t/t5701-git-serve.sh| 1 +
upload-pack.c
Instead of always sending the Git-Protocol header with the configured
version with every http request, explicitly send it when discovering
refs and then only send it on subsequent http requests if the server
understood the version requested.
Signed-off-by: Brandon Williams
---
http.c
y in our
http remote-helper (remote-curl) so that protocol v2 can be used using
the http transport.
Signed-off-by: Brandon Williams
---
Documentation/gitremote-helpers.txt | 32 +
transport-helper.c | 11 ++
transport.c
Convert 'transport_get_remote_refs()' to optionally take a list of ref
patterns.
Signed-off-by: Brandon Williams
---
builtin/clone.c | 2 +-
builtin/fetch.c | 4 ++--
builtin/ls-remote.c | 2 +-
builtin/remote.c| 2 +-
transport.c | 7 +--
transport.h
Construct an argv_array of the ref patterns supplied via the command
line and pass them to 'transport_get_remote_refs()' to be used when
communicating protocol v2 so that the server can limit the ref
advertisement based on the supplied patterns.
Signed-off-by: Brandon Williams
---
27;receive-pack' endpoint and fall back to
using v0, but when push v2 is rolled out to servers, the 'receive-pack'
endpoint will start responding using v2. So we don't want to get into a
state where a client is requesting to push with v2 before they actually
know how to pus
Add the 'packet_buf_write_len()' function which allows for writing an
arbitrary length buffer into a 'struct strbuf' and formatting it in
packet-line format.
Signed-off-by: Brandon Williams
---
pkt-line.c | 16
pkt-line.h | 1 +
2 files changed, 17 inserti
1801 - 1900 of 2393 matches
Mail list logo