[PATCH v9 04/19] index-helper: add --strict

2016-05-09 Thread David Turner
t;) and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + index-helper.c | 48 +++

[PATCH v9 11/19] update-index: enable/disable watchman support

2016-05-09 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 16 3 files changed, 25 insertions(+) diff --git a

[PATCH v9 13/19] watchman: add a config option to enable the extension

2016-05-09 Thread David Turner
For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- .gitignore| 1 + Documentation/config.txt | 4 Makefile | 1 +

[PATCH v9 10/19] index-helper: use watchman to avoid refreshing index with lstat()

2016-05-09 Thread David Turner
ting. That kind of list can be kept in index-helper. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 6 + cache.h| 2 + dir.c | 23 +++- dir.h

[PATCH v9 16/19] index-helper: autorun mode

2016-05-09 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 --- Documentation/git-index-helper.txt | 4

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

2016-05-09 Thread David Turner
ne.org/gmane.comp.version-control.git/247268/focus=248771 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner Signed-off-by: Ramsay Jones --- .gitignore | 1 + Documentation/git-index-helper.txt | 50 +++ Makefile | 5 + cach

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

2016-05-09 Thread David Turner
Signed-off-by: David Turner --- 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 4ed1610..b275f6e 100644 --- a/index-helper.c +++ b/index-helper.c @@ -458,6 +458,13 @@ int main(int

[PATCH v9 09/19] watchman: support watchman to reduce index refresh cost

2016-05-09 Thread David Turner
From: Nguyễn Thái Ngọc Duy 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 from [1]. I'

[PATCH v9 14/19] index-helper: kill mode

2016-05-09 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 --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31 ++- t/t7900-index-helper.sh

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

2016-05-09 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index d9fb78b..16cc487 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7

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

2016-05-09 Thread David Turner
From: Nguyễn Thái Ngọc Duy Later, we will introduce git index-helper to share this memory with other git processes. We only unmap it when we discard the index (although the kernel may of course choose to page it out). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v9 08/19] read-cache: add watchman 'WAMA' extension

2016-05-09 Thread David Turner
n Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/technical/index-format.txt | 22 ++ cache.h | 4 ++ dir.h| 3 + read-cache.c | 117 ++- 4 files changed,

[PATCH v9 12/19] unpack-trees: preserve index extensions

2016-05-09 Thread David Turner
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 --- cache.h | 1 + read-ca

[PATCH v9 07/19] index-helper: add --detach

2016-05-09 Thread David Turner
From: Nguyễn Thái Ngọc Duy We detach after creating and opening the socket, because otherwise we might return control to the shell before index-helper is ready to accept commands. This might lead to flaky tests. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v9 06/19] daemonize(): set a flag before exiting the main process

2016-05-09 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 Signed-off-by: David Turner --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files changed, 6

[PATCH v9 00/19] index-helper/watchman

2016-05-09 Thread David Turner
Formatting and patch naming fixes from Junio. No substantive changes. David Turner (8): index-helper: log warnings unpack-trees: preserve index extensions watchman: add a config option to enable the extension index-helper: kill mode index-helper: don't run if already running

Re: [PATCH v2 00/33] Yet more preparation for reference backends

2016-05-09 Thread David Turner
On Fri, 2016-05-06 at 18:13 +0200, Michael Haggerty wrote: > Thanks to David, Junio, and Peff for their comments on v1 of this > patch series [1]. I think I have addressed all of the points that > were > brought up. Plus I fixed a pre-existing bug that I noticed myself > while adding some more test

[PATCH v8 16/19] index-helper: autorun mode

2016-05-05 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 --- Documentation/git-index-helper.txt | 4

[PATCH v8 04/19] index-helper: add --strict

2016-05-05 Thread David Turner
t;) and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + index-helper.c | 48 +++

[PATCH v8 05/19] index-helper: log warnings

2016-05-05 Thread David Turner
Instead of writing warnings to stderr, write them to a log. Later, we'll probably be daemonized, so writing to stderr will be pointless. Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 32 --

[PATCH v8 06/19] daemonize(): set a flag before exiting the main process

2016-05-05 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 Signed-off-by: David Turner --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files changed, 6

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

2016-05-05 Thread David Turner
Signed-off-by: David Turner --- 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 4ed1610..b275f6e 100644 --- a/index-helper.c +++ b/index-helper.c @@ -458,6 +458,13 @@ int main(int

[PATCH v8 08/19] read-cache: add watchman 'WAMA' extension

2016-05-05 Thread David Turner
n Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/technical/index-format.txt | 22 ++ cache.h | 4 ++ dir.h| 3 + read-cache.c | 117 ++- 4 files changed,

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

2016-05-05 Thread David Turner
From: Nguyễn Thái Ngọc Duy Later, we will introduce git index-helper to share this memory with other git processes. We only unmap it when we discard the index (although the kernel may of course choose to page it out). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v8 18/19] Add tracing to measure where most of the time is spent

2016-05-05 Thread David Turner
: 0.004052343 s: write index, changed mask = 2 trace.c:420 performance: 0.048365509 s: git command: './git' 'status' Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- diff-lib.c | 4 dir.c| 2 ++ name-hash.c

[PATCH v8 13/19] watchman: add a config option to enable the extension

2016-05-05 Thread David Turner
For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- .gitignore| 1 + Documentation/config.txt | 4 Makefile | 1 +

[PATCH v8 12/19] unpack-trees: preserve index extensions

2016-05-05 Thread David Turner
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 --- cache.h | 1 + read-ca

[PATCH v8 11/19] update-index: enable/disable watchman support

2016-05-05 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 16 3 files changed, 25 insertions(+) diff --git a

[PATCH v8 07/19] index-helper: add --detach

2016-05-05 Thread David Turner
From: Nguyễn Thái Ngọc Duy We detach after creating and opening the socket, because otherwise we might return control to the shell before index-helper is ready to accept commands. This might lead to flaky tests. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v8 19/19] untracked-cache: config option

2016-05-05 Thread David Turner
Add a config option to populate the untracked cache. For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- Documentation/config.txt | 4 read-cache.c

[PATCH v8 09/19] Add watchman support to reduce index refresh cost

2016-05-05 Thread David Turner
From: Nguyễn Thái Ngọc Duy 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 from [1]. I'

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

2016-05-05 Thread David Turner
ne.org/gmane.comp.version-control.git/247268/focus=248771 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner Signed-off-by: Ramsay Jones --- .gitignore | 1 + Documentation/git-index-helper.txt | 50 +++ Makefile | 5 + cach

[PATCH v8 14/19] index-helper: kill mode

2016-05-05 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 --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31 ++- t/t7900-index-helper.sh

[PATCH v8 17/19] index-helper: optionally automatically run

2016-05-05 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 --- Documentation/config.txt | 4 read-cache.c

[PATCH v8 10/19] index-helper: use watchman to avoid refreshing index with lstat()

2016-05-05 Thread David Turner
ting. That kind of list can be kept in index-helper. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 6 + cache.h| 2 + dir.c | 23 +++- dir.h

[PATCH v8 00/19] index-helper/watchman

2016-05-05 Thread David Turner
This version corrects defects noticed by Ramsay Jones: index-helper now works when USE_WATCHMAN is not set sigpipe is handled post-test cleanup is improved a test now uses a more idiomatic check restored an index verification check from a previous version of the series David Turner (8): index

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

2016-05-05 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index d9fb78b..16cc487 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7

Re: t7900-*.sh tesr #5 failure

2016-05-05 Thread David Turner
On Tue, 2016-05-03 at 22:34 +0100, Ramsay Jones wrote: > Hi David, > > Test t7900.5 fails for me, thus: > > $ ./t7900-index-helper.sh -i -v -x -d > > ... > > + test -S .git/index-helper.sock > + git status > On branch master > Untracked files: > (use "git add ..." to include

Re: [PATCH 06/14] remote.h: add get_remote_capabilities, request_capabilities

2016-05-03 Thread David Turner
On Tue, 2016-05-03 at 01:33 -0400, Jeff King wrote: > On Mon, May 02, 2016 at 02:57:43PM -0400, David Turner wrote: > > > On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > > > > > +const char *known_capabilities[] = { > > > + "multi_ack&

Re: [WIP PATCH 00/14] Protocol v2 patches

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > Hi David, > > here are my patches for a protocol v2. > > ("Negotiate capabilities before doing anything else", or as code: > > static void upload_pack_version_2(void) > { > send_capabilities_version_2(); >

Re: [PATCH 12/14] Add test for fetch-pack

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > +test_expect_success 'fetch-pack with protocol version 2' ' > + test_when_finished "rm -rf repo1" && > + mkdir repo1 && > + ( > + cd repo1 && > + git init && > + test_commit 1 && > +

Re: [PATCH 08/14] fetch-pack: factor out get_selected_capabilities_list

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > + struct string_list_item *item; > + get_selected_capabilities_list(&list, args); > + for_each_string_list_item(item, &list) { > + strbuf_addstr(&c, " ")

Re: [PATCH 06/14] remote.h: add get_remote_capabilities, request_capabilities

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > +const char *known_capabilities[] = { > + "multi_ack", > + "thin-pack", > + "side-band", > + "side-band-64k", > + "ofs-delta", > + "shallow", > + "no-progress", > + "include-tag", > + "multi_ack_detailed

Re: [PATCH 03/14] upload-pack-2: Implement the version 2 of upload-pack

2016-05-02 Thread David Turner
On Mon, 2016-05-02 at 10:51 -0700, Stefan Beller wrote: > On Mon, May 2, 2016 at 10:43 AM, David Turner < > dtur...@twopensource.com> wrote: > > On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > > > In upload-pack-2 we send each capability in its own pac

Re: [PATCH 04/14] connect: rewrite feature parsing to work on string_list

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > + if (skip_prefix(item->string, "symref", &val)) { > + if (!val) > + continue; This if should never happen (skip_prefix returns 0 in that case). You probably meant !*val -- but:

Re: [PATCH 03/14] upload-pack-2: Implement the version 2 of upload-pack

2016-05-02 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > In upload-pack-2 we send each capability in its own packet buffer. > The construction of upload-pack-2 is a bit unfortunate as I would > like > it to not be depending on a symlink linking to upload-pack.c, but I > did > not find another easy

Re: [PATCH 02/14] upload-pack.c: Refactor capability advertising

2016-04-29 Thread David Turner
On Fri, 2016-04-29 at 16:34 -0700, Stefan Beller wrote: > Instead of having the capabilities in a local string, keep them > in a struct outside the function. This will allow us in a later patch nit: s/struct/array/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of

[PATCH v7 14/19] index-helper: kill mode

2016-04-29 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 --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31 ++- t/t7900-index-helper.sh

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

2016-04-29 Thread David Turner
ne.org/gmane.comp.version-control.git/247268/focus=248771 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner Signed-off-by: Ramsay Jones --- .gitignore | 1 + Documentation/git-index-helper.txt | 50 +++ Makefile | 5 + cach

[PATCH v7 06/19] daemonize(): set a flag before exiting the main process

2016-04-29 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 Signed-off-by: David Turner --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files changed, 6

[PATCH v7 17/19] index-helper: optionally automatically run

2016-04-29 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 --- Documentation/config.txt | 4 read-cache.c

[PATCH v7 11/19] update-index: enable/disable watchman support

2016-04-29 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 16 3 files changed, 25 insertions(+) diff --git a

[PATCH v7 16/19] index-helper: autorun mode

2016-04-29 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 --- Documentation/git-index-helper.txt | 4

[PATCH v7 07/19] index-helper: add --detach

2016-04-29 Thread David Turner
From: Nguyễn Thái Ngọc Duy We detach after creating and opening the socket, because otherwise we might return control to the shell before index-helper is ready to accept commands. This might lead to flaky tests. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v7 10/19] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-29 Thread David Turner
ting. That kind of list can be kept in index-helper. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 6 + cache.h| 2 + dir.c | 23 +++- dir.h

[PATCH v7 09/19] Add watchman support to reduce index refresh cost

2016-04-29 Thread David Turner
From: Nguyễn Thái Ngọc Duy 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 from [1]. I'

[PATCH v7 19/19] untracked-cache: config option

2016-04-29 Thread David Turner
Add a config option to populate the untracked cache. For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- Documentation/config.txt | 4 read-cache.c

[PATCH v7 05/19] index-helper: log warnings

2016-04-29 Thread David Turner
Instead of writing warnings to stderr, write them to a log. Later, we'll probably be daemonized, so writing to stderr will be pointless. Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 32 --

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

2016-04-29 Thread David Turner
Signed-off-by: David Turner --- 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 9ca2ca6..e8d1311 100644 --- a/index-helper.c +++ b/index-helper.c @@ -455,6 +455,13 @@ int main(int

[PATCH v7 18/19] Add tracing to measure where most of the time is spent

2016-04-29 Thread David Turner
: 0.004052343 s: write index, changed mask = 2 trace.c:420 performance: 0.048365509 s: git command: './git' 'status' Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- diff-lib.c | 4 dir.c| 2 ++ name-hash.c

[PATCH v7 08/19] read-cache: add watchman 'WAMA' extension

2016-04-29 Thread David Turner
n Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/technical/index-format.txt | 22 ++ cache.h | 4 ++ dir.h| 3 + read-cache.c | 117 ++- 4 files changed,

[PATCH v7 13/19] watchman: add a config option to enable the extension

2016-04-29 Thread David Turner
For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- .gitignore| 1 + Documentation/config.txt | 4 Makefile | 1 +

[PATCH v7 12/19] unpack-trees: preserve index extensions

2016-04-29 Thread David Turner
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 --- cache.h | 1 + read-ca

[PATCH v7 04/19] index-helper: add --strict

2016-04-29 Thread David Turner
t;) and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + index-helper.c | 48 +++

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

2016-04-29 Thread David Turner
From: Nguyễn Thái Ngọc Duy Later, we will introduce git index-helper to share this memory with other git processes. We only unmap it when we discard the index (although the kernel may of course choose to page it out). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

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

2016-04-29 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index d9fb78b..16cc487 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7

[PATCH v7 00/19] index-helper/watchman

2016-04-29 Thread David Turner
ement David Turner (8): index-helper: log warnings unpack-trees: preserve index extensions watchman: add a config option to enable the extension index-helper: kill mode index-helper: don't run if already running index-helper: autorun mode index-helper: optionally automat

Re: [PATCH 19/29] refs: don't dereference on rename

2016-04-29 Thread David Turner
On Fri, 2016-04-29 at 09:38 +0200, Michael Haggerty wrote: > On 04/27/2016 08:55 PM, Junio C Hamano wrote: > > Michael Haggerty writes: > > > > > @@ -2380,8 +2381,8 @@ int rename_ref(const char *oldrefname, > > > const char *newrefname, const char *logms > > > goto rollback; > > > } >

Re: [PATCH 25/29] refs: resolve symbolic refs first

2016-04-29 Thread David Turner
On Fri, 2016-04-29 at 11:51 +0200, Michael Haggerty wrote: > On 04/29/2016 01:40 AM, David Turner wrote: > > On Wed, 2016-04-27 at 18:57 +0200, Michael Haggerty wrote: > > +retry: > > ... > > > + if (--attempts_remaining > 0) > > > +

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

2016-04-29 Thread David Turner
On Tue, 2016-04-26 at 20:59 -0700, Stefan Beller wrote: > On Mon, Apr 25, 2016 at 3:10 PM, Stefan Beller > wrote: > > On Mon, Apr 25, 2016 at 9:44 AM, David Turner < > > dtur...@twopensource.com> wrote: > > > On Wed, 2016-04-20 at 16:57 -0400, Jeff King wrote: &

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

2016-04-29 Thread David Turner
On Thu, 2016-04-28 at 11:58 -0700, Junio C Hamano wrote: > David Turner writes: > > > From: Nguyễn Thái Ngọc Duy > > ... > > The biggest gain is not having to verify the trailing SHA-1, which > > takes lots of time especially on large index files. But this al

Re: [PATCH 00/29] Yet more preparation for reference backends

2016-04-28 Thread David Turner
On Wed, 2016-04-27 at 18:57 +0200, Michael Haggerty wrote: > This started as a modest attempt to move the last couple of patches > mentioned here [1] to before the vtable patches. I wanted to do that > because having real changes mixed with the vtable refactoring was > making rebasing and stuff awk

Re: [PATCH 25/29] refs: resolve symbolic refs first

2016-04-28 Thread David Turner
On Wed, 2016-04-27 at 18:57 +0200, Michael Haggerty wrote: +retry: ... > + if (--attempts_remaining > 0) > + goto retry; could this be a loop instead of using gotos? > + /* > + * There is a directory in the way, > +

Re: [PATCH 15/29] ref_transaction_create(): disallow recursive pruning

2016-04-28 Thread David Turner
On Wed, 2016-04-27 at 14:15 -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > If a casual reader sees this code: > > > > ref_transaction_delete(transaction, r->name, r->sha1, > >REF_ISPRUNING | REF_NODEREF, NULL, &err) > > > > it gives an incorrect impressi

Re: [PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-28 Thread David Turner
On Wed, 2016-04-27 at 16:37 -0400, Jeff King wrote: > On Wed, Apr 27, 2016 at 04:34:53PM -0400, David Turner wrote: > > > > I thought the point is that one is a lesser check than the other, > > > and > > > we > > > need different rules for different situa

Re: [PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-27 Thread David Turner
On Wed, 2016-04-27 at 16:15 -0400, Jeff King wrote: > On Wed, Apr 27, 2016 at 04:10:32PM -0400, David Turner wrote: > > > On Wed, 2016-04-27 at 10:59 -0700, Junio C Hamano wrote: > > > > > There is another call to refname_is_safe() in > > > resolve_ref_unsa

Re: [PATCH 15/29] ref_transaction_create(): disallow recursive pruning

2016-04-27 Thread David Turner
On Wed, 2016-04-27 at 11:47 -0700, Junio C Hamano wrote: > Michael Haggerty writes: > > > It is nonsensical (and a little bit dangerous) to use REF_ISPRUNING > > without REF_NODEREF. Forbid it explicitly. Change the one > > REF_ISPRUNING > > caller to pass REF_NODEREF too. > > > > Signed-off-by:

Re: [PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-27 Thread David Turner
On Wed, 2016-04-27 at 10:59 -0700, Junio C Hamano wrote: > There is another call to refname_is_safe() in resolve_ref_unsafe(), > which applies the sanity check to the string from a symref. We seem > to allow > > $ git symbolic-ref refs/heads/SSS refs/heads//master > > and we end up storing

[PATCH v6 00/19] index-helper/watchman

2016-04-27 Thread David Turner
ds/receives watchman status (OK/NAK) 5. use packet_read infrastructure for communication with index-helper. 6. rearranged a tiny bit of code so two instances match up I decided not to do the weird thing where we pass fds over the socket, because the mailing list consensus was that it was maybe too wei

[PATCH v6 05/19] index-helper: log warnings

2016-04-27 Thread David Turner
Instead of writing warnings to stderr, write them to a log. Later, we'll probably be daemonized, so writing to stderr will be pointless. Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 29 ++--- 2

[PATCH v6 08/19] read-cache: add watchman 'WAMA' extension

2016-04-27 Thread David Turner
n Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/technical/index-format.txt | 22 ++ cache.h | 4 ++ dir.h| 3 + read-cache.c | 117 ++- 4 files changed,

[PATCH v6 06/19] daemonize(): set a flag before exiting the main process

2016-04-27 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 Signed-off-by: David Turner --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files changed, 6

[PATCH v6 13/19] watchman: add a config option to enable the extension

2016-04-27 Thread David Turner
For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- .gitignore| 1 + Documentation/config.txt | 4 Makefile | 1 +

[PATCH v6 17/19] index-helper: optionally automatically run

2016-04-27 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 --- Documentation/config.txt | 4 read-cache.c

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

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Later, we will introduce git index-helper to share this memory with other git processes. We only unmap it when we discard the index (although the kernel may of course choose to page it out). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

[PATCH v6 11/19] update-index: enable/disable watchman support

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 16 3 files changed, 25 insertions(+) diff --git a

[PATCH v6 18/19] Add tracing to measure where most of the time is spent

2016-04-27 Thread David Turner
: 0.004052343 s: write index, changed mask = 2 trace.c:420 performance: 0.048365509 s: git command: './git' 'status' Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- diff-lib.c | 4 dir.c| 2 ++ name-hash.c

[PATCH v6 19/19] untracked-cache: config option

2016-04-27 Thread David Turner
Add a config option to populate the untracked cache. For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- Documentation/config.txt | 4 read-cache.c

[PATCH v6 04/19] index-helper: add --strict

2016-04-27 Thread David Turner
t;) and before verify_shm() detects an error. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 9 +++ cache.h| 1 + index-helper.c | 48 +++

[PATCH v6 12/19] unpack-trees: preserve index extensions

2016-04-27 Thread David Turner
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 --- cache.h | 1 + read-ca

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

2016-04-27 Thread David Turner
Signed-off-by: David Turner --- 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 60a71f2..092c814 100644 --- a/index-helper.c +++ b/index-helper.c @@ -463,6 +463,13 @@ int main(int

[PATCH v6 16/19] index-helper: autorun mode

2016-04-27 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 --- Documentation/git-index-helper.txt | 4

[PATCH v6 10/19] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-27 Thread David Turner
ting. That kind of list can be kept in index-helper. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 6 + cache.h| 2 + dir.c | 23 +++- dir.h

[PATCH v6 09/19] Add watchman support to reduce index refresh cost

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy 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 from [1]. I'

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

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index d9fb78b..16cc487 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7

[PATCH v6 07/19] index-helper: add --detach

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy We detach after creating and opening the socket, because otherwise we might return control to the shell before index-helper is ready to accept commands. This might lead to flaky tests. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner

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

2016-04-27 Thread David Turner
oading the index: (vanilla) 0.37 s: read_index_from .git/index (index-helper) 0.22 s: read_index_from .git/index [1] http://thread.gmane.org/gmane.comp.version-control.git/247268/focus=248771 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner Signed-off-by: Ramsay Jones --- .gitignore

[PATCH v6 14/19] index-helper: kill mode

2016-04-27 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 --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31 ++- t/t7900-index-helper.sh

Re: [PATCH v5 06/15] index-helper: add --detach

2016-04-25 Thread David Turner
On Wed, 2016-04-20 at 06:50 +0700, Duy Nguyen wrote: > On Wed, Apr 20, 2016 at 6:28 AM, David Turner < > dtur...@twopensource.com> wrote: > > @@ -317,6 +320,8 @@ int main(int argc, char **argv) > > if (fd < 0) > > die_errno(_("co

Re: [PATCH v7 19/33] refs: allow log-only updates

2016-04-25 Thread David Turner
On Thu, 2016-04-21 at 16:17 +0200, Michael Haggerty wrote: > On 03/01/2016 01:52 AM, David Turner wrote: > > The refs infrastructure learns about log-only ref updates, which > > only > > update the reflog. Later, we will use this to separate symbolic > > reference r

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