[PATCH v5 02/15] read-cache: allow to keep mmap'd memory after reading

2016-04-19 Thread David Turner
<pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- cache.h | 3 +++ read-cache.c | 13 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index b829410..4180e2b 100644 --- a/cache.h +++ b/cache.h @@ -333,11

[PATCH v5 08/15] Add watchman support to reduce index refresh cost

2016-04-19 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> The previous patch has the logic to clear bits in 'WAMA' bitmap. This patch has logic to set bits as told by watchman. The missing bit, _using_ these bits, are not here yet. A lot of this code is written by David Turner originally, mostly f

[PATCH v5 13/15] index-helper: don't run if already running

2016-04-19 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c | 7 +++ t/t7900-index-helper.sh | 9 + 2 files changed, 16 insertions(+) diff --git a/index-helper.c b/index-helper.c index 6af01c9..8fcb76e 100644 --- a/index-helper.c +++ b/index-helper.c @@

[PATCH v5 15/15] index-helper: optionally automatically run

2016-04-19 Thread David Turner
Introduce a new config option, indexhelper.autorun, to automatically run git index-helper before starting up a builtin git command. This enables users to keep index-helper running without manual intervention. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/conf

[PATCH v5 11/15] unpack-trees: preserve index extensions

2016-04-19 Thread David Turner
if the untracked cache were entirely invalidated by such an operation, the user has signaled their intention to have such a cache, and we don't want to throw it away. The same logic applies to the watchman state. Signed-off-by: David Turner <dtur...@twopensource.com> --- c

[PATCH v5 04/15] index-helper: add --strict

2016-04-19 Thread David Turner
uot;this shm is ready") and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + i

[PATCH v5 05/15] daemonize(): set a flag before exiting the main process

2016-04-19 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> This allows signal handlers and atexit functions to realize this situation and not clean up. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/gc.c | 2 +-

[PATCH v5 12/15] index-helper: kill mode

2016-04-19 Thread David Turner
Add a new command (and command-line arg) to allow index-helpers to exit cleanly. This is mainly useful for tests. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31

[PATCH v5 09/15] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-19 Thread David Turner
per. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 6 + cache.h| 2 + dir.c | 23 +++- dir.h

[PATCH v5 00/15] index-helper/watchman

2016-04-19 Thread David Turner
. Documentation for index-helper suggesting running update-index --watchman. 3. index-helper autorun moved to read-cache so it's only run on relevant commands. 4. Tests: Broken && chain fixed; removed a subshell 5. A couple of fd leaks fixed. 6. Cruft removed. 7. New perf numbers. Davi

[PATCH v5 01/15] read-cache.c: fix constness of verify_hdr()

2016-04-19 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c inde

Re: [PATCH v4 15/16] index-helper: optionally automatically run

2016-04-19 Thread David Turner
On Sun, 2016-04-17 at 12:19 +0700, Duy Nguyen wrote: > On Wed, Apr 13, 2016 at 7:33 AM, David Turner < > dtur...@twopensource.com> wrote: > > @@ -536,8 +567,10 @@ static void handle_builtin(int argc, const > > char **argv) > > } > > &

Re: [PATCH v4 12/16] index-helper: kill mode

2016-04-19 Thread David Turner
On Sat, 2016-04-16 at 18:08 +0200, Ævar Arnfjörð Bjarmason wrote: > On Wed, Apr 13, 2016 at 2:33 AM, David Turner < > dtur...@twopensource.com> wrote: > > Add a new command (and command-line arg) to allow index-helpers to > > exit cleanly. > > > > This is mainl

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-19 Thread David Turner
On Fri, 2016-04-15 at 17:04 -0700, Stefan Beller wrote: > > +static int try_shm(struct index_state *istate) > > +{ > > + void *new_mmap = NULL; > > + size_t old_size = istate->mmap_size; > > + ssize_t new_size; > > + const unsigned char *sha1; > > + struct stat st; >

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-19 Thread David Turner
On Fri, 2016-04-15 at 17:04 -0700, Stefan Beller wrote: > > +static int try_shm(struct index_state *istate) > > +{ > > + void *new_mmap = NULL; > > + size_t old_size = istate->mmap_size; > > + ssize_t new_size; > > + const unsigned char *sha1; > > + struct stat st; >

Re: [PATCH/RFC 4/6] transport: add refspec list parameters to functions

2016-04-19 Thread David Turner
On Tue, 2016-04-19 at 03:14 -0400, Jeff King wrote: > On Mon, Apr 18, 2016 at 11:45:54AM -0700, Junio C Hamano wrote: > > > David Turner <dtur...@twopensource.com> writes: > > > > > Add parameters for a list of refspecs to > > > transpo

Re: [PATCH/RFC 5/6] fetch: pass refspec to http server

2016-04-19 Thread David Turner
On Sat, 2016-04-16 at 22:33 -0400, Eric Sunshine wrote: > On Fri, Apr 15, 2016 at 3:19 PM, David Turner < > dtur...@twopensource.com> wrote: > > When fetching over http, send the requested refspec to the server. > > The server will then only send refs matching that refsp

Re: [PATCH/RFC 6/6] clone: send refspec for single-branch clones

2016-04-19 Thread David Turner
On Sat, 2016-04-16 at 22:36 -0400, Eric Sunshine wrote: > On Fri, Apr 15, 2016 at 3:19 PM, David Turner < > dtur...@twopensource.com> wrote: > > For single-branch clones (when we know in advance what the remote > > branch name will be), send a refspec so that the server d

Re: [PATCH/RFC 4/6] transport: add refspec list parameters to functions

2016-04-19 Thread David Turner
On Mon, 2016-04-18 at 11:45 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > Add parameters for a list of refspecs to transport_get_remote_refs > > and > > get_refs_list. These parameters are presently unused -- soon, we >

Re: [PATCH/RFC 2/6] remote-curl.c: fix variable shadowing

2016-04-19 Thread David Turner
On Mon, 2016-04-18 at 11:35 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > The local variable 'options' was shadowing a global of the same > > name. > > > > Signed-off-by: David Turner <dtur...@twopensource.com> >

Re: [PATCH/RFC 1/6] http-backend: use argv_array functions

2016-04-19 Thread David Turner
On Mon, 2016-04-18 at 11:34 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > Signed-off-by: David Turner <dtur...@twopensource.com> > > --- > > OK (it might be easier to read if you used the pushl form for the > "fix

Re: [PATCH/RFC 3/6] http-backend: handle refspec argument

2016-04-19 Thread David Turner
On Sat, 2016-04-16 at 21:51 -0400, Eric Sunshine wrote: > On Fri, Apr 15, 2016 at 3:19 PM, David Turner < > dtur...@twopensource.com> wrote: > > + if (refspec) { > > + struct strbuf interesting_refs = > > STRBUF_INIT; > > +

Re: [PATCH v4 09/16] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-19 Thread David Turner
On Fri, 2016-04-15 at 17:07 -0700, Stefan Beller wrote: > > +static void refresh_by_watchman(struct index_state *istate) > > +{ > > + void *shm = NULL; > > + int length; > > + int i; > > + struct stat st; > > + int fd = -1; > > + const char *path =

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread David Turner
On Fri, 2016-04-15 at 18:25 +0700, Duy Nguyen wrote: > On Thu, Apr 14, 2016 at 1:47 AM, David Turner < > dtur...@twopensource.com> wrote: > > > > + fd = unix_stream_connect(socket_path); > > > > + if (refresh_cache) { > > > > +

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread David Turner
On Thu, 2016-04-14 at 17:04 +0700, Duy Nguyen wrote: > On Thu, Apr 14, 2016 at 1:47 AM, David Turner < > dtur...@twopensource.com> wrote: > > On Wed, 2016-04-13 at 20:43 +0700, Duy Nguyen wrote: > > > On Wed, Apr 13, 2016 at 7:32 AM, David Turner < > &g

[PATCH/RFC 3/6] http-backend: handle refspec argument

2016-04-15 Thread David Turner
Allow clients to pass a "refspec" parameter through to upload-pack; upload-pack will only advertise refs which match that refspec. Signed-off-by: David Turner <dtur...@twopensource.com> --- http-backend.c | 9 +++ upl

[PATCH/RFC 4/6] transport: add refspec list parameters to functions

2016-04-15 Thread David Turner
Add parameters for a list of refspecs to transport_get_remote_refs and get_refs_list. These parameters are presently unused -- soon, we will use them to implement fetches which only learn about a subset of refs. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/clone.c

[PATCH/RFC 1/6] http-backend: use argv_array functions

2016-04-15 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- http-backend.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/http-backend.c b/http-backend.c index 8870a26..a4f0066 100644 --- a/http-backend.c +++ b/http-backend.c @@ -450,9 +450,7 @@ stati

[PATCH/RFC 6/6] clone: send refspec for single-branch clones

2016-04-15 Thread David Turner
For single-branch clones (when we know in advance what the remote branch name will be), send a refspec so that the server doesn't tell us about any other refs. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/clone.c | 16 +++- t/t5552-http

[PATCH/RFC 0/6] fetch with refspec

2016-04-15 Thread David Turner
as soon as this is sent!) David Turner (6): http-backend: use argv_array functions remote-curl.c: fix variable shadowing http-backend: handle refspec argument transport: add refspec list parameters to functions fetch: pass refspec to http server clone: send refspec for single-branch

[PATCH/RFC 2/6] remote-curl.c: fix variable shadowing

2016-04-15 Thread David Turner
The local variable 'options' was shadowing a global of the same name. Signed-off-by: David Turner <dtur...@twopensource.com> --- remote-curl.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index 15e48e2..b9b6a90

[PATCH/RFC 5/6] fetch: pass refspec to http server

2016-04-15 Thread David Turner
, this can save bandwidth and reduce fetch latency. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/technical/protocol-capabilities.txt | 23 + builtin/fetch.c | 20 ++- remote-

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread David Turner
On Thu, 2016-04-14 at 11:12 -0700, Junio C Hamano wrote: > Duy Nguyen writes: > > > On Wed, Apr 13, 2016 at 1:05 AM, Junio C Hamano > > wrote: > > > > > - access is slow (unless cached, but we can't be sure) > > > > > > > > We could solve this (and the

Re: Migrating away from SHA-1?

2016-04-14 Thread David Turner
On Wed, 2016-04-13 at 21:53 -0400, Theodore Ts'o wrote: > On Tue, Apr 12, 2016 at 07:15:34PM -0400, David Turner wrote: > > > > If SHA-1 is broken (in certain ways), someone *can* replace an > > arbitrary blob. GPG does not help in this case, because the > > signa

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread David Turner
On Thu, 2016-04-14 at 09:56 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > $GIT_DIR/index-helper.path is a symlink to the socket for the > > daemon > > process. The daemon reads from the socket and executes commands. > &g

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread David Turner
On Wed, 2016-04-13 at 20:43 +0700, Duy Nguyen wrote: > On Wed, Apr 13, 2016 at 7:32 AM, David Turner < > dtur...@twopensource.com> wrote: > > +NOTES > > +- > > + > > +$GIT_DIR/index-helper.path is a symlink > > In multiple worktree context, this f

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread David Turner
On Wed, 2016-04-13 at 18:00 +0100, Ramsay Jones wrote: > > On 13/04/16 01:32, David Turner wrote: > > [snip] > > > diff --git a/git-compat-util.h b/git-compat-util.h > > index c07e0c1..8b878fe 100644 > > --- a/git-compat-util.h > > +++ b/git-compat-util.

[PATCH v4 14/16] index-helper: autorun mode

2016-04-12 Thread David Turner
Soon, we'll want to automatically start index-helper, so we need a mode that silently exits if it can't start up (either because it's not in a git dir, or because another one is already running). Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c

[PATCH v4 16/16] read-cache: config for waiting for index-helper

2016-04-12 Thread David Turner
. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/config.txt | 6 ++ cache.h | 1 + config.c | 5 + environment.c| 5 + read-cache.c | 5 - 5 files changed, 21 insertions(+), 1 deletion(-) diff

[PATCH v4 07/16] read-cache: add watchman 'WAMA' extension

2016-04-12 Thread David Turner
ed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- cache.h | 4 ++ dir.h| 3 ++ read-cache.c | 117 ++- 3 files changed, 122 insertions(+), 2 deletions(-) diff

[PATCH v4 00/16] index-helper, watchman

2016-04-12 Thread David Turner
This version has been tested on OS X and Linux. It switches from POSIX-Realtime shm to plain old mmap. Thanks to JI for this suggestion. This version incorporates a couple of fixes from Ramsay Jones. There might be a couple of minor spelling/grammar fixes too. David Turner (6): unpack-trees

[PATCH v4 09/16] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-12 Thread David Turner
per. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 6 + cache.h| 8 ++ dir.c | 23 +++- dir.h

[PATCH v4 05/16] daemonize(): set a flag before exiting the main process

2016-04-12 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> This allows signal handlers and atexit functions to realize this situation and not clean up. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/gc.c | 2 +-

[PATCH v4 15/16] index-helper: optionally automatically run

2016-04-12 Thread David Turner
Introduce a new config option, indexhelper.autorun, to automatically run git index-helper before starting up a builtin git command. This enables users to keep index-helper running without manual intervention. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/conf

[PATCH v4 06/16] index-helper: add --detach

2016-04-12 Thread David Turner
m> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 11 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/git-index-helper.txt b/Documentation/git-inde

[PATCH v4 12/16] index-helper: kill mode

2016-04-12 Thread David Turner
Add a new command (and command-line arg) to allow index-helpers to exit cleanly. This is mainly useful for tests. Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c | 31 ++- t/t7900-index-helper.sh | 12 2 files c

[PATCH v4 08/16] Add watchman support to reduce index refresh cost

2016-04-12 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> The previous patch has the logic to clear bits in 'WAMA' bitmap. This patch has logic to set bits as told by watchman. The missing bit, _using_ these bits, are not here yet. A lot of this code is written by David Turner originally, mostly f

[PATCH v4 10/16] update-index: enable/disable watchman support

2016-04-12 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/update-index.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/builtin/update-index.

[PATCH v4 11/16] unpack-trees: preserve index extensions

2016-04-12 Thread David Turner
if the untracked cache were entirely invalidated by such an operation, the user has signaled their intention to have such a cache, and we don't want to throw it away. The same logic applies to the watchman state. Signed-off-by: David Turner <dtur...@twopensource.com> --- c

[PATCH v4 13/16] index-helper: don't run if already running

2016-04-12 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c | 7 +++ t/t7900-index-helper.sh | 9 + 2 files changed, 16 insertions(+) diff --git a/index-helper.c b/index-helper.c index 3e0990e..dcb2041 100644 --- a/index-helper.c +++ b/index-helper.c @@

[PATCH v4 01/16] read-cache.c: fix constness of verify_hdr()

2016-04-12 Thread David Turner
From: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c inde

[PATCH v4 02/16] read-cache: allow to keep mmap'd memory after reading

2016-04-12 Thread David Turner
<pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- cache.h | 3 +++ read-cache.c | 13 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index b829410..4180e2b 100644 --- a/cache.h +++ b/cache.h @@ -333,11

[PATCH v4 04/16] index-helper: add --strict

2016-04-12 Thread David Turner
uot;this shm is ready") and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + i

[PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-12 Thread David Turner
ff-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> Signed-off-by: Ramsay Jones <ram...@ramsayjones.plus.com> --- .gitignore | 1 + Documentation/git-index-helper.txt | 48 + Makefile

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-12 Thread David Turner
On Tue, 2016-04-12 at 11:05 -0700, Junio C Hamano wrote: > > > - access is slow (unless cached, but we can't be sure) > > > > We could solve this (and the other problem) with mlock. > > Probably you meant madvise(2)? > > For something of a size comparable to the index file held by >

Re: Migrating away from SHA-1?

2016-04-12 Thread David Turner
On Tue, 2016-04-12 at 16:00 -0700, Stefan Beller wrote: > On Tue, Apr 12, 2016 at 3:38 PM, H. Peter Anvin > wrote: > > OK, I'm going to open this can of worms... > > > > At what point do we migrate from SHA-1? At this point the > > cryptoanalysis of > > SHA-1 is most likely a

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-12 Thread David Turner
On Tue, 2016-04-12 at 16:40 +0700, Duy Nguyen wrote: > On Tue, Apr 12, 2016 at 6:27 AM, David Turner < > dtur...@twopensource.com> wrote: > > On Fri, 2016-04-08 at 18:16 -0400, David Turner wrote: > > > And SHM on Macs works a bit differently than on Linux in at least

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-11 Thread David Turner
On Fri, 2016-04-08 at 18:16 -0400, David Turner wrote: > And SHM on Macs works a bit differently than on Linux in at least two > irritating ways. > > So, uh, new version to come once I actually make it work on Mac. > Probably Monday. I was chatting with a friend about this a

Re: [PATCH 2/3] index-helper: convert strncpy to memcpy

2016-04-11 Thread David Turner
On Mon, 2016-04-11 at 00:02 +0100, Ramsay Jones wrote: > see commit eddda371 ("convert strncpy to memcpy", 24-09-2015). > > Signed-off-by: Ramsay Jones > --- > index-helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/index-helper.c

Re: [PATCH 1/3] index-helper: fix UNIX_PATH_MAX redefinition error on cygwin

2016-04-11 Thread David Turner
On Mon, 2016-04-11 at 14:30 +0100, Ramsay Jones wrote: > > On 11/04/16 05:20, Torsten Bögershausen wrote: > > On 04/11/2016 12:59 AM, Ramsay Jones wrote: > > The header mentions cygwin, but changes it for linux, BSD and Mac > > OS as well. > > Is this intentional ? > > Yes. I only compile on

Re: [PATCH 3/3] index-helper: take extra care with readlink

2016-04-11 Thread David Turner
On Mon, 2016-04-11 at 00:03 +0100, Ramsay Jones wrote: > It took me a few minutes to convince myself that, if index-helper is > the only writer for the symlink, that the call to readlink would > result in a properly NULL terminated string. This relies on the > initialization of the address

Re: [PATCH 0/3] index-helper: fix UNIX_PATH_MAX redefinition error on cygwin

2016-04-11 Thread David Turner
On Mon, 2016-04-11 at 09:33 -0400, Jeff King wrote: > On Sun, Apr 10, 2016 at 11:57:31PM +0100, Ramsay Jones wrote: > > > So, the approach taken by patch #1 is to forget about UNIX_PATH_MAX > > and > > simply use sizeof(address.sun_path) instead! > > That's what the existing code in

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-08 Thread David Turner
On Fri, 2016-04-08 at 18:26 +0700, Duy Nguyen wrote: > On Thu, Apr 7, 2016 at 5:11 AM, David Turner < > dtur...@twopensource.com> wrote: > > @@ -1045,4 +1046,21 @@ struct tm *git_gmtime_r(const time_t *, > > struct tm *); > > #define getc_unlocked(fh) getc(fh

Re: [PATCH 03/24] t1430: test the output and error of some commands more carefully

2016-04-08 Thread David Turner
On Fri, 2016-04-08 at 13:43 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > Would you like > > me to re-roll with my sign-off, or would you prefer to add it > > yourself? > > I take it that you see no other reason

Re: [PATCH 03/24] t1430: test the output and error of some commands more carefully

2016-04-08 Thread David Turner
On Fri, 2016-04-08 at 11:14 -0400, Michael Haggerty wrote: > On 04/07/2016 03:02 PM, David Turner wrote: > > From: Michael Haggerty <mhag...@alum.mit.edu> > > > > Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> > > [...] > > David, even tho

Re: [PATCH v3 09/16] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-07 Thread David Turner
On Thu, 2016-04-07 at 15:52 -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > > + untracked = data + len + 8 + bitmap_size; > > > > This breaks compilation as data here is of type (void *). > > > > There may be similar breakages in this patch. > > It turns

[PATCH 11/24] resolve_ref_1(): eliminate local variable

2016-04-07 Thread David Turner
From: Michael Haggerty In place of `buf`, use `refname`, which is anyway a better description of what is being pointed at. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-)

[PATCH 07/24] t1430: improve test coverage of deletion of badly-named refs

2016-04-07 Thread David Turner
From: Michael Haggerty Check "branch -d broken...ref" Check various combinations of * Deleting using "update-ref -d" * Deleting using "update-ref --no-deref -d" * Deleting using "branch -d" in the following combinations of symref -> ref: * badname -> broken...ref *

[PATCH 24/24] refs: on symref reflog expire, lock symref not referrent

2016-04-07 Thread David Turner
When locking a symbolic ref to expire a reflog, lock the symbolic ref (using REF_NODEREF) instead of its referent. Add a test for this. Signed-off-by: David Turner <dtur...@twopensource.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> --- refs/files-backend.c | 3 ++- t/t14

[PATCH 21/24] check_aliased_update(): check that dst_name is non-NULL

2016-04-07 Thread David Turner
From: Michael Haggerty If there is an error in resolve_ref_unsafe(), it returns NULL. We check for this case, but not until after calling strip_namespace(). Instead, call strip_namespace() *after* the NULL check. Signed-off-by: Michael Haggerty ---

[PATCH 08/24] resolve_missing_loose_ref(): simplify semantics

2016-04-07 Thread David Turner
From: Michael Haggerty Make resolve_missing_loose_ref() only responsible for looking up a packed reference, without worrying about whether we want to read or write the reference and without setting errno on failure. Move the other logic to the caller. Signed-off-by:

[PATCH 06/24] t1430: test for-each-ref in the presence of badly-named refs

2016-04-07 Thread David Turner
From: Michael Haggerty Signed-off-by: Michael Haggerty --- t/t1430-bad-ref-name.sh | 16 1 file changed, 16 insertions(+) diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh index a963951..612cc32 100755 ---

[PATCH 03/24] t1430: test the output and error of some commands more carefully

2016-04-07 Thread David Turner
From: Michael Haggerty Signed-off-by: Michael Haggerty --- t/t1430-bad-ref-name.sh | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh index c465abe..005e2b1 100755

[PATCH 10/24] resolve_ref_unsafe(): ensure flags is always set

2016-04-07 Thread David Turner
From: Michael Haggerty If the caller passes flags==NULL, then set it to point at a local scratch variable. This removes the need for a lot of "if (flags)" guards in resolve_ref_1() and resolve_missing_loose_ref(). Signed-off-by: Michael Haggerty ---

[PATCH 18/24] fsck_head_link(): remove unneeded flag variable

2016-04-07 Thread David Turner
From: Michael Haggerty It is never read, so we can pass NULL to resolve_ref_unsafe(). Signed-off-by: Michael Haggerty --- builtin/fsck.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index

[PATCH 09/24] resolve_ref_unsafe(): use for loop to count up to MAXDEPTH

2016-04-07 Thread David Turner
From: Michael Haggerty The loop's there anyway; we might as well use it. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/refs/files-backend.c

[PATCH 05/24] t1430: don't rely on symbolic-ref for creating broken symrefs

2016-04-07 Thread David Turner
From: Michael Haggerty It's questionable whether it should even work. Signed-off-by: Michael Haggerty --- t/t1430-bad-ref-name.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1430-bad-ref-name.sh

[PATCH 04/24] t1430: clean up broken refs/tags/shadow

2016-04-07 Thread David Turner
From: Michael Haggerty Signed-off-by: Michael Haggerty --- t/t1430-bad-ref-name.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh index 005e2b1..cb815ab 100755 ---

[PATCH 20/24] checkout_paths(): remove unneeded flag variable

2016-04-07 Thread David Turner
From: Michael Haggerty It is never read, so we can pass NULL to resolve_ref_unsafe(). Signed-off-by: Michael Haggerty --- builtin/checkout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/checkout.c

[PATCH 23/24] refs: move resolve_ref_unsafe into common code

2016-04-07 Thread David Turner
Now that resolve_ref_unsafe's only interaction with the backend is through read_raw_ref, we can move it into the common code. Later, we'll replace read_raw_ref with a backend function. Signed-off-by: David Turner <dtur...@twopensource.com> Signed-off-by: Junio C Hamano <gits...@

[PATCH 19/24] cmd_merge(): remove unneeded flag variable

2016-04-07 Thread David Turner
From: Michael Haggerty It is never read, so we can pass NULL to resolve_ref_unsafe(). Signed-off-by: Michael Haggerty --- builtin/merge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index

[PATCH 16/24] Inline resolve_ref_1() into resolve_ref_unsafe()

2016-04-07 Thread David Turner
From: Michael Haggerty resolve_ref_unsafe() wasn't doing anything useful anymore. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 31 +-- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git

[PATCH 17/24] read_raw_ref(): change flags parameter to unsigned int

2016-04-07 Thread David Turner
From: Michael Haggerty read_raw_ref() is going to be part of the vtable for reference backends, so clean up its interface to use "unsigned int flags" rather than "int flags". Its caller still uses signed int for its flags arguments. But changing that would touch a lot of

[PATCH 00/24] Yet another pre-refs-backend series

2016-04-07 Thread David Turner
going to be harder to move and can wait until after the vtable. I have reviewed all of Michael's patches. David Turner (5): refs: move head_ref{,_submodule} to the common code refs: move for_each_*ref* functions into common code files-backend: break out ref reading refs: move

[PATCH 22/24] show_head_ref(): check the result of resolve_ref_namespace()

2016-04-07 Thread David Turner
From: Michael Haggerty Only use the result of resolve_ref_namespace() if it is non-NULL. Signed-off-by: Michael Haggerty --- http-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-backend.c b/http-backend.c index

[PATCH 15/24] read_raw_ref(): manage own scratch space

2016-04-07 Thread David Turner
From: Michael Haggerty Instead of creating scratch space in resolve_ref_unsafe() and passing it down through resolve_ref_1 to read_raw_ref(), teach read_raw_ref() to manage its own scratch space. This reduces coupling across the functions at the cost of some extra

[PATCH 02/24] refs: move for_each_*ref* functions into common code

2016-04-07 Thread David Turner
Make do_for_each_ref take a submodule as an argument instead of a ref_cache. Since all for_each_*ref* functions are defined in terms of do_for_each_ref, we can then move them into the common code. Later, we can simply make do_for_each_ref into a backend function. Signed-off-by: David Turner

[PATCH 14/24] files-backend: break out ref reading

2016-04-07 Thread David Turner
Refactor resolve_ref_1 in terms of a new function read_raw_ref, which is responsible for reading ref data from the ref storage. Later, we will make read_raw_ref a pluggable backend function, and make resolve_ref_unsafe common. Signed-off-by: David Turner <dtur...@twopensource.com> Helped-b

[PATCH 12/24] resolve_ref_1(): reorder code

2016-04-07 Thread David Turner
From: Michael Haggerty There is no need to adjust *flags if we're just about to fail. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/refs/files-backend.c

[PATCH 13/24] resolve_ref_1(): eliminate local variable "bad_name"

2016-04-07 Thread David Turner
From: Michael Haggerty We can use (*flags & REF_BAD_NAME) for that purpose. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/refs/files-backend.c

[PATCH 01/24] refs: move head_ref{,_submodule} to the common code

2016-04-07 Thread David Turner
These don't use any backend-specific functions. These were previously defined in terms of the do_head_ref helper function, but since they are otherwise identical, we don't need that function. Signed-off-by: David Turner <dtur...@twopensource.com> Signed-off-by: Junio C Hamano <gits...@

Re: git segfaults on older Solaris releases

2016-04-07 Thread David Turner
On Thu, 2016-04-07 at 11:50 -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > "Tom G. Christensen" writes: > > > > > The reason for the crash is simple, a null value was passed to > > > the 's' > > > format for the *printf family of functions.

Re: [PATCH v3 03/16] index-helper: new daemon for caching index and related stuff

2016-04-07 Thread David Turner
On Thu, 2016-04-07 at 16:14 +0200, Johannes Schindelin wrote: > Hi, > > On Thu, 7 Apr 2016, Johannes Sixt wrote: > > > Am 07.04.2016 um 00:11 schrieb David Turner: > > > +static void share_index(struct index_state *istate, struct shm > > > *is) > > >

[PATCH v3 05/16] daemonize(): set a flag before exiting the main process

2016-04-06 Thread David Turner
From: Nguyễn Thái Ngọc Duy This allows signal handlers and atexit functions to realize this situation and not clean up. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files

[PATCH v3 16/16] read-cache: config for waiting for index-helper

2016-04-06 Thread David Turner
. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/config.txt | 6 ++ cache.h | 1 + config.c | 5 + environment.c| 5 + read-cache.c | 5 - 5 files changed, 21 insertions(+), 1 deletion(-) diff

[PATCH v3 09/16] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-06 Thread David Turner
i Ngọc Duy <pclo...@gmail.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/git-index-helper.txt | 6 + cache.h| 8 ++ dir.c | 23 +++- dir.h | 3 + index-helper

[PATCH v3 15/16] index-helper: optionally automatically run

2016-04-06 Thread David Turner
Introduce a new config option, indexhelper.autorun, to automatically run git index-helper before starting up a builtin git command. This enables users to keep index-helper running without manual intervention. Signed-off-by: David Turner <dtur...@twopensource.com> --- Documentation/conf

[PATCH v3 14/16] index-helper: autorun mode

2016-04-06 Thread David Turner
Soon, we'll want to automatically start index-helper, so we need a mode that silently exits if it can't start up (either because it's not in a git dir, or because another one is already running). Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c

[PATCH v3 11/16] unpack-trees: preserve index extensions

2016-04-06 Thread David Turner
if the untracked cache were entirely invalidated by such an operation, the user has signaled their intention to have such a cache, and we don't want to throw it away. The same logic applies to the watchman state. Signed-off-by: David Turner <dtur...@twopensource.com> --- c

[PATCH v3 13/16] index-helper: don't run if already running

2016-04-06 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- index-helper.c | 7 +++ t/t7900-index-helper.sh | 9 + 2 files changed, 16 insertions(+) diff --git a/index-helper.c b/index-helper.c index a3f6a74..b62d805 100644 --- a/index-helper.c +++ b/index-helper.c @@

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