[PATCH] commit.c: make tree a const pointer in commit_tree*()

2013-12-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- commit.c | 4 ++-- commit.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index 5df1df7..5ff5538 100644 --- a/commit.c +++ b/commit.c @@ -1356,7 +1356,7 @@ void free_commit_extra_headers

[PATCH] add: don't complain when adding empty project root

2013-12-23 Thread Nguyễn Thái Ngọc Duy
This behavior was added in 07d7bed (add: don't complain when adding empty project root - 2009-04-28) then broken by 84b8b5d (remove match_pathspec() in favor of match_pathspec_depth() - 2013-07-14). Reinstate it. Noticed-by: Thomas Ferris Nicolaisen tfn...@gmail.com Signed-off-by: Nguyễn Thái

[PATCH] t5537: fix incorrect expectation in test case 10

2014-01-08 Thread Nguyễn Thái Ngọc Duy
to 5537. Otherwise when t5536 learns to test httpd, running test in parallel may fail. References: 48d25ca fetch: add --update-shallow to accept... - 2013-12-05 1609488 smart-http: support shallow fetch/clone - 2013-12-05 Noticed-by: Jeff King p...@peff.net Signed-off-by: Nguyễn Thái Ngọc Duy pclo

[PATCH 5/6] read-cache: ask file watcher to watch files

2014-01-12 Thread Nguyễn Thái Ngọc Duy
them. Watched files may only skip lstat() at the next git run. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 27 pkt-line.c | 2 +- pkt-line.h | 2 ++ read-cache.c | 97 ++ 4 files

[PATCH 3/6] read-cache: connect to file watcher

2014-01-12 Thread Nguyễn Thái Ngọc Duy
if the file watcher refuses to answer. Timeout and move on without file watcher support after 20ms or so. (*) for current index versions, the signature is the index SHA-1 trailer. But it could be something else (e.g. v5 does not have SHA-1 trailer) Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 6/6] file-watcher: support inotify

2014-01-12 Thread Nguyễn Thái Ngọc Duy
git diff on webkit: no file watcher 1st run subsequent runs real0m1.361s0m1.445s 0m0.691s user0m0.889s0m0.940s 0m0.649s sys 0m0.469s0m0.495s 0m0.040s Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- config.mak.uname | 1

[PATCH 4/6] read-cache: get updated path list from file watcher

2014-01-12 Thread Nguyễn Thái Ngọc Duy
in some entries, they will be all cleared over the time and we need to do lstat on all entries. We haven't talked about how CE_WATCHED is set yet. More to come later. TODO: get as many paths as possible in one packet to reduce round trips Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 1/6] read-cache: save trailing sha-1

2014-01-12 Thread Nguyễn Thái Ngọc Duy
This will be used as signature to know if the index has changed. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + read-cache.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index ce377e1..7f7f306 100644 --- a/cache.h

[PATCH 2/6] read-cache: new extension to mark what file is watched

2014-01-12 Thread Nguyễn Thái Ngọc Duy
and stored as extension instead. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + read-cache.c | 41 - 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 7f7f306..dfa8622 100644 --- a/cache.h

[PATCH 0/6] inotify support

2014-01-12 Thread Nguyễn Thái Ngọc Duy
sure I haven't handled all error cases very well. The first five patches show the protocol and git side's changes. The last one fills inotify in. [1] http://thread.gmane.org/gmane.comp.version-control.git/215820/focus=78 Nguyễn Thái Ngọc Duy (6): read-cache: save trailing sha-1 read-cache

[PATCH/WIP v2 00/14] inotify support

2014-01-17 Thread Nguyễn Thái Ngọc Duy
unfriendly exit() in file-watcher.c). You also worked with inotify before maybe you can help spot some mishandling too as I'm totally new to inotify. Nguyễn Thái Ngọc Duy (14): read-cache: save trailing sha-1 read-cache: new extension to mark what file is watched read-cache: connect to file watcher

[PATCH/WIP v2 02/14] read-cache: new extension to mark what file is watched

2014-01-17 Thread Nguyễn Thái Ngọc Duy
and stored as extension instead. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 2 ++ read-cache.c | 41 - 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index a09d622..069dce7 100644 --- a/cache.h

[PATCH/WIP v2 01/14] read-cache: save trailing sha-1

2014-01-17 Thread Nguyễn Thái Ngọc Duy
This will be used as signature to know if the index has changed. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + read-cache.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 323481c..a09d622 100644 --- a/cache.h

[PATCH/WIP v2 07/14] read-cache: add config to start file watcher automatically

2014-01-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt | 5 + file-watcher-lib.c | 18 +++--- file-watcher-lib.h | 2 +- file-watcher.c | 8 ++-- read-cache.c | 17 +++-- 5 files changed, 42

[PATCH/WIP v2 06/14] read-cache: get modified file list from file watcher

2014-01-17 Thread Nguyễn Thái Ngọc Duy
it could update the index (or multiple processes is reading the same index), updated info is not lost. After the index is updated (e.g. in this case because of toggling CE_WATCHED bits), git sends the new index signature to the file watcher. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH/WIP v2 08/14] read-cache: add GIT_TEST_FORCE_WATCHER for testing

2014-01-17 Thread Nguyễn Thái Ngọc Duy
Thái Ngọc Duy pclo...@gmail.com --- read-cache.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 5dae9eb..a1245d4 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1544,7 +1544,12 @@ static void validate_watcher(struct index_state *istate

[PATCH/WIP v2 10/14] file-watcher: automatically quit

2014-01-17 Thread Nguyễn Thái Ngọc Duy
-watcher asks every watcher process to question the purpose of its existence. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 38 +++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/file-watcher.c b/file-watcher.c index

[PATCH/WIP v2 11/14] file-watcher: support inotify

2014-01-17 Thread Nguyễn Thái Ngọc Duy
git diff on webkit: no file watcher 1st run subsequent runs real0m1.361s0m1.445s 0m0.691s user0m0.889s0m0.940s 0m0.649s sys 0m0.469s0m0.495s 0m0.040s Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- config.mak.uname | 1

[PATCH/WIP v2 03/14] read-cache: connect to file watcher

2014-01-17 Thread Nguyễn Thái Ngọc Duy
versions, the signature is the index SHA-1 trailer. But it could be something else (e.g. v5 does not have SHA-1 trailer) Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- .gitignore | 1 + Makefile | 2 + cache.h | 3 + file-watcher-lib.c (new

[PATCH/WIP v2 04/14] read-cache: ask file watcher to watch files

2014-01-17 Thread Nguyễn Thái Ngọc Duy
watcher could watch them. Watched files may only skip lstat() at the next git run. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 31 pkt-line.c | 2 +- pkt-line.h | 2 ++ read-cache.c | 111

[PATCH/WIP v2 05/14] read-cache: put some limits on file watching

2014-01-17 Thread Nguyễn Thái Ngọc Duy
^16 is chosen at the minimum limit to start using file watcher. Recently updated files are not considered watchable because they are likely to be updated again soon, not worth the ping-pong game with file watcher. The default limit 30min is just a random value. Signed-off-by: Nguyễn Thái Ngọc Duy

[PATCH/WIP v2 09/14] file-watcher: add --shutdown and --log options

2014-01-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/file-watcher.c b/file-watcher.c index 1b4ac0a..df06529 100644 --- a/file-watcher.c +++ b/file-watcher.c @@ -113,6 +113,8 @@ static

[PATCH 2/2] t4010: match_pathspec_depth() and trailing slash after submodule

2014-01-23 Thread Nguyễn Thái Ngọc Duy
or somebody else could revisit it later. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t4010-diff-pathspec.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh index 15a4912..b54251a 100755 --- a/t/t4010-diff-pathspec.sh +++ b/t

[PATCH 1/2] tree-walk.c: ignore trailing slash on submodule in tree_entry_interesting()

2014-01-23 Thread Nguyễn Thái Ngọc Duy
We do ignore trailing slash on a directory, so pathspec abc/ matches directory abc. A submodule is also a directory. Apply the same logic to it. This makes git log submodule-path and git log submodule-path/ produce the same output. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t

[PATCH v2 0/9] About the trailing slashes

2014-01-24 Thread Nguyễn Thái Ngọc Duy
parent. treat_directory() is never called on b itself, which results in b/c and b/d. I'm tempted to make it consistent, favoring b/ output. But that involves extra lstat, or reordering the complex read_directory() code. This is probably very unusual case to pay attention to anyway. Nguyễn Thái Ngọc

[PATCH v2 8/9] clean: use cache_name_is_other()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
cmd_clean() has the exact same code of index_name_is_other(). Reduce code duplication. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/clean.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index

[PATCH v2 6/9] Pass directory indicator to match_pathspec_item()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
path is executed and produces the same result. The other case is pathspec dir and path dir/ is now turned to dir (with DO_MATCH_DIRECTORY). Still the same result before or after the patch. So why change? Because of the next patch about clean.c. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH v2 9/9] tree-walk.c: ignore trailing slash on submodule in tree_entry_interesting()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t4010-diff-pathspec.sh | 6 ++ tree-walk.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh index 167af53..2424af0 100755 --- a/t/t4010-diff-pathspec.sh +++ b/t/t4010

[PATCH v2 7/9] clean: replace match_pathspec() with dir_path_match()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/clean.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 4c9680a..5adb52d 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -961,8 +961,7 @@ int cmd_clean(int argc

[PATCH v2 4/9] dir.c: prepare match_pathspec_item for taking more flags

2014-01-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- dir.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dir.c b/dir.c index 8960ea1..35e09bd 100644 --- a/dir.c +++ b/dir.c @@ -195,6 +195,8 @@ int within_depth(const char *name, int namelen

[PATCH v2 1/9] Convert some match_pathspec_depth() to ce_path_match()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
This helps reduce the number of match_pathspec_depth() call sites and show how match_pathspec_depth() is used. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/checkout.c | 3 +-- builtin/commit.c | 2 +- builtin/grep.c | 2 +- builtin/rm.c | 2

[PATCH v2 2/9] Convert some match_pathspec_depth() to dir_path_match()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
in clean.c, which will be converted later) - resolve-undo (rerere.c and ls-files.c) Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/add.c | 3 +-- builtin/grep.c | 4 +--- builtin/ls-files.c | 2 +- dir.h | 7 +++ wt-status.c| 4 ++-- 5 files

[PATCH v2 3/9] Rename match_pathspec_depth() to match_pathspec()

2014-01-24 Thread Nguyễn Thái Ngọc Duy
-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/clean.c | 4 ++-- builtin/ls-files.c| 6 -- builtin/ls-tree.c | 2 +- dir.c | 20 ++-- dir.h | 10 +- rerere.c | 4 ++-- t

[PATCH v2 5/9] match_pathspec: match pathspec foo/ against directory foo

2014-01-24 Thread Nguyễn Thái Ngọc Duy
is not executed though because no callers pass the flag yet. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- dir.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 35e09bd..7b50072 100644 --- a/dir.c +++ b/dir.c @@ -196,6 +196,7 @@ int

[PATCH 2/3] diff: do not quit early on stat-dirty files

2014-01-24 Thread Nguyễn Thái Ngọc Duy
. The test result is cached so that when diffcore_skip_stat_unmatch() is done in the end, we spend no cycles on re-testing a. Reported-by: IWAMOTO Toshihiro iwam...@valinux.co.jp Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- diff.c| 22 +- diffcore.h

[PATCH 1/3] Move diffcore_skip_stat_unmatch core logic out for reuse later

2014-01-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- diff.c | 49 - 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/diff.c b/diff.c index 6b4cd0e..19460ff 100644 --- a/diff.c +++ b/diff.c @@ -4697,6 +4697,33 @@ static int

[PATCH 3/3] diff: turn off skip_stat_unmatch on diff --cached

2014-01-24 Thread Nguyễn Thái Ngọc Duy
from the old queue to the new queue in diffcore_skip_stat_unmatch(). Avoid it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/diff.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/diff.c b/builtin/diff.c index 0f247d2..85f97d7 100644

[PATCH v2 3/3] diff: turn skip_stat_unmatch on selectively

2014-01-27 Thread Nguyễn Thái Ngọc Duy
the old queue to the new queue in diffcore_skip_stat_unmatch(). Only enable it when worktree is involved: diff and diff rev. This should help track down how skip_stat_unmatch is actually used when bugs occur. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- This replaces 'diff: turn off

[PATCH v3 02/26] pkt-line.c: add packet_write_timeout()

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h| 1 + pkt-line.c | 15 +++ pkt-line.h | 1 + wrapper.c | 26 ++ 4 files changed, 43 insertions(+) diff --git a/cache.h b/cache.h index dc040fb..718e32b 100644 --- a/cache.h +++ b/cache.h

[PATCH v3 03/26] pkt-line.c: add packet_read_line_timeout()

2014-02-02 Thread Nguyễn Thái Ngọc Duy
This version is also gentler than its friend packet_read_line() because it's designed for side channel I/O that should not abort the program even if the channel is broken. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h| 1 + pkt-line.c | 35

[PATCH v3 01/26] pkt-line.c: rename global variable buffer[] to something less generic

2014-02-02 Thread Nguyễn Thái Ngọc Duy
buffer is a local variable in some other functions. Rename the global one to make it less confusing. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- pkt-line.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkt-line.c b/pkt-line.c index bc63b3b..eac45ad

[PATCH v3 00/26] inotify support

2014-02-02 Thread Nguyễn Thái Ngọc Duy
can also be fetched from https://github.com/pclouds/git.git file-watcher Nguyễn Thái Ngọc Duy (26): pkt-line.c: rename global variable buffer[] to something less generic pkt-line.c: add packet_write_timeout() pkt-line.c: add packet_read_line_timeout() unix-socket: make unlink() optional

[PATCH v3 07/26] file-watcher: remove socket on exit

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/file-watcher.c b/file-watcher.c index 91f4cfe..9c639ef 100644 --- a/file-watcher.c +++ b/file-watcher.c @@ -56,6 +56,26 @@ static

[PATCH v3 05/26] Add git-file-watcher and basic connection handling logic

2014-02-02 Thread Nguyễn Thái Ngọc Duy
) and is not part of this patch or the next few yet. This patch only provides a UNIX socket server. (*) it will be a a daemon in this end, but in this patch it runs in the foreground. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- .gitignore | 1

[PATCH v3 04/26] unix-socket: make unlink() optional in unix_stream_listen()

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- credential-cache--daemon.c | 2 +- unix-socket.c | 5 +++-- unix-socket.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c index

[PATCH v3 06/26] file-watcher: check socket directory permission

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 32 1 file changed, 32 insertions(+) diff --git a/file-watcher.c b/file-watcher.c index a6d7f17..91f4cfe 100644 --- a/file-watcher.c +++ b/file-watcher.c @@ -56,6 +56,37 @@ static void accept_connection(int fd

[PATCH v3 08/26] file-watcher: add --detach

2014-02-02 Thread Nguyễn Thái Ngọc Duy
In daemon mode, stdout and stderr are saved in $WATCHER/log. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-file-watcher.txt | 2 ++ cache.h| 1 + daemon.c | 30 -- file-watcher.c

[PATCH v3 10/26] read-cache: new flag CE_WATCHED to mark what file is watched

2014-02-02 Thread Nguyễn Thái Ngọc Duy
and this flag would be present in the majority of entries. When stored as bitmap, this extension could compress very well with ewah algorithm. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/technical/index-format.txt | 6 + cache.h

[PATCH v3 11/26] Clear CE_WATCHED when set CE_VALID alone

2014-02-02 Thread Nguyễn Thái Ngọc Duy
If CE_WATCHED is set, CE_VALID is controlled by CE_WATCHED and will be cleared bfore writing to disk. Users of --assume-unchanged therefore need to clear CE_WATCHED to avoid this side effect. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/update-index.c | 12 read

[PATCH v3 09/26] read-cache: save trailing sha-1

2014-02-02 Thread Nguyễn Thái Ngọc Duy
This will be used as signature to know if the index has changed. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + read-cache.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 7a836b1..f14d535 100644 --- a/cache.h

[PATCH v3 12/26] read-cache: basic hand shaking to the file watcher

2014-02-02 Thread Nguyễn Thái Ngọc Duy
git status forever. And the whole point of doing this is speed. If file watcher can't respond fast enough, for whatever reason, then it should not be used. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt | 10 +++ Documentation/git-file-watcher.txt

[PATCH v3 14/26] read-cache: put some limits on file watching

2014-02-02 Thread Nguyễn Thái Ngọc Duy
the ping-pong game with file watcher. The default limit 10min is just a random value. Recent limit is ignored if there are no watched files (e.g. a fresh clone, or after a bad hand shake with file watcher). Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt

[PATCH v3 15/26] read-cache: get changed file list from file watcher

2014-02-02 Thread Nguyễn Thái Ngọc Duy
we'll start over. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h| 1 + file-watcher-lib.c | 99 ++ file-watcher-lib.h | 1 + file-watcher.c | 138 + read-cache.c

[PATCH v3 16/26] git-compat-util.h: add inotify stubs on non-Linux platforms

2014-02-02 Thread Nguyễn Thái Ngọc Duy
This is to avoid spreading #ifdef HAVE_INOTIFY around and keep most code compiled even if it's never active. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- config.mak.uname | 1 + git-compat-util.h | 43 +++ 2 files changed, 44 insertions

[PATCH v3 13/26] read-cache: ask file watcher to watch files

2014-02-02 Thread Nguyễn Thái Ngọc Duy
(reducing payload to 3M). Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher-lib.c | 83 + file-watcher-lib.h | 1 + file-watcher.c | 91 ++ read-cache.c | 18 +-- 4

[PATCH v3 20/26] read-cache: new variable to verify file-watcher results

2014-02-02 Thread Nguyễn Thái Ngọc Duy
and validation at time Y. Even if X and Y are very close, an update can happen between X and Y, causing a false report. If GIT_TEST_WATCHED is set greater than 1, git will abort instead of just warn and move on. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-file-watcher.txt

[PATCH v3 17/26] file-watcher: inotify support, watching part

2014-02-02 Thread Nguyễn Thái Ngọc Duy
lookups. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-file-watcher.txt | 13 +++ file-watcher.c | 226 - 2 files changed, 238 insertions(+), 1 deletion(-) diff --git a/Documentation/git-file-watcher.txt b

[PATCH v3 18/26] file-watcher: inotify support, notification part

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 142 - 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/file-watcher.c b/file-watcher.c index d0762e6..5867942 100644 --- a/file-watcher.c +++ b/file

[PATCH v3 26/26] Disable file-watcher with system inotify on some tests

2014-02-02 Thread Nguyễn Thái Ngọc Duy
with GIT_TEST_WATCHER_PATH is to exercise file watcher in somewhat real scenarios and the remaining tests are more than enough for that. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t1011-read-tree-sparse-checkout.sh | 2 ++ t/t2104-update-index-skip-worktree.sh | 2 ++ t/t7011-skip-worktree-reading.sh

[PATCH v3 19/26] Wrap CE_VALID test with ce_valid()

2014-02-02 Thread Nguyễn Thái Ngọc Duy
. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/grep.c | 2 +- cache.h| 4 diff-lib.c | 4 ++-- diff.c | 2 +- read-cache.c | 6 +++--- unpack-trees.c | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c

[PATCH v3 25/26] file-watcher: tests for the client side

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Similar to t7513, system inotify is taken out to give us better controlled environment. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher-lib.c | 21 ++-- t/t7514-file-watcher-lib.sh (new +x) | 190 +++ test-file-watcher.c

[PATCH v3 24/26] ls-files: print CE_WATCHED as W (or w with CE_VALID)

2014-02-02 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-ls-files.txt | 1 + builtin/ls-files.c | 14 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index c0856a6

[PATCH v3 22/26] file-watcher: quit if $WATCHER/socket is gone

2014-02-02 Thread Nguyễn Thái Ngọc Duy
in such cases. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/file-watcher.c b/file-watcher.c index 5867942..1e45b25 100644 --- a/file-watcher.c +++ b/file-watcher.c @@ -834,11

[PATCH v3 21/26] Support running file watcher with the test suite

2014-02-02 Thread Nguyễn Thái Ngọc Duy
TIME_WAIT set set to unlimited by GIT_TEST_WATCHER=2 so the test suite could hang up indefinitely due to a file-watcher bug. Luckily everything passes. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- file-watcher-lib.c | 13 + 1 file changed, 13 insertions(+) diff --git a/file

[PATCH v3 23/26] file-watcher: tests for the daemon

2014-02-02 Thread Nguyễn Thái Ngọc Duy
help debugging: setenv and log. They can be used to turn on GIT_TRACE_PACKET then any log command will show, which functions as barrier between events file watcher. GIT_TRACE_WATCHER can also be enabled (dynamically or at startup) to track inotify events. Signed-off-by: Nguyễn Thái Ngọc Duy pclo

[PATCH 1/2] t7101, t7014: rename test files to indicate what that file is for

2014-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Looks like a good thing to do.. Three files with the same -reset.sh suffix could be confusing. t/t7101-reset-empty-subdirs.sh (new +x) | 63 + t/t7101-reset.sh (gone) | 63

[PATCH 2/2] reset: support --mixed --intent-to-add mode

2014-02-03 Thread Nguyễn Thái Ngọc Duy
files intent-to-add. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-reset.txt | 5 - builtin/reset.c | 19 +-- cache.h | 1 + read-cache.c| 9 + t/t7102-reset.sh| 9 + 5

[PATCH] git-tag.txt: commit for --contains is optional

2014-02-03 Thread Nguyễn Thái Ngọc Duy
This goes far back to e84fb2f (branch --contains: default to HEAD - 2008-07-08) where the same parsing code is shared with builtin/tag.c. git-branch.txt correctly states that commit for --contains is optional while git-tag.txt does not. Correct it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo

[PATCH 1/2] receive-pack: update $GIT_DIR/info before auto garbage collection

2014-02-03 Thread Nguyễn Thái Ngọc Duy
Auto gc could take a long time, and it's optional. git push user should be allowed to stop the program if they don't want to wait. Move server update step before auto gc. So we're ready to die any time since auto gc is kicked off. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin

[PATCH/RFC 2/2] receive-pack: hint that the user can stop git push at auto gc time

2014-02-03 Thread Nguyễn Thái Ngọc Duy
Housekeeping jobs like auto gc generally should not get in the way. Users who are pushing may not want to wait until auto gc is done on the server. Give a hint for those users that it's safe now to break git push and stop waiting. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 2/6] t5538: fix default http port

2014-02-06 Thread Nguyễn Thái Ngọc Duy
it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t5538-push-shallow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh index 0a6e40f..19fe425 100755 --- a/t/t5538-push-shallow.sh +++ b/t/t5538-push-shallow.sh @@ -126,7

[PATCH 0/6] Fix the shallow deepen bug with no-done

2014-02-06 Thread Nguyễn Thái Ngọc Duy
Reported by Jeff [1]. Junio spotted it right but nobody made any move since then. The main fix is 6/6. The rest is just updates while I was looking at it. 2/6 may need fast track though. [1] http://thread.gmane.org/gmane.comp.version-control.git/219914 Nguyễn Thái Ngọc Duy (6): test: rename

[PATCH 1/6] test: rename http fetch and push test files

2014-02-06 Thread Nguyễn Thái Ngọc Duy
Make clear which one is for dumb protocol, which one is for smart from their file name. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/{t5540-http-push.sh = t5540-http-push-webdav.sh} | 0 t/{t5541-http-push.sh = t5541-http-push-smart.sh} | 0 t/{t5550-http-fetch.sh = t5550-http

[PATCH 3/6] pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done'

2014-02-06 Thread Nguyễn Thái Ngọc Duy
It's introduced in 1bd8c8f (git-upload-pack: Support the multi_ack protocol - 2005-10-28) but probably better documented in the commit message of 78affc4 (Add multi_ack_detailed capability to fetch-pack/upload-pack - 2009-10-30) Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 4/6] protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt

2014-02-06 Thread Nguyễn Thái Ngọc Duy
pack-protocol.txt explains in detail how multi_ack_detailed works and what's the difference between no multi_ack, multi_ack and multi_ack_detailed. No need to repeat here. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/technical/protocol-capabilities.txt | 6 ++ 1

[PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Nguyễn Thái Ngọc Duy
consuming shallow lines when no-done is enabled. Reported-by: Jeff King p...@peff.net Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- fetch-pack.c | 3 ++- t/t5537-fetch-shallow.sh | 24 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fetch

[PATCH 5/6] protocol-capabilities.txt: document no-done

2014-02-06 Thread Nguyễn Thái Ngọc Duy
See 3e63b21 (upload-pack: Implement no-done capability - 2011-03-14) and 761ecf0 (fetch-pack: Implement no-done capability - 2011-03-14) for more information. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/technical/protocol-capabilities.txt | 12 1 file

[PATCH v2 1/2] daemon: move daemonize() to libgit.a

2014-02-07 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- cache.h | 1 + daemon.c | 30 -- setup.c | 24 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/cache.h b/cache.h index dc040fb..264b6f1 100644 --- a/cache.h +++ b

[PATCH v2 2/2] gc: config option for running --auto in background

2014-02-07 Thread Nguyễn Thái Ngọc Duy
gc.autodetach. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt | 4 builtin/gc.c | 23 ++- t/t5400-send-pack.sh | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Documentation/config.txt b/Documentation

[PATCH 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Nguyễn Thái Ngọc Duy
fnmatch(). But I won't optimize it until I see someone shows me they have a use case for it. (*) either that or my coworkers keep pissing me off on purpose when they never clean trailing spaces. Nguyễn Thái Ngọc Duy (2): dir: warn about trailing spaces in exclude pattern dir: ignore trailing

[PATCH 1/2] dir: warn about trailing spaces in exclude pattern

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- dir.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/dir.c b/dir.c index b35b633..9edde44 100644 --- a/dir.c +++ b/dir.c @@ -491,6 +491,16 @@ void clear_exclude_list(struct exclude_list *el) el-filebuf = NULL

[PATCH 2/2] dir: ignore trailing spaces in exclude patterns

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/gitignore.txt | 3 +++ dir.c | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index b08d34d..8734c15 100644

[PATCH] log: add --show-linear-break to help see non-linear history

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- This is a more serious attempt to make non-linear history more visible without --graph. It looks like this commit e4ddb05720710213108cd13ddd5a115e12a6211d Author: Andy Spencer andy753...@gmail.com

[PATCH v2 0/2] Ignore trailing spaces in .gitignore

2014-02-08 Thread Nguyễn Thái Ngọc Duy
This reroll now respects backslash quoting. Thanks Jeff and Torsten for the comments. Nguyễn Thái Ngọc Duy (2): dir: warn about trailing spaces in exclude patterns dir: ignore trailing spaces in exclude patterns Documentation/gitignore.txt | 3 +++ dir.c | 20

[PATCH v2 2/2] dir: ignore trailing spaces in exclude patterns

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/gitignore.txt | 3 +++ dir.c | 21 - t/t0008-ignores.sh | 8 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Documentation/gitignore.txt b

[PATCH v2 1/2] dir: warn about trailing spaces in exclude patterns

2014-02-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- dir.c | 17 + t/t0008-ignores.sh | 31 +++ 2 files changed, 48 insertions(+) diff --git a/dir.c b/dir.c index b35b633..6162209 100644 --- a/dir.c +++ b/dir.c @@ -491,6 +491,22

[PATCH] t5537: move http tests out to t5539

2014-02-13 Thread Nguyễn Thái Ngọc Duy
start_httpd is supposed to be at the beginning of the test file, not the middle of it. The test_seq line in no shallow lines.. test is updated to compensate missing refs that are there in t5537, but not in the new t5539. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- On Thu, Feb 13

[PATCH 3/4] Stop using fnmatch (either native or compat)

2014-02-14 Thread Nguyễn Thái Ngọc Duy
Since v1.8.4 (about six months ago) wildmatch is used as default replacement for fnmatch. We have seen only one fix since so wildmatch probably has done a good job as fnmatch replacement. This concludes the fnmatch-wildmatch transition by no longer relying on fnmatch. Signed-off-by: Nguyễn Thái

[PATCH 1/4] Use wildmatch() directly without fnmatch() wrapper

2014-02-14 Thread Nguyễn Thái Ngọc Duy
Make it clear that we don't use fnmatch() anymore. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/apply.c| 2 +- builtin/branch.c | 2 +- builtin/describe.c | 2 +- builtin/for-each-ref.c | 2 +- builtin/ls-remote.c| 2 +- builtin/name-rev.c | 2

[PATCH 2/4] Revert test-wildmatch: add perf command to compare wildmatch and fnmatch

2014-02-14 Thread Nguyễn Thái Ngọc Duy
This reverts commit 1b25892636d2f250eb2163301440ee8c8c1ac944. compat fnmatch will be removed soon and we can't rely on fnmatch() available everywhere. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- test-wildmatch.c | 73 1 file

[PATCH 4/4] Actually remove compat fnmatch source code

2014-02-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- compat/fnmatch/fnmatch.c (gone) | 494 compat/fnmatch/fnmatch.h (gone) | 84 --- 2 files changed, 578 deletions(-) diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c deleted file

[PATCH 0/4] Good bye fnmatch

2014-02-14 Thread Nguyễn Thái Ngọc Duy
gains. I started fnmatch replacement with 4917e1e (Makefile: promote wildmatch to be the default fnmatch implementation - 2013-05-30). This is the final step. Nguyễn Thái Ngọc Duy (4): Use wildmatch() directly without fnmatch() wrapper Revert test-wildmatch: add perf command to compare wildmatch

[PATCH/RESEND] attr: allow pattern escape using backslashes

2014-02-14 Thread Nguyễn Thái Ngọc Duy
-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Last discussion is [1] although the thread went off topic, so no actual discussion. [1] http://thread.gmane.org/gmane.comp.version-control.git/212631 Documentation/gitattributes.txt | 6 +++--- attr.c | 8 +++- t

[PATCH] reset: setup worktree on --mixed

2014-02-15 Thread Nguyễn Thái Ngọc Duy
--mixed does mainly two things: read_from_tree(), which does not require a worktree, and refresh_index(), which does. Reported-by: Patrick Palka patr...@parcs.ath.cx Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/reset.c | 2 +- t/t7102-reset.sh | 11 +++ 2 files

[PATCH v2] reset: optionally setup worktree and refresh index on --mixed

2014-02-15 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/reset.c | 7 --- t/t7102-reset.sh | 11 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/builtin/reset.c b/builtin/reset.c index 6004803..a991344 100644 --- a/builtin/reset.c +++ b/builtin/reset.c

[PATCH 2/3] wt-status.c: move cut-line print code out to wt_status_add_cut_line

2014-02-15 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- wt-status.c | 19 --- wt-status.h | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/wt-status.c b/wt-status.c index 65e35c3..ed31b6a 100644 --- a/wt-status.c +++ b/wt-status.c @@ -808,6 +808,17 @@ void

[PATCH 3/3] commit: add --cleanup=scissors

2014-02-15 Thread Nguyễn Thái Ngọc Duy
for the entire git status without accidentally remove lines starting with '#' Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/git-commit.txt | 7 ++- builtin/commit.c | 9 +++-- t/t7502-commit.sh| 16 3 files changed, 29

[PATCH 1/3] wt-status.c: make cut_lines[] const to shrink .data section a bit

2014-02-15 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- wt-status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index 4e55810..65e35c3 100644 --- a/wt-status.c +++ b/wt-status.c @@ -17,7 +17,7 @@ #include strbuf.h #include utf8.h -static

[PATCH 0/3] commit --cleanup=scissors marker

2014-02-15 Thread Nguyễn Thái Ngọc Duy
I've been bitten by --cleanup=default stripping my # lines a few times. Cutting git status with a long scissors marker line reduces chances of that happening. Most of the code is already there in 1a72cfd. This is just to add the UI. Nguyễn Thái Ngọc Duy (3): wt-status.c: make cut_lines[] const

[PATCH v2 2/3] wt-status.c: move cut-line print code out to wt_status_add_cut_line

2014-02-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- wt-status.c | 19 --- wt-status.h | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/wt-status.c b/wt-status.c index 65e35c3..ed31b6a 100644 --- a/wt-status.c +++ b/wt-status.c @@ -808,6 +808,17 @@ void

  1   2   3   4   5   6   7   8   9   10   >