Re: [PATCH v14 00/21] index-helper/watchman

2016-07-03 Thread Johannes Schindelin
Hi Dave, On Sun, 3 Jul 2016, Johannes Schindelin wrote: > On Sun, 3 Jul 2016, David Turner wrote: > > > This addresses comments on v13: > > removed unnecessary no_mmap ifdef > > add an ifdef in unix-socket > > OS X fix for select() > > test improvement > > Thanks. > > Would you mind re-sending

[PATCH v14 21/21] mailmap: use main email address for dturner

2016-07-03 Thread David Turner
Signed-off-by: David Turner --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index e5b4126..edcae89 100644 --- a/.mailmap +++ b/.mailmap @@ -46,6 +46,7 @@ David D. Kilzer David Kågedal David Reiss David S. Miller +David Turner Deskin Miller Dirk Sü

[PATCH v14 20/21] index-helper: indexhelper.exitAfter config

2016-07-03 Thread David Turner
From: David Turner Add a configuration variable, indexhelper.exitAfter, which provides a default time to keep the index-helper alive. This is useful with indexhelper.autorun; some users will want to keep the automatically-run index-helper alive across their lunch break and will thus set indexhel

Re: [PATCH/RFC] fast-import: Keep a fake pack window on the recently written data

2016-07-03 Thread Mike Hommey
On Mon, Jul 04, 2016 at 08:44:39AM +0900, Mike Hommey wrote: > + /* Ensure a pack window on the data before that, otherwise, > + * use_pack() may try to create a window that overlaps with > + * this one, and that won't work because it won't be complete. > */

[PATCH/RFC] fast-import: Keep a fake pack window on the recently written data

2016-07-03 Thread Mike Hommey
The are many ways in which fast-import ends up calling gfi_unpack_entry, and fery few work-arounds. I've patched fast-import for it to be smarter in corner cases, allowing some additional work-arounds, but it's just too easy to fall on gfi_unpack_entry again, so I abandonned that path. The problem

[GSOC Update] Week 9

2016-07-03 Thread Pranit Bauva
= SUMMARY == My public git.git is available here[1]. I regularly keep pushing my work so anyone interested can track me there. Feel free to participate in the discussions going on PRs with my mentors. Your comments are valuable.

Re: [PATCH v13 11/20] index-helper: use watchman to avoid refreshing index with lstat()

2016-07-03 Thread Duy Nguyen
On Fri, Jul 1, 2016 at 1:54 AM, Ben Peart wrote: > I've found (at least on Windows) that as the repo size gets larger, the > time to read the index becomes a much smaller percentage of the overall > time. I just captured some perf traces of git status on a large repo we > have. Of that, 92.5% wa

Re: [PATCH v14 00/21] index-helper/watchman

2016-07-03 Thread Johannes Schindelin
Hi Dave, On Sun, 3 Jul 2016, David Turner wrote: > This addresses comments on v13: > removed unnecessary no_mmap ifdef > add an ifdef in unix-socket > OS X fix for select() > test improvement Thanks. Would you mind re-sending 20 & 21, they seem to have gotten lost. Or is there a public reposito

Re: What's happening to the index

2016-07-03 Thread David
On 29 June 2016 at 08:49, Andy Falanga (afalanga) wrote: > Is there some sort of strange file caching that happening when > make starts that, although the local db is updated, I don't get what I'm > after? I don't have time to look at your git issue, but I write this quick note just in case it

[PATCH v14 10/21] watchman: support watchman to reduce index refresh cost

2016-07-03 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'm just copying and

[PATCH v14 15/21] index-helper: kill mode

2016-07-03 Thread David Turner
From: 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 Signed-off-by: Junio C Hamano --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31

[PATCH v14 09/21] read-cache: add watchman 'WAMA' extension

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy The extension contains a bitmap, one bit for each entry in the index. If the n-th bit is zero, the n-th entry is considered unchanged, we can ce_mark_uptodate() it without refreshing. If the bit is non-zero and we found out the corresponding file is clean after refresh,

[PATCH v14 12/21] update-index: enable/disable watchman support

2016-07-03 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 Signed-off-by: Junio C Hamano --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 15 +++ 3 files changed, 2

[PATCH v14 19/21] trace: measure where the time is spent in the index-heavy operations

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy All the known heavy code blocks are measured (except object database access). This should help identify if an optimization is effective or not. An unoptimized git-status would give something like below (92% of time is accounted). To sum up the effort of making git scale

[PATCH v14 11/21] index-helper: use watchman to avoid refreshing index with lstat()

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy Watchman is hidden behind index-helper. Before git tries to read the index from shm, it notifies index-helper through the socket and waits for index-helper to prepare a file for sharing memory (with MAP_SHARED). index-helper then contacts watchman, updates 'WAMA' extens

[PATCH v14 13/21] unpack-trees: preserve index extensions

2016-07-03 Thread David Turner
From: David Turner Make git checkout (and other unpack_tree operations) preserve the untracked cache and watchman status. This is valuable for two reasons: 1. Often, an unpack_tree operation will not touch large parts of the working tree, and thus most of the untracked cache will continue to be

[PATCH v14 14/21] watchman: add a config option to enable the extension

2016-07-03 Thread David Turner
From: 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 Signed-off-by: Junio C Hamano --- .gitignore| 1 + Documentation/config.txt | 4

[PATCH v14 07/21] index-helper: add --detach

2016-07-03 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 Signed-off-by: Ju

[PATCH v14 08/21] index-helper: log warnings

2016-07-03 Thread David Turner
From: 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 Signed-off-by: Junio C Hamano --- Documentation/git-index-helper.txt | 3 +++ index-helper.c

[PATCH v14 18/21] index-helper: optionally automatically run

2016-07-03 Thread David Turner
From: 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 Signed-off-by: Junio C Hamano --- Do

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

2016-07-03 Thread David Turner
From: David Turner Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- 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 943197e..feb09fb 100644 --- a/index-helper.c +++ b/

[PATCH v14 17/21] index-helper: autorun mode

2016-07-03 Thread David Turner
From: 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 Signed-off-by: Junio C Hamano --- Documentation/gi

[PATCH v14 01/21] read-cache: allow to keep mmap'd memory after reading

2016-07-03 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 Signed-off-

[PATCH v14 04/21] index-helper: new daemon for caching index and related stuff

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy Instead of reading the index from disk and worrying about disk corruption, the index is cached in memory (memory bit-flips happen too, but hopefully less often). The result is faster read. Read time is reduced by 70%. The biggest gain is not having to verify the traili

[PATCH v14 02/21] pkt-line: add gentle version of packet_write

2016-07-03 Thread David Turner
From: David Turner packet_write calls write_or_die, which dies with a sigpipe even if calling code has explicitly blocked that signal. Add packet_write_gently and packet_flush_gently, which don't. Soon, we will use this for communication with git index-helper, which, being merely an optimizatio

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

2016-07-03 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 Signed-off-by: Junio C Hamano --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c

[PATCH v14 05/21] index-helper: add --strict

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy There are "holes" in the index-helper approach because the shared memory is not verified again by git. If $USER is compromised, shared memory could be modified. But anyone who could do this could already modify $GIT_DIR/index. A more realistic risk is some bugs in index

[PATCH v14 00/21] index-helper/watchman

2016-07-03 Thread David Turner
This addresses comments on v13: removed unnecessary no_mmap ifdef add an ifdef in unix-socket OS X fix for select() test improvement Thanks to all for suggestions. David Turner (10): pkt-line: add gentle version of packet_write index-helper: log warnings unpack-trees: preserve index extensi

[PATCH v14 03/21] unix-socket.c: add stub implementation when unix sockets are not supported

2016-07-03 Thread David Turner
From: Nguyễn Thái Ngọc Duy This keeps #ifdef at the callee instead of caller, it's less messier. The caller in question is in read-cache.c which, unlike other unix-socket callers so far, is always built regardless of unix socket support. No extra handling (for ENOSYS) is needed because in this b