[PATCH] Move test-* to t/helper/ subdirectory

2016-04-13 Thread Nguyễn Thái Ngọc Duy
This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy --- This patch will break any patches that add new test programs. Luckily, none in 'next' or 'pu' do

[PATCH 0/7] fix checking out a being-rebased branch

2016-04-17 Thread Nguyễn Thái Ngọc Duy
First cut. I need opinions on 05/07, which converts wt_status_get_state() to support selecting any worktree. I'm not super happy with leaving "TODO: not supported yet" comments, even though strictly speaking this series does not need it. The reason it's left unsupported is, in order to add worktre

[PATCH 2/7] worktree.c: store "id" instead of "git_dir"

2016-04-17 Thread Nguyễn Thái Ngọc Duy
We can reconstruct git_dir from id quite easily. It's a bit hackier to do the reverse. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 31 ++- worktree.h | 8 +++- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/worktree.c b/workt

[PATCH 1/7] path.c: add git_common_path() and strbuf_git_common_path()

2016-04-17 Thread Nguyễn Thái Ngọc Duy
functions will enable that. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 +++ path.c | 29 + 2 files changed, 32 insertions(+) diff --git a/cache.h b/cache.h index 2711048..c04a17f 100644 --- a/cache.h +++ b/cache.h @@ -799,11 +799,14 @@ extern void

[PATCH 3/7] path.c: refactor and add worktree_git_path()

2016-04-17 Thread Nguyễn Thái Ngọc Duy
, wt_status_get_state() will be converted using this to take am/rebase/... state of any worktree. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 34 -- worktree.h | 11 +++ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/path.c b/path.c index

[PATCH 4/7] worktree.c: add worktree_git_path_..._head()

2016-04-17 Thread Nguyễn Thái Ngọc Duy
These are a variant of git_path_..._head(), defined with GIT_PATH_FUNC macro but they takes worktree into account. To be used when wt_status_get_state() is converted to be worktree-aware. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 4 worktree.h | 13 + 2 files

[PATCH 5/7] wt-status.c: make wt_status_get_state() support worktree

2016-04-17 Thread Nguyễn Thái Ngọc Duy
thing like worktree_get_sha1), cherry-pick and revert detection will not work when the examined worktree is not the current one. The same for get_detached_from. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 42 +- wt-status.h | 3 +++ 2 files changed, 28 inserti

[PATCH 7/7] checkout: prevent checking out a branch being rebased in another worktree

2016-04-17 Thread Nguyễn Thái Ngọc Duy
. This is because unlike rebase, bisect does not update the branch. Yes it's still a bit confusing when the user doing the bisecting realizes that the branch is updated elsewhere, but at least we do not lose any valuable ref update. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c

[PATCH 6/7] worktree.c: avoid referencing to worktrees[i] multiple times

2016-04-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worktree.c b/worktree.c index c5bf583..3b7c6f2 100644 --- a/worktree.c +++ b/worktree.c @@ -200,10 +200,12 @@ char *find_shared_symref(const char *symref, const char

[PATCH 16/15] Add tracing to measure where most of the time is spent

2016-04-20 Thread Nguyễn Thái Ngọc Duy
, changed mask = 2 trace.c:420 performance: 0.048365509 s: git command: './git' 'status' Signed-off-by: Nguyễn Thái Ngọc Duy --- This is worth merging, I think. diff-lib.c | 4 dir.c| 2 ++ name-hash.c | 2 ++ preload-index.

[PATCH v2 02/12] worktree.c: store "id" instead of "git_dir"

2016-04-20 Thread Nguyễn Thái Ngọc Duy
We can reconstruct git_dir from id quite easily. It's a bit hackier to do the reverse. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c | 3 ++- worktree.c | 31 ++- worktree.h | 8 +++- 3 files changed, 27 insertions(+), 15 deletions(-) diff --

[PATCH v2 00/12] fix checking out a being-rebased branch

2016-04-20 Thread Nguyễn Thái Ngọc Duy
Much happier with this version. This makes - git checkout refuse if a branch is under rebase or bisect elsewhere - git worktree add refuse if a branch is under rebase or bisect - git branch -D refuse if a branch is under rebase or bisect. This applies for single worktree case as well.

[PATCH v2 01/12] path.c: add git_common_path() and strbuf_git_common_path()

2016-04-20 Thread Nguyễn Thái Ngọc Duy
functions will enable that. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 +++ path.c | 29 + 2 files changed, 32 insertions(+) diff --git a/cache.h b/cache.h index 2711048..c04a17f 100644 --- a/cache.h +++ b/cache.h @@ -799,11 +799,14 @@ extern void

[PATCH v2 10/12] wt-status.c: split bisect detection out of wt_status_get_state()

2016-04-20 Thread Nguyễn Thái Ngọc Duy
And make it work with any given worktree, in preparation for (again) find_shared_symref(). read_and_strip_branch() is deleted because it's no longer used. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 23 ++- wt-status.h | 2 ++ 2 files changed, 16 insertions(

[PATCH v2 09/12] worktree.c: test if branch being rebased in another worktree

2016-04-20 Thread Nguyễn Thái Ngọc Duy
d_symref() will prevent that and "git rebase --abort" will fail as a result. find_shared_symref() and die_if_checked_out() have to learn a new option ignore_current_worktree to loose the test a bit. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c| 4 ++-- branch.h

[PATCH v2 05/12] path.c: refactor and add worktree_git_path()

2016-04-20 Thread Nguyễn Thái Ngọc Duy
, wt_status_get_state() will be converted using this to take am/rebase/... state of any worktree. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 34 -- worktree.h | 11 +++ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/path.c b/path.c index

[PATCH v2 06/12] wt-status.c: split rebase detection out of wt_status_get_state()

2016-04-20 Thread Nguyễn Thái Ngọc Duy
worktree.c:find_shared_symref() later needs to know if a branch is being rebased, and only rebased only. Split this code so it can be used independently from other in-progress tests. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 23 +-- wt-status.h | 1 + 2 files

[PATCH v2 04/12] worktree.c: mark current worktree

2016-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 18 +- worktree.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/worktree.c b/worktree.c index 360ba41..452f64a 100644 --- a/worktree.c +++ b/worktree.c @@ -2,6 +2,7 @@ #include "refs.h"

[PATCH v2 07/12] wt-status.c: make wt_status_check_rebase() work on any worktree

2016-04-20 Thread Nguyễn Thái Ngọc Duy
This is a preparation step for find_shared_symref() to detect if any worktree is being rebased. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 33 - wt-status.h | 5 - 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/wt-status.c b/wt

[PATCH v2 11/12] worktree.c: test if branch being bisected in another worktree

2016-04-20 Thread Nguyễn Thái Ngọc Duy
isect will fail to return to the (long gone) branch Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2025-worktree-add.sh | 13 + worktree.c | 19 +++ 2 files changed, 32 insertions(+) diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh index da5432

[PATCH v2 12/12] branch: do not rename a branch under bisect or rebase

2016-04-20 Thread Nguyễn Thái Ngọc Duy
s a lot more work. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/branch.c| 25 + t/t2025-worktree-add.sh | 8 worktree.c | 8 worktree.h | 3 +++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/built

[PATCH v2 08/12] worktree.c: avoid referencing to worktrees[i] multiple times

2016-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worktree.c b/worktree.c index 452f64a..b5ca78f 100644 --- a/worktree.c +++ b/worktree.c @@ -221,10 +221,12 @@ const struct worktree *find_shared_symref(const char *symref

[PATCH v2 03/12] worktree.c: make find_shared_symref() return struct worktree *

2016-04-20 Thread Nguyễn Thái Ngọc Duy
This gives the caller more information and they can answer things like, "is it the main worktree" or "is it the current worktree". The latter question is needed for the "checkout a rebase branch" case later. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c

[PATCH 2/2] wrapper.c: delete dead function git_mkstemps()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
Its last call site was replaced by mks_tempfile_ts() in 284098f (diff: use tempfile module - 2015-08-12) and there's a good chance mks_tempfile_ts will continue to successfully handle this job. Delete it. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 2 -- wrapper.c

[PATCH 1/2] dir.c: remove dead function fnmatch_icase()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
It was largely replaced by fnmatch_icase_mem() and its last use was in 84b8b5d (remove match_pathspec() in favor of match_pathspec_depth() - 2013-07-14). Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 7 --- dir.h | 1 - 2 files changed, 8 deletions(-) diff --git a/dir.c b/dir.c index

[PATCH v3 00/13] nd/worktree-various-heads

2016-04-22 Thread Nguyễn Thái Ngọc Duy
v3 fixes all the things found in v2, deletes unused stuff and adds a new patch 01/13 that renames str(n)cmp_icase to fspath(n)cmp. Interdiff diff --git a/branch.c b/branch.c index 8e323d3..a5a8dcb 100644 --- a/branch.c +++ b/branch.c @@ -338,12 +338,12 @@ void die_if_checked_out(const char *branc

[PATCH v3 01/13] dir.c: rename str(n)cmp_icase to fspath(n)cmp

2016-04-22 Thread Nguyễn Thái Ngọc Duy
These functions compare two paths that are taken from file system. Depending on the running file system, paths may need to be compared case-sensitively or not, and maybe even something else in future. The current names do not convey that well. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c

[PATCH v3 02/13] path.c: add git_common_path() and strbuf_git_common_path()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
functions will enable that. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 +++ path.c | 29 + 2 files changed, 32 insertions(+) diff --git a/cache.h b/cache.h index 2711048..c04a17f 100644 --- a/cache.h +++ b/cache.h @@ -799,11 +799,14 @@ extern void

[PATCH v3 05/13] worktree.c: mark current worktree

2016-04-22 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 24 worktree.h | 1 + 2 files changed, 25 insertions(+) diff --git a/worktree.c b/worktree.c index 360ba41..dc092a7 100644 --- a/worktree.c +++ b/worktree.c @@ -2,6 +2,7 @@ #include "refs.h" #include

[PATCH v3 07/13] wt-status.c: split rebase detection out of wt_status_get_state()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
worktree.c:find_shared_symref() later needs to know if a branch is being rebased, and only rebase, no cherry-pick, do detached branch... Split this code so it can be used independently from other in-progress tests. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 23

[PATCH v3 04/13] worktree.c: make find_shared_symref() return struct worktree *

2016-04-22 Thread Nguyễn Thái Ngọc Duy
This gives the caller more information and they can answer things like, "is it the main worktree" or "is it the current worktree". The latter question is needed for the "checkout a rebase branch" case later. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c

[PATCH v3 06/13] path.c: refactor and add worktree_git_path()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
, wt_status_get_state() will be converted using this to take am/rebase/... state of any worktree. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 24 ++-- worktree.h | 8 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/path.c b/path.c index 2ebb23d..8fdd187

[PATCH v3 03/13] worktree.c: store "id" instead of "git_dir"

2016-04-22 Thread Nguyễn Thái Ngọc Duy
We can reconstruct git_dir from id quite easily. It's a bit hackier to do the reverse. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c | 3 ++- worktree.c | 31 ++- worktree.h | 8 +++- 3 files changed, 27 insertions(+), 15 deletions(-) diff --

[PATCH v3 08/13] wt-status.c: make wt_status_check_rebase() work on any worktree

2016-04-22 Thread Nguyễn Thái Ngọc Duy
This is a preparation step for find_shared_symref() to detect if any worktree is being rebased. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 33 - wt-status.h | 5 - 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/wt-status.c b/wt

[PATCH v3 09/13] worktree.c: avoid referencing to worktrees[i] multiple times

2016-04-22 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worktree.c b/worktree.c index dc092a7..927905b 100644 --- a/worktree.c +++ b/worktree.c @@ -229,10 +229,12 @@ const struct worktree *find_shared_symref(const char *symref

[PATCH v3 10/13] worktree.c: check whether branch is rebased in another worktree

2016-04-22 Thread Nguyễn Thái Ngọc Duy
d_shared_symref() will prevent that and "git rebase --abort" will fail as a result. find_shared_symref() and die_if_checked_out() have to learn a new option ignore_current_worktree to loosen the test a bit. Signed-off-by: Nguyễn Thái Ngọc Duy --- branch.c| 4 ++-- branch.h

[PATCH v3 11/13] wt-status.c: split bisect detection out of wt_status_get_state()

2016-04-22 Thread Nguyễn Thái Ngọc Duy
And make it work with any given worktree, in preparation for (again) find_shared_symref(). read_and_strip_branch() is deleted because it's no longer used. Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 23 ++- wt-status.h | 2 ++ 2 files changed, 16 insertions(

[PATCH v3 12/13] worktree.c: check whether branch is bisected in another worktree

2016-04-22 Thread Nguyễn Thái Ngọc Duy
isect will fail to return to the (long gone) branch Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2025-worktree-add.sh | 13 + worktree.c | 19 +++ 2 files changed, 32 insertions(+) diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh index da5432

[PATCH v3 13/13] branch: do not rename a branch under bisect or rebase

2016-04-22 Thread Nguyễn Thái Ngọc Duy
s a lot more work. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/branch.c| 25 + t/t2025-worktree-add.sh | 8 worktree.c | 8 worktree.h | 3 +++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/built

[PATCH 00/41] Add and use error_errno() and warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
refs/files-backend.c untouched because they are currently hot zones. Nguyễn Thái Ngọc Duy (41): usage.c: move format processing out of die_errno() usage.c: add warning_errno() and error_errno() bisect.c: use die_errno() and warning_errno() builtin/am.c: use error_errno() builtin/branch.c

[PATCH 02/41] usage.c: add warning_errno() and error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Similar to die_errno(), these functions will append strerror() automatically. Signed-off-by: Nguyễn Thái Ngọc Duy --- git-compat-util.h | 2 ++ usage.c | 19 +++ 2 files changed, 21 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 1f8b5f3

[PATCH 01/41] usage.c: move format processing out of die_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
fmt_with_err() will be shared with the coming error_errno() and warning_errno(). Signed-off-by: Nguyễn Thái Ngọc Duy --- usage.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/usage.c b/usage.c index 82ff131..0dba0c5 100644 --- a/usage.c +++ b

[PATCH 05/41] builtin/branch.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/branch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 0adba62..6f1572d 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -593,8 +593,7 @@ static int edit_branch_description

[PATCH 04/41] builtin/am.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/am.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index d003939..3dfe70b 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -769,15 +769,15 @@ static int split_mail_conv(mail_conv_fn fn

[PATCH 03/41] bisect.c: use die_errno() and warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- bisect.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bisect.c b/bisect.c index 7996c29..6d93edb 100644 --- a/bisect.c +++ b/bisect.c @@ -860,8 +860,8 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int

[PATCH 10/41] builtin/pack-objects.c: use die_errno() and warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index a27de5b..e18e190 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -828,8 +828,7

[PATCH 09/41] builtin/merge-file.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/merge-file.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/merge-file.c b/builtin/merge-file.c index 5544705..13e22a2 100644 --- a/builtin/merge-file.c +++ b/builtin/merge-file.c @@ -62,8 +62,7 @@ int

[PATCH 06/41] builtin/fetch.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index f8455bd..1582ca7 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -607,7 +607,7 @@ static int store_updated_refs(const char

[PATCH 07/41] builtin/help.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/help.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/help.c b/builtin/help.c index 3c55ce4..8848013 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -127,7 +127,7 @@ static void exec_woman_emacs(const char

[PATCH 11/41] builtin/rm.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/rm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/rm.c b/builtin/rm.c index 8829b09..13b9639 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -152,7 +152,7 @@ static int check_local_mod(unsigned char *head, int

[PATCH 08/41] builtin/mailsplit.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/mailsplit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index 104277a..4859ede 100644 --- a/builtin/mailsplit.c +++ b/builtin/mailsplit.c @@ -109,7 +109,7 @@ static int

[PATCH 19/41] connected.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- connected.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/connected.c b/connected.c index 299c560..bf1b12e 100644 --- a/connected.c +++ b/connected.c @@ -86,17 +86,14 @@ static int check_everything_connected_real

[PATCH 16/41] combine-diff.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- combine-diff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index 0e1d4b0..8f2313d 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -1005,8 +1005,7 @@ static void show_patch_diff(struct

[PATCH 20/41] copy.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- copy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/copy.c b/copy.c index 574fa1f..4de6a11 100644 --- a/copy.c +++ b/copy.c @@ -42,15 +42,15 @@ int copy_file(const char *dst, const char *src, int mode) status = copy_fd

[PATCH 24/41] entry.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- entry.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/entry.c b/entry.c index a410957..519e042 100644 --- a/entry.c +++ b/entry.c @@ -168,8 +168,8 @@ static int write_entry(struct cache_entry *ce

[PATCH 14/41] builtin/worktree.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index d8e3795..331ecf6 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -110,7 +110,7 @@ static void prune_worktrees

[PATCH 12/41] builtin/update-index.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
"err" is deleted because it just causes confusion when "errno" is also used directly in process_lstat_error(). Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/update-inde

[PATCH 15/41] check-racy.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- check-racy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-racy.c b/check-racy.c index 00d92a1..24b6542 100644 --- a/check-racy.c +++ b/check-racy.c @@ -12,7 +12,7 @@ int main(int ac, char **av) struct stat st

[PATCH 22/41] diff-no-index.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- diff-no-index.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/diff-no-index.c b/diff-no-index.c index 03daadb..1f8999b 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -65,8 +65,7 @@ static int populate_from_stdin(struct

[PATCH 21/41] credential-cache--daemon.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- credential-cache--daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c index 291c0fd..1f14d56 100644 --- a/credential-cache--daemon.c +++ b/credential-cache--daemon.c

[PATCH 13/41] builtin/upload-archive.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/upload-archive.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c index dbfe14f..2caedf1 100644 --- a/builtin/upload-archive.c +++ b/builtin/upload-archive.c @@ -104,8 +104,7

[PATCH 17/41] compat/win32/syslog.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- compat/win32/syslog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/win32/syslog.c b/compat/win32/syslog.c index b905aea..1c2ae18 100644 --- a/compat/win32/syslog.c +++ b/compat/win32/syslog.c @@ -28,13 +28,13 @@ void

[PATCH 18/41] config.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- config.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/config.c b/config.c index 10b5c95..80411e4 100644 --- a/config.c +++ b/config.c @@ -2012,7 +2012,7 @@ int git_config_set_multivar_in_file_gently(const char

[PATCH 23/41] editor.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- editor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor.c b/editor.c index 01c644c..7519ede 100644 --- a/editor.c +++ b/editor.c @@ -63,7 +63,6 @@ int launch_editor(const char *path, struct strbuf *buffer, const char *const

[PATCH 28/41] http.c: use error_errno() and warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- http.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 4304b80..7565c93 100644 --- a/http.c +++ b/http.c @@ -446,8 +446,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type

[PATCH 26/41] gpg-interface.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- gpg-interface.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gpg-interface.c b/gpg-interface.c index 2259938..c4b1e8c 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -219,11 +219,9 @@ int verify_signed_buffer(const char

[PATCH 27/41] grep.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grep.c b/grep.c index 528b652..87c1890 100644 --- a/grep.c +++ b/grep.c @@ -1732,7 +1732,7 @@ static int grep_source_load_file(struct grep_source *gs) if (lstat(filename

[PATCH 25/41] fast-import.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- fast-import.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fast-import.c b/fast-import.c index 9fc7093..21881d1 100644 --- a/fast-import.c +++ b/fast-import.c @@ -414,7 +414,7 @@ static void write_crash_report(const char

[PATCH 33/41] run-command.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- run-command.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/run-command.c b/run-command.c index e4593cd..842c8d1 100644 --- a/run-command.c +++ b/run-command.c @@ -233,7 +233,7 @@ static int wait_or_whine(pid_t pid

[PATCH 32/41] rerere.c: use error_errno() and warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- rerere.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/rerere.c b/rerere.c index c8b9f40..1810c04 100644 --- a/rerere.c +++ b/rerere.c @@ -501,8 +501,7 @@ static int handle_file(const char *path, unsigned char

[PATCH 30/41] mailmap.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- mailmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mailmap.c b/mailmap.c index 9726237..b5c521f 100644 --- a/mailmap.c +++ b/mailmap.c @@ -189,8 +189,7 @@ static int read_mailmap_file(struct string_list *map, const char

[PATCH 29/41] ident.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ident.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ident.c b/ident.c index 4fd82d1..139c528 100644 --- a/ident.c +++ b/ident.c @@ -75,14 +75,12 @@ static int add_mailname_host(struct strbuf *buf) mailname = fopen

[PATCH 31/41] reachable.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- reachable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reachable.c b/reachable.c index ed35201..d0199ca 100644 --- a/reachable.c +++ b/reachable.c @@ -119,8 +119,7 @@ static int add_recent_loose(const unsigned char *sha1

[PATCH 34/41] sequencer.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sequencer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sequencer.c b/sequencer.c index e66f2fe..4687ad4 100644 --- a/sequencer.c +++ b/sequencer.c @@ -875,8 +875,7 @@ static int sequencer_rollback(struct replay_opts *opts

[PATCH 37/41] transport-helper.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- transport-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index b934183..f09fadc 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -1166,7 +1166,7 @@ static int

[PATCH 35/41] server-info.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- server-info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-info.c b/server-info.c index 5a86e29..75dd677 100644 --- a/server-info.c +++ b/server-info.c @@ -36,7 +36,7 @@ static int update_info_file(char *path, int (*generate

[PATCH 41/41] wrapper.c: use warning_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrapper.c b/wrapper.c index 9afc1a0..3df2fe0 100644 --- a/wrapper.c +++ b/wrapper.c @@ -572,7 +572,7 @@ static int warn_if_unremovable(const char *op, const char *file, int

[PATCH 38/41] unpack-trees.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/unpack-trees.c b/unpack-trees.c index 9f55cc2..bb0d142 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1499,8 +1499,7 @@ static int verify_absent_1(const struct

[PATCH 36/41] sha1_file.c: use {error,die,warning}_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1_file.c | 32 +--- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index d0f2aa0..a7f45b3 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1107,9 +1107,8 @@ unsigned char *use_pack

[PATCH 40/41] vcs-svn: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- vcs-svn/line_buffer.c| 4 ++-- vcs-svn/sliding_window.c | 2 +- vcs-svn/svndiff.c| 4 ++-- vcs-svn/svndump.c| 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vcs-svn/line_buffer.c b/vcs-svn/line_buffer.c index

[PATCH 39/41] upload-pack.c: use error_errno()

2016-05-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index dc802a0..f19444d 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -174,8 +174,7 @@ static void create_pack_file(void

[PATCH] remote.c: specify correct plural form in "commit diverge" message

2016-05-02 Thread Nguyễn Thái Ngọc Duy
sh may have more than one plural form. Reported-by: Alfonsogonzalez, Ernesto (GE Digital) Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.c b/remote.c index 28fd676..212426e 100644 --- a/remote.c +++ b/remote.c

[PATCH v4 1/9] trace.c: add GIT_TRACE_PACK_STATS for pack usage statistics

2015-11-01 Thread Nguyễn Thái Ngọc Duy
trace_stats() is intended for GIT_TRACE_*_STATS variable group and GIT_TRACE_PACK_STATS is more like an example how new vars can be added. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git.txt | 3 +++ cache.h | 2 ++ git.c | 1 + sha1_file.c

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

2015-11-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 84616c8..a76c789 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7 @@ struct ondisk_cache_entry_extended

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

2015-11-01 Thread 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 changed, 6 insertions(+), 4 deletions(-) diff --git a/builtin/gc.c

[PATCH v4 9/9] index-helper: add Windows support

2015-11-01 Thread Nguyễn Thái Ngọc Duy
storing it in headers would cause more problems with munmap, storing it as a separate shm is even worse). PostMessage is used instead of UNIX signals for notification. Lightweight (at least code-wise) on the client side. Signed-off-by: Nguyễn Thái Ngọc Duy --- config.mak.uname | 2 ++ inde

[PATCH v4 8/9] index-helper: add --detach

2015-11-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 10 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/git-index-helper.txt b/Documentation/git-index-helper.txt index ad40366..9ced091

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

2015-11-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 +++ read-cache.c | 13 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 8791dbc..89e9aaf 100644 --- a/cache.h +++ b/cache.h @@ -311,11 +311,14 @@ struct index_state { struct

[PATCH v4 6/9] index-helper: add --strict

2015-11-01 Thread Nguyễn Thái Ngọc Duy
t shared memory. --strict is added to avoid that Strictly speaking there's still a very small gap where corrupt shared memory could still be read by git: after we write the trailing SHA-1 in the shared memory (thus signaling "this shm is ready") and before verify_shm() detects an error. S

[PATCH v4 5/9] trace.c: add GIT_TRACE_INDEX_STATS for index statistics

2015-11-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git.txt | 1 + cache.h | 1 + read-cache.c | 16 trace.c | 5 - 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index

[PATCH v4 0/9] Reduce index load time

2015-11-01 Thread Nguyễn Thái Ngọc Duy
refresh time. To be posted shortly after this. [0] http://mid.gmane.org/1406548995-28549-1-git-send-email-pclo...@gmail.com [2] http://github.com/pclouds/git/commits/index-helper Nguyễn Thái Ngọc Duy (9): trace.c: add GIT_TRACE_PACK_STATS for pack usage statistics read-cache.c: fix constness of

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

2015-11-01 Thread Nguyễn Thái Ngọc Duy
ex-helper. It makes sense as v4 requires more processing after loading the index: (vanilla) 0.72249 s: read_index_from .git/index (index-helper) 0.302741500 s: read_index_from .git/index Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 1

[PATCH 0/5] Use watchman to reduce index refresh time

2015-11-01 Thread Nguyễn Thái Ngọc Duy
remaining piece is killing lstat() from untracked cache, but right now it's just some idea and incomplete code. [1] https://github.com/pclouds/git/commits/refresh-with-watchman [2] https://github.com/facebook/watchman/issues/19 Nguyễn Thái Ngọc Duy (5): read-cache: add watchman 'WAMA'

[PATCH 1/5] read-cache: add watchman 'WAMA' extension

2015-11-01 Thread Nguyễn Thái Ngọc Duy
'skipping refresh' bit is not in this patch yet as we would need watchman. More details in later patches. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 4 read-cache.c | 71 ++-- 2 files changed, 73 insertions(+), 2

[PATCH 4/5] index-helper: use watchman to avoid refreshing index with lstat()

2015-11-01 Thread Nguyễn Thái Ngọc Duy
ex-helper is, when used with untracked cache, we need to keep track of $GIT_WORK_TREE file listing. That kind of list can be kept in index-helper. Signed-off-by: Nguyễn Thái Ngọc Duy --- Makefile | 5 cache.h| 2 ++ index-helper.c | 84 +

[PATCH 3/5] read-cache: allow index-helper to prepare shm before git reads it

2015-11-01 Thread Nguyễn Thái Ngọc Duy
If index-helper puts 'W' before pid in $GIT_DIR/index-helper.pid, then git will sleep for a while, expecting to be waken up by SIGUSR1 when index-helper has done shm preparation, or after the timeout. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 14 -- 1 file c

[PATCH 5/5] update-index: enable/disable watchman support

2015-11-01 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/builtin/update-index.c b/builtin/update-index.c index 7431938..86aec21 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -903,6 +903,7 @@ int

[PATCH 2/5] Add watchman support to reduce index refresh cost

2015-11-01 Thread Nguyễn Thái Ngọc Duy
g it a bit. [1] http://article.gmane.org/gmane.comp.version-control.git/248006 Signed-off-by: Nguyễn Thái Ngọc Duy --- Makefile | 7 +++ cache.h | 1 + config.c | 5 +++ configure.ac | 8 environment.c| 3 ++ wat

[PATCH] mailinfo: fix passing wrong address to git_mailinfo_config

2015-11-01 Thread Nguyễn Thái Ngọc Duy
i->use_scissors. This is caught by t4150.20. git_mailinfo_config() breaks mi->name.alloc and makes strbuf_release() in clear_mailinfo() attempt to free strbuf_slopbuf. Signed-off-by: Nguyễn Thái Ngọc Duy --- mailinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailinfo.

[PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

2015-11-02 Thread Nguyễn Thái Ngọc Duy
file, which is an indication this is a linked worktree. Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c| 2 +- t/t0002-gitfile.sh | 7 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.c b/setup.c index d343725..b30d923 100644 --- a/setup.c +++ b/setup.c @@ -

<    5   6   7   8   9   10   11   12   13   14   >