ly reading the index during the setup of diff-tree.
Reported-by: Ben Boeckel
Signed-off-by: Brandon Williams
---
builtin/diff-tree.c| 2 ++
t/t4015-diff-whitespace.sh | 17 +
2 files changed, 19 insertions(+)
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index d66
On 12/06, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > 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_tran
On 12/07, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > @@ -193,7 +195,17 @@ int cmd_fetch_pack(int argc, const char **argv, const
> > char *prefix)
> > if (!conn)
> > return args.diag_url ? 0 : 1;
> > }
> >
cleanup by adding in
'test_when_finished' lines to do the removals? Just a thought.
> + test_create_repo repo &&
> + test_commit -C repo my_commit &&
> +
> + A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
> +
> + # Reference $A only from ref
> + git -C repo branch my_branch "$A" &&
> + promise_and_delete "$A" &&
> +
> + git -C repo config core.repositoryformatversion 1 &&
> + git -C repo config extensions.partialclone "arbitrary string" &&
> + git -C repo fsck
> +'
> +
> test_done
> --
> 2.9.3
>
--
Brandon Williams
On 12/07, Jonathan Tan wrote:
> On Thu, 7 Dec 2017 11:18:52 -0800
> Brandon Williams wrote:
>
> > Instead of requiring that every test first removes 'repo', maybe you
> > want to have each test do its own cleanup by adding in
> > 'test_when_finished&
t */
> + if (fetch_if_missing && repository_format_partial_clone &&
> + !already_retried) {
> + fetch_object(repository_format_partial_clone, real);
> + already_retried = 1;
> + continue;
> + }
> +
> + return -1;
> + }
>
> -found_packed:
> if (oi == &blank_oi)
> /*
>* We know that the caller doesn't actually need the
> --
> 2.9.3
>
--
Brandon Williams
On 12/07, Stefan Beller wrote:
> On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams wrote:
>
> > diff --git a/pkt-line.h b/pkt-line.h
> > index 3dad583e2..f1545929b 100644
> > --- a/pkt-line.h
> > +++ b/pkt-line.h
> > @@ -60,8 +60,16 @@ int write_packetized
On 12/07, Stefan Beller wrote:
> On Mon, Dec 4, 2017 at 3:58 PM, Brandon Williams wrote:
> > Sometimes it is advantageous to be able to peek the next packet line
> > without consuming it (e.g. to be able to determine the protocol version
> > a server is speaking). In order
On 12/07, Stefan Beller wrote:
> On Mon, Dec 4, 2017 at 3:58 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 12/07, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > While we could wrap the preamble into a function it sort of defeats the
> > purpose since you want to be able to call different functions based on
> > the protocol version you're speaking
On 12/06, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > 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
> > ---
>
> This looks
On 12/06, Junio C Hamano wrote:
> Brandon Williams writes:
>
>
> EXPECTING_DONE sounded like we are expecting to see 'done' packet
> sent from the other side, but I was mistaken. It is the state
> where we are "done" expecting anything ;-).
>
> Ha
On 12/07, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > +static struct protocol_capability *get_capability(const char *key)
> > +{
> > + int i;
> > +
> > + if (!key)
> > + return NULL;
> > +
> > + for (i = 0; i <
is a promised
object before you go out to contact the server to request it? You may
have already ruled this out for some reason I'm not aware of (maybe its
too costly to compute?).
--
Brandon Williams
> +
> int is_index_unborn(struct index_state *istate)
> {
> return (!istate->cache_nr && !istate->timestamp.sec);
> diff --git a/repository.c b/repository.c
> index bb2fae5446..928b1f553d 100644
> --- a/repository.c
> +++ b/repository.c
> @@ -229,5 +229,5 @@ int repo_read_index(struct repository *repo)
> if (!repo->index)
> repo->index = xcalloc(1, sizeof(*repo->index));
>
> - return read_index_from(repo->index, repo->index_file);
> + return read_index_for_repo(repo);
> }
> --
> 2.15.1.504.g5279b80103
>
--
Brandon Williams
continue; /* current index already taken care of */
> + if (repo_worktree_init(repo, wt))
> + BUG("couldn't initialize repository object from
> worktree");
>
> - if (read_index_from(&istate,
> - worktree_git_path(wt, "index")) > 0)
> - do_add_index_objects_to_pending(revs, &istate);
> - discard_index(&istate);
> + if (repo_read_index(repo) > 0)
> + do_add_index_objects_to_pending(revs, repo->index);
> + discard_index(repo->index);
One we have separate object stores per-repository how would we handle
this since this pruning should only work on a single repository's object
store?
> }
> free_worktrees(worktrees);
> }
> --
> 2.15.1.504.g5279b80103
>
--
Brandon Williams
>
> +test_expect_success 'local clone --shared from linked checkout' '
> + git -C bare worktree add --detach ../baretree &&
> + git clone --local --shared baretree bare-clone &&
> + grep /bare/ bare-clone/.git/objects/info/alternates
> +'
> +
> test_expect_success '"add" worktree with --no-checkout' '
> git worktree add --no-checkout -b swamp swamp &&
> ! test -e swamp/init.t &&
> --
> 2.15.1.502.gccaef8de57
>
--
Brandon Williams
On 12/11, Eric Sunshine wrote:
> On Mon, Dec 11, 2017 at 7:18 PM, Brandon Williams wrote:
> > On 12/11, Eric Sunshine wrote:
> >> struct strbuf alt = STRBUF_INIT;
> >> - strbuf_addf(&alt, "%s/objects", src_repo);
> &g
This series removes the remaining users of the index compatibility macros and
ensures that future uses of the macros will result in compiler errors.
Brandon Williams (3):
submodule: convert stage_updated_gitmodules to take a struct
index_state
submodule: used correct index in
stead of the
passed in 'struct index_state'. Fix this by changing the call to
'ie_match_stat()' and using the passed in index_state struct.
Signed-off-by: Brandon Williams
---
submodule.c | 5 +++--
submodule.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff
7;NO_THE_INDEX_COMPATIBILITY_MACROS' to prevent future users of
these macros in submodule.c.
Signed-off-by: Brandon Williams
---
builtin/fetch.c | 4 +++-
submodule.c | 23 +--
submodule.h | 10 ++
3 files changed, 22 insertions(+), 15 deletions(-)
diff -
Signed-off-by: Brandon Williams
---
builtin/mv.c | 2 +-
builtin/rm.c | 2 +-
submodule.c | 4 ++--
submodule.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/mv.c b/builtin/mv.c
index ffdd5f01a..cf3684d90 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -291,7
Signed-off-by: Brandon Williams
---
As promised here is an update to the documentation for the path generating
functions.
path.h | 133 ++---
1 file changed, 112 insertions(+), 21 deletions(-)
diff --git a/path.h b/path.h
index
nborn(struct index_state *istate)
> {
> return (!istate->cache_nr && !istate->timestamp.sec);
> diff --git a/repository.c b/repository.c
> index bb2fae5446..928b1f553d 100644
> --- a/repository.c
> +++ b/repository.c
> @@ -229,5 +229,5 @@ int repo_read_index(struct repository *repo)
> if (!repo->index)
> repo->index = xcalloc(1, sizeof(*repo->index));
>
> - return read_index_from(repo->index, repo->index_file);
> + return read_index_for_repo(repo);
> }
> --
> 2.15.1.620.gb9897f4670
>
--
Brandon Williams
1_hex);
+ base_path = xstrfmt("%s/sharedindex.%s", gitdir, base_sha1_hex);
ret = do_read_index(split_index->base, base_path, 1);
if (hashcmp(split_index->base_sha1, split_index->base->sha1))
die("broken index, expect %s in %s, got %s",
base_sha1_hex, base_path,
sha1_to_hex(split_index->base->sha1));
- freshen_shared_index(base_sha1_hex, 0);
+ freshen_shared_index(base_path, 0);
merge_base_index(istate);
post_read_index_from(istate);
+ free(base_path);
return ret;
--
Brandon Williams
On 12/18, Thomas Gummerer wrote:
> On 12/18, Brandon Williams wrote:
> > On 12/17, Thomas Gummerer wrote:
> > > repo_read_index calls read_index_from, which takes an path argument for
> > > the location of the index file. For the split index however it relies
> &
map incompletely here because oidset_insert()
> + * will call oidset_init() (which will call oidmap_init()), and
> + * oidset_contains() works as intended even before oidset_init() was called.
> + */
> +#define OIDSET_INIT { OIDMAP_INIT_INCOMPLETELY }
>
> /**
> * Returns true iff `set` contains `oid`.
>
> base-commit: 936d1b989416a95f593bf81ccae8ac62cd83f279
> --
> 2.15.1.windows.2
--
Brandon Williams
Ensure that an oidmap is initialized before attempting to add, remove,
or retrieve an entry by simply performing the initialization step
before accessing the underlying hashmap.
Signed-off-by: Brandon Williams
---
oidmap.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a
_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 | 15
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
---
connect.c | 101 -
remote.h
ned-off-by: Brandon Williams
---
builtin/fetch-pack.c | 16 +++-
builtin/send-pack.c | 17 +++--
connect.c| 15 ---
connect.h| 3 +++
remote-curl.c| 20 ++--
remote.h | 5 +++--
transport.c
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 ++
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 +
git.c | 1 +
upload-pack.c | 2 +-
4 files changed, 5 insertions(+), 2 deletions(-)
diff
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 | 127 +++
fs it sends based on the sent patterns.
Signed-off-by: Brandon Williams
---
transport-helper.c | 5 +++--
transport-internal.h | 4 +++-
transport.c | 16 +---
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index
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
---
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.
Signed-off-by: Brandon Williams
---
pkt-line.c | 19 ++-
pkt-line.h | 3 +++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/pkt-line.c b/pkt-line.c
index 98c2d7d68..3159cbe10 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -9
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
dback is appreciated! Thanks!
Brandon
Brandon Williams (26):
pkt-line: introduce packet_read_with_status
pkt-line: introduce struct packet_reader
pkt-line: add delim packet support
upload-pack: convert to a builtin
upload-pack: factor out processing lines
transport: use get_refs_via
hat
the client should fallback to using the dumb remote-helper commands.
Signed-off-by: Brandon Williams
---
transport-helper.c | 8
transport.c| 1 +
transport.h| 6 ++
3 files changed, 15 insertions(+)
diff --git a/transport-helper.c b/transport-helper.c
index c03
When communicating with a v2 server, perform a fetch by requesting the
'fetch' command.
Signed-off-by: Brandon Williams
---
builtin/fetch-pack.c | 2 +-
fetch-pack.c | 267 -
fetch-pack.h | 4 +-
t/t5701-prot
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
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
based on provided ref-patterns.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 26 +
Makefile| 1 +
ls-refs.c | 97 +
ls-refs.h | 9
as a pass through to convert requests to http.
Signed-off-by: Brandon Williams
---
remote-curl.c | 185 -
t/t5701-protocol-v2.sh | 41 +++
2 files changed, 224 insertions(+), 2 deletions(-)
diff --git a/remote-curl.c b/remote-cu
Introduce the 'fetch' server command.
Signed-off-by: Brandon Williams
---
Documentation/technical/protocol-v2.txt | 14 ++
serve.c | 2 +
upload-pack.c | 290
upl
A future patch will need to take advantage of the logic which runs and
processes the response of the connect command on a remote helper so
factor out this logic from 'process_connect_service()' and place it into
a helper function 'run_connect()'.
Signed-off-by: Brandon Will
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
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.
Signed-off-by: Brandon Williams
---
remote-curl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/remote-curl.
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 | 91
Mak
Construct a list of ref patterns to be passed to
'transport_get_remote_refs()' from the refspec to be used during the
fetch. 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: Brando
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 | 3 +++
builtin/receive-pack.c | 6 ++
builtin/send-pack.c| 3 +++
connect.c
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
xd.so
>
> -
> - LoadModule setenvif_module modules/mod_setenvif.so
> -
>
>
> PassEnv GIT_VALGRIND
> @@ -79,9 +79,7 @@ PassEnv ASAN_OPTIONS
> PassEnv GIT_TRACE
> PassEnv GIT_CONFIG_NOSYSTEM
>
> -= 2.4>
> - SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
> -
> +SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
>
> Alias /dumb/ www/
> Alias /auth/dumb/ www/auth/dumb/
> --
> 2.16.0.rc0
>
--
Brandon Williams
On 01/03, Stefan Beller wrote:
> On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams wrote:
> > In order to allow for code sharing with the server-side of fetch in
> > protocol-v2 convert upload-pack to be a builtin.
>
> What is the security aspect of this patch?
>
> By
On 01/03, Stefan Beller wrote:
> On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams wrote:
> > The current pkt-line API encodes the status of a pkt-line read in the
> > length of the read content. An error is indicated with '-1', a flush
> > with '0' (which
On 01/03, Stefan Beller wrote:
> On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams wrote:
> > Introduce the ls-refs server command. In protocol v2, the ls-refs
> > command is used to request the ref advertisement from the server. Since
> > it is a command which can be req
On 01/03, Stefan Beller wrote:
> On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams wrote:
> > +
> > +#define FETCH_CHECK_LOCAL 0
> > +#define FETCH_SEND_REQUEST 1
> > +#define FETCH_PROCESS_ACKS 2
> > +#define FETCH_SEND_HAVES 3
> > +#define FET
t;
> @@ -780,7 +781,7 @@ static int process_deepen(const char *line, int *depth)
> if (skip_prefix(line, "deepen ", &arg)) {
> char *end = NULL;
> *depth = strtol(arg, &end, 0);
> - if (!end || *end || depth <= 0)
> + if (!end || *end || *depth <= 0)
> die("Invalid deepen: %s", line);
> return 1;
> }
> --
> 2.15.0
--
Brandon Williams
index_state struct contain a back pointer
to a repository struct. I do think that we may want to have worktree
structs contain a back pointer to the struct repository they correspond
to. That way there is only one instance of the repository (and
object-store once that gets integrated) yet multiple worktrees.
--
Brandon Williams
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:09 -0800
> Brandon Williams wrote:
>
> > - while ((len = read_remote_ref(in, &src_buf, &src_len, &responded))) {
> > + while (state != EXPECTING_DONE) {
> > + switch (packet_reade
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:11 -0800
> Brandon Williams wrote:
>
> > diff --git a/transport.c b/transport.c
> > index 63c3dbab9..2378dcb38 100644
> > --- a/transport.c
> > +++ b/transport.c
> > @@ -118,6 +118,7 @@ str
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:04 -0800
> Brandon Williams wrote:
>
> > diff --git a/pkt-line.h b/pkt-line.h
> > index 06c468927..c446e886a 100644
> > --- a/pkt-line.h
> > +++ b/pkt-line.h
> > @@ -111,6 +111,63 @@ char *pack
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:03 -0800
> Brandon Williams wrote:
>
> > -int packet_read(int fd, char **src_buf, size_t *src_len,
> > - char *buffer, unsigned size, int options)
> > +enum packet_read_status packet_read_with_statu
shell to C
> submodule: port submodule subcommand 'deinit' from shell to C
>
> builtin/submodule--helper.c | 345
>
> git-submodule.sh| 112 +-
> 2 files changed, 347 insertions(+), 110 deletions(-)
>
> --
> 2.14.2
>
--
Brandon Williams
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:13 -0800
> Brandon Williams wrote:
>
> > diff --git a/Documentation/technical/protocol-v2.txt
> > b/Documentation/technical/protocol-v2.txt
> > new file mode 100644
> > index 0..b87ba3816
> >
On 01/09, Jonathan Tan wrote:
> On Tue, 9 Jan 2018 14:16:42 -0800
> Brandon Williams wrote:
>
> > All good documentation changes.
>
> Thanks!
>
> > > > + /*
> > > > +* Function called when a client requests the capability as a
const char *format, ...);
> -__attribute__((format (printf, 4, 5)))
> -extern void trace_argv_printf_fl(const char *file, int line, const char
> **argv,
> +__attribute__((format (printf, 5, 6)))
> +extern void trace_argv_printf_fl(const char *file, int line,
> + const char *const *env, const char **argv,
>const char *format, ...);
> extern void trace_strbuf_fl(const char *file, int line, struct trace_key
> *key,
> const struct strbuf *data);
> --
> 2.15.1.600.g899a5f85c6
>
--
Brandon Williams
On 01/10, Stefan Beller wrote:
> On Wed, Jan 10, 2018 at 10:09 AM, Brandon Williams wrote:
> > At first when i read this I was under the impression that the whole
> > environment was going to be printed out...but i now realize that this
> > tracing will only print o
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:02 -0800
> Brandon Williams wrote:
>
> > * Introduce a new remote-helper command 'connect-half-duplex' which is
> >implemented by remote-curl (the http remote-helper). This allows for a
> >
On 01/10, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:28 -0800
> Brandon Williams wrote:
>
> > +static size_t proxy_in(void *ptr, size_t eltsize,
> > + size_t nmemb, void *buffer_)
>
> OK, I managed to look at the Curl stuff in more detail.
>
siondetection/../.git/modules/sha1collisiondetection
>
> But I can't see what's still referencing it.
>
> This problem is avoided if, as noted with a comment I skip:
>
> git submodule update --init
>
> But I shouldn't need to remember to de-init a submodule before moving to
> a new commit that doesn't have it, least I end up in some seemingly
> unrecoverable state.
>
> Am I missing something obvious here?
One thing you could try is adding --recurse-submodule flags to the reset
commands. IIRC reset ignores submodules unless you specify that flag.
--
Brandon Williams
gt; index 88055abef7..e54c687f26 100644
> --- a/trace.h
> +++ b/trace.h
> @@ -4,6 +4,8 @@
> #include "git-compat-util.h"
> #include "strbuf.h"
>
> +struct child_process;
> +
> struct trace_key {
> const char * const key;
> int fd;
> @@ -17,6 +19,7 @@ extern struct trace_key trace_default_key;
> extern struct trace_key trace_perf_key;
>
> extern void trace_repo_setup(const char *prefix);
> +extern void trace_run_command(const struct child_process *cp);
> extern int trace_want(struct trace_key *key);
> extern void trace_disable(struct trace_key *key);
> extern uint64_t getnanotime(void);
> --
> 2.15.1.600.g899a5f85c6
>
--
Brandon Williams
it
> might be worth it (not so much for code de-duping, but because then we
> would know our display logic always matched what we exec'd). But unless
> somebody wants to refactor all of the Windows spawn code, it's
> definitely not a good idea.
And not having access to a windows box I didn't want to try and refactor
the windows-only code when I introduced prep_childenv() :)
--
Brandon Williams
On 01/15, Nguyễn Thái Ngọc Duy wrote:
> The function is about printing a trace line, not releasing the buffer it
> receives too. Move strbuf_release() back outside. This makes it easier
> to see how strbuf is managed.
This makes the code much more readable.
--
Brandon Williams
(compared to parent environment) in this case.
>
Code looks clean and very readable. Also matches the last one wins
semantics in prep_childenv.
--
Brandon Williams
On 01/09, Jonathan Tan wrote:
> On Tue, 2 Jan 2018 16:18:14 -0800
> Brandon Williams wrote:
>
> > + symrefs: In addition to the object pointed by it, show the underlying
> > + ref pointed by it when showing a symbolic ref.
> > + peel: Show peeled tags.
> >
So the
sharedindex file is always located relative to the project's git
directory and not the index file itself, which is kind of confusing.
Maybe a better design would be to have the sharedindex file located
relative to the index file.
Anyway, some food for thought.
--
Brandon Williams
On 01/17, Duy Nguyen wrote:
> On Wed, Jan 17, 2018 at 4:42 AM, Brandon Williams wrote:
> > On 01/07, Thomas Gummerer wrote:
> >> read_index_from() takes a path argument for the location of the index
> >> file. For reading the shared index in split index mode howeve
ng, and then
just use execv(e) since it shouldn't have any calls to malloc in them
correct?
--
Brandon Williams
On 04/11, Junio C Hamano wrote:
> Brandon Williams writes:
>
> > v3 builds upon v2 by adding 3 additional patches to add functionality to
> > also
> > propagate the remote and refspec down to children process's working to push
> > submodules. The remote and
one in
the grep code, but it might be slightly more involved than just changing
the enum name.
>From [12/12] it looks like the main purpose of this series is to use a
more preferment version of PCRE, if all else is equal it doesn't really
make much sense to have both versions to be select-able at runtime. Is
there any benefit of being able to do that, that I'm missing?
--
Brandon Williams
On 04/11, Eric Wong wrote:
> Brandon Williams wrote:
> > On 04/11, Eric Wong wrote:
> > > Hi Brandon, this series tickles an old itch of mine, so I
> > > started working off of it. I'm only somewhat concerned
> > > with the path resolution in execvp(e)
On 04/10, Jonathan Nieder wrote:
> Brandon Williams wrote:
>
> > In order to avoid allocation between 'fork()' and 'exec()' prepare the
> > environment to be used in the child process prior to forking.
>
> If using something like posix_spawn(), this
> exec() in the normal control flow. You have to worry about signal
> > handlers, too.
>
> Yes, all that auditing is necessary for vfork; too, but totally
> doable. The mainline Ruby implementation has been using vfork
> for spawning subprocesses for several years, now; an
On 04/11, Jonathan Nieder wrote:
> Brandon Williams wrote:
> Jonathan Tan had an idea about how to side-step the issue: what if
> "grep" forks an appropriate set of child processes before creating any
> threads and then communicates with those children using pipes?
> Bec
from a subdir' '
> + test_when_finished "rm -rf parent sub" &&
> + git init sub &&
> + echo "foobar" >sub/file &&
> + git -C sub add file &&
> + git -C sub commit -m "add file" &&
> +
> + git init parent &&
> + mkdir parent/src &&
> + echo "foobar" >parent/src/file &&
> + git -C parent add src/file &&
> + git -C parent submodule add ../sub src/sub &&
> + git -C parent submodule add ../sub sub &&
> + git -C parent commit -m "add files and submodules" &&
> +
> + # Verify grep from root works
> + cat >expect <<-\EOF &&
> + .gitmodules
> + src/file
> + src/sub/file
> + sub/file
> + EOF
> + git -C parent ls-files --recurse-submodules >actual &&
> + test_cmp expect actual &&
> +
> + # Verify grep from a subdir works
> + cat >expect <<-\EOF &&
> + file
> + sub/file
> + EOF
> + git -C parent/src ls-files --recurse-submodules >actual &&
> + test_cmp expect actual
> +'
> +
> +test_incompatible_with_recurse_submodules ()
> +{
> + test_expect_success "--recurse-submodules and $1 are incompatible" "
> + test_must_fail git ls-files --recurse-submodules $1 2>actual &&
> + test_i18ngrep -- '--recurse-submodules unsupported mode' actual
> + "
> +}
> +
> +test_incompatible_with_recurse_submodules --deleted
> +test_incompatible_with_recurse_submodules --others
> +test_incompatible_with_recurse_submodules --unmerged
> +test_incompatible_with_recurse_submodules --killed
> +test_incompatible_with_recurse_submodules --modified
> +
> +test_done
> --
> 2.12.2.776.gded3dc243c29.dirty
>
--
Brandon Williams
On 04/10, Brandon Williams wrote:
> Convert 'sane_execvp()' to 'sane_execvpe()' which optionally takes a
> pointer to an array of 'char *' which should be used as the environment
> for the process being exec'd. If no environment is provided (by passi
.sh
> index 4cf6ccf5a8ea..c8030dd3299a 100755
> --- a/t/t3007-ls-files-recurse-submodules.sh
> +++ b/t/t3007-ls-files-recurse-submodules.sh
> @@ -77,6 +77,7 @@ test_expect_success 'ls-files recurses more than 1 level' '
> git -C submodule/subsub commit -m "add d" &&
> git -C submodule submodule add ./subsub &&
> git -C submodule commit -m "added subsub" &&
> + git submodule absorbgitdirs &&
> git ls-files --recurse-submodules >actual &&
> test_cmp expect actual
> '
> --
> 2.12.2.776.gded3dc243c29.dirty
>
--
Brandon Williams
t I'm not sure...) Additionally,
> it felt weird that there's no helper function for creating a toplevel
> relative path.
I never considered the case where you use --git-dir or --work-tree,
definitely an oversight on my part. This change seems reasonable to me.
--
Brandon Williams
afe. This means that
fork/exec in a threaded context should work without deadlock and we could
potentially move to using vfork instead of fork, though I'll let others more
experienced make that decision.
Brandon Williams (6):
t5550: use write_script to generate post-update hook
run-command: p
reporting happens from the parent;
even avoiding functions like atexit(3) and exit(3).
Helped-by: Eric Wong
Signed-off-by: Brandon Williams
---
run-command.c | 121 ++
1 file changed, 89 insertions(+), 32 deletions(-)
diff --git a/run-command.c
The post-update hooks created in t5550-http-fetch-dumb.sh is missing the
"!#/bin/sh" line which can cause issues with portability. Instead
create the hook using the 'write_script' function which includes the
proper "#!" line.
Signed-off-by: Brandon Williams
---
Signed-off-by: Brandon Williams
---
run-command.c | 28 +---
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/run-command.c b/run-command.c
index 5e2a03145..6751b8319 100644
--- a/run-command.c
+++ b/run-command.c
@@ -117,18 +117,6 @@ static inline void
of the code know to only use
Async-Signal-Safe functions in the child process.
Signed-off-by: Brandon Williams
---
run-command.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/run-command.c b/run-command.c
index 4230c4933..1c36e692d 100644
--- a/run-command.c
+++ b/run-command.c
@@
In order to avoid allocation between 'fork()' and 'exec()' prepare the
environment to be used in the child process prior to forking.
Switch to using 'execve()' so that the construct child environment can
used in the exec'd process.
Signed-off-by: Brando
the potential to
call malloc during the path resolution it performs. Instead we simply
do the path resolution ourselves during the preparation stage prior to
forking.
Signed-off-by: Brandon Williams
---
run-command.c | 60 +++
1 file
in the abstractions that we'd need.
Agreed, though we're probably pretty far from that becoming a reality.
One day though!
--
Brandon Williams
901 - 1000 of 2393 matches
Mail list logo