[PATCH v2 23/27] clone: define shallow clone boundary with --shallow-exclude

2016-06-12 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 5 + builtin/clone.c | 10 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index a410409

[PATCH v2 26/27] upload-pack: add get_reachable_list()

2016-06-12 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- object.h | 2 +- upload-pack.c | 52 +--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/object.h b/object.h index f8b6442..614a006 100644 --- a/object.h +++ b/object.h @@ -31,7 +31,7

[PATCH v2 27/27] fetch, upload-pack: --deepen=N extends shallow boundary by N commits

2016-06-12 Thread Nguyễn Thái Ngọc Duy
ed-by: Eric Sunshine Helped-by: Junio C Hamano Signed-off-by: Dongcan Jiang Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/fetch-options.txt | 5 + Documentation/git-fetch-pack.txt | 5 + Documentation/gitremote-helpers.txt |

[PATCH v5 5/6] worktree: add "unlock" command

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 5 + builtin/worktree.c | 28 contrib/completion/git-completion.bash | 2 +- t/t2028-worktree-move.sh | 14 ++ 4 files changed, 48

[PATCH v5 6/6] worktree.c: find_worktree() search by path suffix

2016-06-13 Thread Nguyễn Thái Ngọc Duy
orktree iteration loop, the code is split into a separate function for clarity. Suggested-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 5 + worktree.c | 29 + 2 files changed, 34 insertions

[PATCH v5 0/6] worktree lock/unlock

2016-06-13 Thread Nguyễn Thái Ngọc Duy
char *is_worktree_locked(struct worktree *wt) wt->lock_reason = strbuf_detach(&lock_reason, NULL); } else wt->lock_reason = NULL; + wt->lock_reason_valid = 1; strbuf_release(&path);

[PATCH v5 1/6] worktree.c: add find_worktree()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
ly go cheaper with comparing inode number (and probably more reliable than paths when unicode enters the game). But not all systems have good inode that so let's stick to something simple for now. Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 15 +++

[PATCH v5 3/6] worktree.c: add is_worktree_locked()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
We need this later to avoid double locking a worktree, or unlocking one when it's not even locked. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 28 worktree.h | 8 2 files changed, 36 insertions(+) diff --git a/worktree.c b/worktree.c

[PATCH v5 4/6] worktree: add "lock" command

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 26 +- builtin/worktree.c | 38 +++ contrib/completion/git-completion.bash | 5 +++- t/t2028-worktree-move.sh (new +x) | 48

[PATCH v5 2/6] worktree.c: add is_main_worktree()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Main worktree _is_ different. You can lock (*) a linked worktree but not the main one, for example. Provide an API for checking that. (*) Add the file $GIT_DIR/worktrees/xxx/locked to avoid worktree xxx from being removed or moved. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 5

[PATCH v3] lib-httpd.sh: print error.log on error

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Failure to bring up httpd for testing is not considered an error, so the trash directory, which contains this error.log file, is removed and we don't know what made httpd fail to start. Improve the situation a bit, print error.log but only in verbose mode. Signed-off-by: Nguyễn Thái Ngọ

[PATCH 1/2] pretty: pass graph width to pretty formatting for use in '%>|(N)'

2016-06-16 Thread Nguyễn Thái Ngọc Duy
all commit hashes align at 20th column from the edge of the terminal, not from the edge of the graph. Signed-off-by: Josef Kufner Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- commit.h | 1 + graph.c | 7 +++ graph.h

[PATCH 2/2] pretty.c: support |() forms

2016-06-16 Thread Nguyễn Thái Ngọc Duy
tive num for that. Inspired by Go's array syntax (*). (*) I know Python has this first (or before Go, at least) but the idea didn't occur to me until I learned Go. Signed-off-by: Nguyễn Thái Ngọc Duy --- pretty.c | 8 +++- t/t4205

[PATCH 0/2] Log pretty format alignment improvements

2016-06-16 Thread Nguyễn Thái Ngọc Duy
in my opinion. [1] http://thread.gmane.org/gmane.comp.version-control.git/277710/focus=278326 Josef Kufner (1): pretty: pass graph width to pretty formatting for use in '%>|(N)' Nguyễn Thái Ngọc Duy (1): pretty.c: support |() forms commit.h |

[PATCH] po/vi.po: add a missing space

2016-08-22 Thread Nguyễn Thái Ngọc Duy
This space is important because the %s could be ":/abc", which makes the final output "tham chiếu không phải là một cây::/abc". "cây::/abc" looks like a new fancy form of extended SHA-1 syntax. But it's not. Signed-off-by: Nguyễn Thái Ngọc Duy --- po/vi.po

[PATCH] checkout: swap the order of ambiguity check for :/ syntax

2016-08-22 Thread Nguyễn Thái Ngọc Duy
ntic, we should check if "abc" from ":/abc" exists as an _index_ entry, not on disk. But chances are they exist in both places anyway... Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 16 1 file changed, 16 insertions(+) diff --git a/builtin/c

[PATCH 0/3] fix checkout ambiguation in subdir

2016-09-07 Thread Nguyễn Thái Ngọc Duy
I need some more time (which I don't have) to convince myself about the "git checkout :/abc" patch. But these look like good bug fix/improvement. Nguyễn Thái Ngọc Duy (3): checkout: add some spaces between code and comment checkout.txt: document a common case that ignores am

[PATCH 1/3] checkout: add some spaces between code and comment

2016-09-07 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 8672d07..1f71d06 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1038,7 +1038,7 @@ static int

[PATCH 3/3] checkout: fix ambiguity check in subdir

2016-09-07 Thread Nguyễn Thái Ngọc Duy
The two functions in parse_branchname_arg(), verify_non_filename and check_filename, need correct prefix in order to reconstruct the paths and check for their existence. With NULL prefix, they just check paths at top dir instead. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c

[PATCH 2/3] checkout.txt: document a common case that ignores ambiguation rules

2016-09-07 Thread Nguyễn Thái Ngọc Duy
ot;. Let's document this exception. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-checkout.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 7a2201b..94eb238 100644 --- a/Documentation/git-che

[PATCH 2/3] t0001: work around the bug that reads config file before repo setup

2016-09-08 Thread Nguyễn Thái Ngọc Duy
ur tests in the next patch as we will compare the config file and expect that core.logallrefupdates is already set to true by "git init main-worktree". Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t0001-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/t0001-init.sh b/t/t0

[PATCH 0/3] Fix git-init in linked worktrees

2016-09-08 Thread Nguyễn Thái Ngọc Duy
ME in there. It will take a lot more time to remove that FIXME (because setup_git_directory is not as simple). For now it should be ok to leave it there. When we find a use for get_first_git_dir outside git-init, we can fix it then. Nguyễn Thái Ngọc Duy (3): init: correct re-initialization fr

[PATCH 1/3] init: correct re-initialization from a linked worktree

2016-09-08 Thread Nguyễn Thái Ngọc Duy
N_DIR. Fix that with get_git_common_dir(). This function will return $GIT_DIR in single-worktree setup, so we don't have to make a special case for multiple-worktree here. (*) It does in fact, thanks to another bug. More on that later. Noticed-by: Max Nordlund Helped-by: Michael

[PATCH 3/3] init: do not set core.worktree more often than necessary

2016-09-08 Thread Nguyễn Thái Ngọc Duy
init" from a linked worktree, you set core.worktree (for the main repo) pointing to the _linked_ worktree. After that point, may you live in interesting times. Record the .git file location and use it here. Noticed-by: Max Nordlund Helped-by: Michael J Gruber Signed-off-by: Nguyễn Thái Ngọc D

[PATCH v2 0/3] Fix git-init in linked worktrees

2016-09-21 Thread Nguyễn Thái Ngọc Duy
new 2/3 Nguyễn Thái Ngọc Duy (3): init: correct re-initialization from a linked worktree init: do not set core.worktree more often than necessary init: reuse original_git_dir in set_git_dir_init() builtin/init-db.c | 11 +++ t/t0001-init.sh | 17 + 2 files changed

[PATCH v2 3/3] init: reuse original_git_dir in set_git_dir_init()

2016-09-21 Thread Nguyễn Thái Ngọc Duy
Since original_git_dir is a copy of real_path(git_dir), let's reuse it and avoid calling real_path() more than necessary. The xstrdup() is removed too because original_git_dir is already a copy, and we're not going to free git_link in this code probably forever. Signed-off-by: Nguyễn

[PATCH v2 1/3] init: correct re-initialization from a linked worktree

2016-09-21 Thread Nguyễn Thái Ngọc Duy
oticed-by: Max Nordlund Helped-by: Michael J Gruber Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 2 +- t/t0001-init.sh | 15 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index cc09fca..d5d7558 100644 --

[PATCH v2 2/3] init: do not set core.worktree more often than necessary

2016-09-21 Thread Nguyễn Thái Ngọc Duy
x27; is a symlink. Hopefully it's not longer used in favor of .git files. Noticed-by: Max Nordlund Helped-by: Michael J Gruber Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 5 - t/t0001-init.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin

[PATCH v2 4/3] init: combine set_git_dir_init() and init_db() into one

2016-09-23 Thread Nguyễn Thái Ngọc Duy
), is used instead, the trick in that commit breaks down. To eliminate the possibility that init_db() in future may be called without set_git_dir_init(), init_db() now calls that function internally (and does not allow anybody else to use it). Signed-off-by: Nguyễn Thái Ngọc Duy --- I think a separ

[PATCH v3 2/5] init: call set_git_dir_init() from within init_db()

2016-09-24 Thread Nguyễn Thái Ngọc Duy
The next commit requires that set_git_dir_init() must be called before init_db(). Let's make sure nobody can do otherwise. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 15 +++ builtin/init-db.c | 18 +++--- cache.h | 5 +++-- 3 files change

[PATCH v3 3/5] init: kill set_git_dir_init()

2016-09-24 Thread Nguyễn Thái Ngọc Duy
This is a pure code move, necessary to kill the global variable git_link later (and also helps a bit in the next patch). Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 50 +- 1 file changed, 21 insertions(+), 29 deletions(-) diff

[PATCH v3 1/5] init: correct re-initialization from a linked worktree

2016-09-24 Thread Nguyễn Thái Ngọc Duy
oticed-by: Max Nordlund Helped-by: Michael J Gruber Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 2 +- t/t0001-init.sh | 15 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index cc09fca..d5d7558 100644 --

[PATCH v3 4/5] init: do not set unnecessary core.worktree

2016-09-24 Thread Nguyễn Thái Ngọc Duy
to needs_work_tree_config() to fix this. Noticed-by: Max Nordlund Helped-by: Michael J Gruber Helped-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 9 ++--- t/t0001-init.sh | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/builtin/in

[PATCH v3 5/5] init: kill git_link variable

2016-09-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/init-db.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 8069cd2..37e318b 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -22,7 +22,6 @@ static int

[PATCH 0/3] i-t-a entries in git-status, and git-commit

2016-09-28 Thread Nguyễn Thái Ngọc Duy
we try to handle case by case (e.g. index_differs_from in the second patch). 3) could be handled pretty easily once you know the problem. This is the third patch. Nguyễn Thái Ngọc Duy (3): Resurrect "diff-lib.c: adjust position of i-t-a entries in diff" diff-lib.c: enable --shift-i

[PATCH 1/3] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"

2016-09-28 Thread Nguyễn Thái Ngọc Duy
stat" to "git status" Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/diff-options.txt | 7 +++ diff-lib.c | 12 diff.c | 2 ++ diff.h | 1 + t/t2203-add-intent.sh | 20 ++

[PATCH 2/3] diff-lib.c: enable --shift-ita in index_differs_from()

2016-09-28 Thread Nguyễn Thái Ngọc Duy
igned-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 + diff-lib.c| 1 + read-cache.c | 10 ++ sequencer.c | 5 +++-- t/t2203-add-intent.sh | 11 +++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cache.h b/cache.h in

[PATCH 3/3] commit: don't be fooled by ita entries when creating initial commit

2016-09-28 Thread Nguyễn Thái Ngọc Duy
ita entries are dropped at tree creation phase. If the entire index consists of just ita entries, the result would be a a commit with no entries, which should be caught unless --allow-empty is specified. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 11 --- t/t2203-add

[PATCH v3 0/2] Kill and replace update_linked_gitdir()

2016-01-22 Thread Nguyễn Thái Ngọc Duy
v3 kills the update_linked_gitdir's replacement in v2. I'll come back to "worktree mv" (and think more about hardlink support) once I'm done with worktree's config split. Nguyễn Thái Ngọc Duy (2): worktree.c: fix indentation worktree: stop supporting moving work

[PATCH v3 2/2] worktree: stop supporting moving worktrees manually

2016-01-22 Thread Nguyễn Thái Ngọc Duy
y) Instead of fixing this, we step back a bit. The original design was probably not well thought out. For now, if the user manually moves a worktree, they have to fix up "gitdir" file manually or the worktree will get pruned. Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc

[PATCH v3 1/2] worktree.c: fix indentation

2016-01-22 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/worktree.c b/worktree.c index 981f810..6181a66 100644 --- a/worktree.c +++ b/worktree.c @@ -176,10 +176,10 @@ struct worktree **get_worktrees(void

[PATCH v3 1/6] worktree: new repo extension to manage worktree behaviors

2016-01-26 Thread Nguyễn Thái Ngọc Duy
gly. This extension has no use yet. The first one will be config split. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 12 Documentation/technical/repository-version.txt | 6 ++ cache.h| 1 + env

[PATCH v3 0/6] Split .git/config in multiple worktree setup

2016-01-26 Thread Nguyễn Thái Ngọc Duy
to deal with released git binaries, how to make it reject the new config split (because otherwise it would read incorrectly). A lot more explanation is in patch 04/06. The series is also available at https://github.com/pclouds/git/tree/worktree-config Nguyễn Thái Ngọc Duy (6): worktree: new rep

[PATCH v3 2/6] path.c: new (identical) list for worktree v1

2016-01-26 Thread Nguyễn Thái Ngọc Duy
Worktree v1 may have different .git file split than v0. Add support code to change common file list based on extensions.worktree. The list for now is identical to v0. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 40 +--- 1 file changed, 37 insertions

[PATCH v3 3/6] worktree: share .git/common in v1

2016-01-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitrepository-layout.txt | 4 path.c | 1 + 2 files changed, 5 insertions(+) diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt index 577ee84..771e362 100644

[PATCH v3 6/6] worktree add: switch to worktree version 1

2016-01-26 Thread Nguyễn Thái Ngọc Duy
ace it does not make sense for core.bare to be worktree specific. It's made so in order to "grow" new worktrees from a bare repo. In these new linked worktrees, core.bare will be hidden away and worktree-related commands won't complain about bare repository. Signed-of

[PATCH v3 4/6] worktree: new config file hierarchy

2016-01-26 Thread Nguyễn Thái Ngọc Duy
tion is tweaked a bit in this case. The presence of $C/worktrees/config implies worktree version 1+. The lack of it implies wortree version 0. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config.txt | 5 +++-- Documentation/git-worktree.txt | 8 ++-

[PATCH v3 5/6] config: select .git/common/config with --repo

2016-01-26 Thread Nguyễn Thái Ngọc Duy
This new option allows the user to write to or read from .git/common/config in worktree v1. In worktree v0, --repo is an alias of --local. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-config.txt | 14 +- Documentation/git-worktree.txt | 4

[PATCH] git.c: fix help.autocorrect after 57ea712 breaks it

2016-01-26 Thread Nguyễn Thái Ngọc Duy
d restore_env() in pairs. While at there, set orig_cwd to NULL after freeing it for hygiene. Reported-by: Michael J Gruber Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 11 --- t/t1300-repo-config.sh | 8 2 files changed, 16 insertions(+), 3 deletions(-) diff

[PATCH v5 03/10] test-regex: expose full regcomp() to the command line

2016-01-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- test-regex.c | 56 ++-- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/test-regex.c b/test-regex.c index 0dc598e..3b5641c 100644 --- a/test-regex.c +++ b/test-regex.c @@ -1,19 +1,63

[PATCH v5 00/10] Fix icase grep on non-ascii

2016-01-28 Thread Nguyễn Thái Ngọc Duy
=276288 Nguyễn Thái Ngọc Duy (10): grep: allow -F -i combination grep: break down an "if" stmt in preparation for next changes test-regex: expose full regcomp() to the command line grep/icase: avoid kwsset on literal non-ascii strings grep/icase: avoid kwsset when -F is specified

[PATCH v5 01/10] grep: allow -F -i combination

2016-01-28 Thread Nguyễn Thái Ngọc Duy
-F means "no regex", not "case sensitive" so it should not override -i Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/grep.c b/builtin/grep.c index 5526fd7..4be0df5 100644 --- a/builtin/

[PATCH v5 04/10] grep/icase: avoid kwsset on literal non-ascii strings

2016-01-28 Thread Nguyễn Thái Ngọc Duy
instead. Slower, but accurate. Helped-by: René Scharfe Noticed-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 7 ++- t/t7812-grep-icase-non-ascii.sh (new +x) | 23 +++ 2 files changed, 29 insertions(+), 1 deletion

[PATCH v5 02/10] grep: break down an "if" stmt in preparation for next changes

2016-01-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grep.c b/grep.c index 7b2b96a..e739d20 100644 --- a/grep.c +++ b/grep.c @@ -403,9 +403,11 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) p

[PATCH v5 08/10] grep/pcre: support utf-8

2016-01-28 Thread Nguyễn Thái Ngọc Duy
a byte stream and everything should work. If we force utf-8 based on locale only and pcre validates utf-8 and the file content is in non-utf8 encoding, things break. Noticed-by: Plamen Totev Helped-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 2

[PATCH v5 09/10] diffcore-pickaxe: "share" regex error handling code

2016-01-28 Thread Nguyễn Thái Ngọc Duy
There's another regcomp code block coming in this function. By moving the error handling code out of this block, we don't have to add the same error handling code in the new block. Signed-off-by: Nguyễn Thái Ngọc Duy --- diffcore-pickaxe.c | 16 1 file changed, 8

[PATCH v5 05/10] grep/icase: avoid kwsset when -F is specified

2016-01-28 Thread Nguyễn Thái Ngọc Duy
ue at least for UTF-8. For others, let's wait until people yell up. Chances are nobody uses multibyte, non utf-8 charsets any more.. Helped-by: René Scharfe Noticed-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 25 ++

[PATCH v5 10/10] diffcore-pickaxe: support case insensitive match on non-ascii

2016-01-28 Thread Nguyễn Thái Ngọc Duy
.sh might cause problems elsewhere, probably.. Noticed-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- diffcore-pickaxe.c | 11 +++ t/t7812-grep-icase-non-ascii.sh | 7 +++ 2 files changed, 18 insertions(+) diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.

[PATCH v5 06/10] grep/pcre: prepare locale-dependent tables for icase matching

2016-01-28 Thread Nguyễn Thái Ngọc Duy
The default tables are usually built with C locale and only suitable for LANG=C or similar. This should make case insensitive search work correctly for all single-byte charsets. Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 8 ++-- grep.h

[PATCH v5 07/10] gettext: add is_utf8_locale()

2016-01-28 Thread Nguyễn Thái Ngọc Duy
UTF-8. pcre library might support utf-8 even if libc is built without locale support.. The peeking code is a copy from compat/regex/regcomp.c Helped-by: Ævar Arnfjörð Bjarmason Signed-off-by: Nguyễn Thái Ngọc Duy --- gettext.c | 24 ++-- gettext.h | 1 + 2 files changed,

[PATCH 00/20] "git worktree move" preview

2016-02-03 Thread Nguyễn Thái Ngọc Duy
ould make Windows adaptation harder later on. A little off topic. The first two patches adds sys_error() that, like die_errno(), automatically do strerror(). There's a 38 patches series to convert error("...: %s", ..., strerror(errno)) to use it. I think it's a good idea. So un

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

2016-02-03 Thread Nguyễn Thái Ngọc Duy
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/usage.c @@ -109,19 +109,12 @@ void NORETURN die(const char *err, ...) va_end

[PATCH 04/20] path.c: add is_git_path_shared()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 2 ++ path.c | 27 ++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/cache.h b/cache.h index ec71181..c75d13f 100644 --- a/cache.h +++ b/cache.h @@ -748,6 +748,8 @@ extern int check_repository_format

[PATCH 05/20] copy.c: add copy_dir_recursively()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
emory when displaying IPv6 addresses - 2016-01-18) Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 + copy.c | 371 2 files changed, 372 insertions(+) diff --git a/cache.h b/cache.h index c75d13f..3fbb38d 100644 --- a/ca

[PATCH 02/20] usage.c: add sys_error() that prints strerror() automatically

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git-compat-util.h | 1 + usage.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index e8f2867..f2bd775 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -398,6 +398,7 @@ extern

[PATCH 07/20] worktree.c: store "id" instead of "git_dir"

2016-02-03 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 | 29 - worktree.h | 7 ++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/worktree.c b/worktree.c

[PATCH 08/20] worktree.c: add clear_worktree()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 14 +++--- worktree.h | 5 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/worktree.c b/worktree.c index 4c38414..b4e4b57 100644 --- a/worktree.c +++ b/worktree.c @@ -4,14 +4,22 @@ #include "workt

[PATCH 11/20] worktree.c: recognize no main worktree

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Because HEAD is part of repository signature, even if it's per-worktree file, we can't simply delete it. So main worktree is considered gone if .git/HEAD contains all-zero SHA-1. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[PATCH 09/20] worktree.c: add find_worktree_by_path()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 16 worktree.h | 6 ++ 2 files changed, 22 insertions(+) diff --git a/worktree.c b/worktree.c index b4e4b57..e444ad1 100644 --- a/worktree.c +++ b/worktree.c @@ -198,6 +198,22 @@ const char *get_worktree_git_dir(const

[PATCH 10/20] worktree.c: add is_main_worktree()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 5 + worktree.h | 5 + 2 files changed, 10 insertions(+) diff --git a/worktree.c b/worktree.c index e444ad1..e878f49 100644 --- a/worktree.c +++ b/worktree.c @@ -214,6 +214,11 @@ struct worktree *find_worktree_by_path(struct worktree

[PATCH 06/20] worktree.c: use is_dot_or_dotdot()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 2 +- worktree.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 475b958..7b217fb 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -94,7 +94,7

[PATCH 12/20] worktree.c: add update_worktree_location()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 23 +++ worktree.h | 6 ++ 2 files changed, 29 insertions(+) diff --git a/worktree.c b/worktree.c index 80c525b..a11c053 100644 --- a/worktree.c +++ b/worktree.c @@ -221,6 +221,29 @@ int is_main_worktree(const struct

[PATCH 13/20] worktree.c: add update_worktree_gitfile()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 15 ++- worktree.h | 7 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/worktree.c b/worktree.c index a11c053..d4513b1 100644 --- a/worktree.c +++ b/worktree.c @@ -237,13 +237,26 @@ int

[PATCH 03/20] path.c: add git_common_path() and strbuf_git_common_path()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
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 dfc459c..ec71181 100644 --- a/cache.h +++ b/cache.h @@ -747,11 +747,14 @@ extern int check_repository_format(void

[PATCH 14/20] worktree.c: add collect_per_worktree_git_paths()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 58 ++ worktree.h | 6 ++ 2 files changed, 64 insertions(+) diff --git a/worktree.c b/worktree.c index d4513b1..047319b 100644 --- a/worktree.c +++ b/worktree.c @@ -257,6 +257,64

[PATCH 16/20] worktree: simplify prefixing paths

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index f490ca3..36d942e 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -332,7 +332,7 @@ static int add(int ac

[PATCH 18/20] worktree: refactor add_worktree()

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 130 + 1 file changed, 81 insertions(+), 49 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 8d59199..3ebb9e9 100644 --- a/builtin/worktree.c +++ b/builtin

[PATCH 15/20] worktree: avoid 0{40}, too many zeroes, hard to read

2016-02-03 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 7b217fb..f490ca3 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -263,7 +263,7 @@ static int add_worktree(const

[PATCH 17/20] worktree: add "move" commmand

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c| 51 +++ t/t2028-worktree-move.sh (new +x) | 41 +++ 2 files changed, 92 insertions(+) create mode 100755 t/t2028-worktree-move.sh diff --git a/builtin

[PATCH 20/20] worktree: move repo, convert main worktree

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 87 ++-- t/t2028-worktree-move.sh | 36 2 files changed, 112 insertions(+), 11 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 80a8b80

[PATCH 19/20] worktree: move repo, simple case

2016-02-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 45 + 1 file changed, 45 insertions(+) diff --git a/builtin/worktree.c b/builtin/worktree.c index 3ebb9e9..80a8b80 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -477,9 +477,52

[PATCH v2 05/25] upload-pack: move "shallow" sending code out of deepen()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 97ed620..0eb9a0b 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -538,6 +538,20 @@ error

[PATCH v2 04/25] upload-pack: move shallow deepen code out of receive_needs()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
This is a prep step for further refactoring. Besides reindentation and s/shallows\./shallows->/g, no other changes are expected. Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 99 +++ 1 file changed, 52 insertions(+), 47 deleti

[PATCH v2 07/25] upload-pack: move "unshallow" sending code out of deepen()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Also add some more comments in this code because it takes too long to understand what it does (to me, who should be familiar enough to understand this code well!) Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 39 ++- 1 file changed, 26 insertions

[PATCH v2 01/25] remote-curl.c: convert fetch_git() to use argv_array

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- remote-curl.c | 41 ++--- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index c704857..3ac5b6c 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -726,37 +726,31 @@ static

[PATCH v2 00/25] More flexibility in making shallow clones

2016-02-04 Thread Nguyễn Thái Ngọc Duy
ontrol.git/283110 Nguyễn Thái Ngọc Duy (25): remote-curl.c: convert fetch_git() to use argv_array transport-helper.c: refactor set_helper_option() transport-helper.c: do not send null option to remote helper upload-pack: move shallow deepen code out of receive_needs() upload-pack: mov

[PATCH v2 03/25] transport-helper.c: do not send null option to remote helper

2016-02-04 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, 5 insertions(+), 1 deletion(-) diff --git a/transport-helper.c b/transport-helper.c index 35023da..2e78c4d 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -309,8 +309,12 @@ static int

[PATCH v2 02/25] transport-helper.c: refactor set_helper_option()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- transport-helper.c | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index a6bff8b..35023da 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -260,6

[PATCH v2 06/25] upload-pack: remove unused variable "backup"

2016-02-04 Thread Nguyễn Thái Ngọc Duy
After the last patch, "result" and "backup" are the same. "result" used to move, but the movement is now contained in send_shallow(). Delete this redundant variable. Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 9 - 1 file changed, 4 insertions(

[PATCH v2 09/25] upload-pack: tighten number parsing at "deepen" lines

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 257ad48..9f14933 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -641,9 +641,9 @@ static void receive_needs(void

[PATCH v2 08/25] upload-pack: use skip_prefix() instead of starts_with() when possible

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index bfb7985..257ad48 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -276,7 +276,7 @@ static void

[PATCH v2 11/25] fetch-pack: use skip_prefix() instead of starts_with() when possible

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fetch-pack.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 9b2a514..0482077 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -58,13 +58,14 @@ int

[PATCH v2 10/25] upload-pack: move rev-list code out of check_non_tip()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 44 +--- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 9f14933..c8dafe8 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -451,7 +451,7 @@ static

[PATCH v2 17/25] clone: define shallow clone boundary based on time with --shallow-since

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-clone.txt | 3 +++ builtin/clone.c | 16 +--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 789b668..1b6b639 100644 --- a

[PATCH v2 13/25] fetch-pack: use a separate flag for fetch in deepening mode

2016-02-04 Thread Nguyễn Thái Ngọc Duy
The new name "deepen" was chosen after the command to define shallow boundary in pack protocol. New commands also follow this tradition. Signed-off-by: Nguyễn Thái Ngọc Duy --- fetch-pack.c | 14 -- fetch-pack.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --

[PATCH v2 14/25] shallow.c: implement a generic shallow boundary finder based on rev-list

2016-02-04 Thread Nguyễn Thái Ngọc Duy
re SHALLOW as boundary. Signed-off-by: Nguyễn Thái Ngọc Duy --- commit.h | 2 ++ shallow.c | 85 +++ 2 files changed, 87 insertions(+) diff --git a/commit.h b/commit.h index 5d58be0..b717be1 100644 --- a/commit.h +++ b/commit.h @@ -25

[PATCH v2 12/25] fetch-pack: use a common function for verbose printing

2016-02-04 Thread Nguyễn Thái Ngọc Duy
This reduces the number of "if (verbose)" which makes it a bit easier to read imo. It also makes it easier to redirect all these printouts, to a file for example. Signed-off-by: Nguyễn Thái Ngọc Duy --- fetch-pack.c | 88 +-

[PATCH v2 15/25] upload-pack: add deepen-since to cut shallow repos based on time

2016-02-04 Thread Nguyễn Thái Ngọc Duy
p to discussion, but if rev-list is used, it's likely intersection). However, because deepen goes with a custom commit walker, we can't mix the two yet. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/pack-protocol.txt | 3 +- Documentation/technical/proto

[PATCH v2 19/25] refs: add expand_ref()

2016-02-04 Thread Nguyễn Thái Ngọc Duy
This is basically dwim_ref() without @{} support. To be used on the server side where we want to expand abbreviated to full ref names and nothing else. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 8 +++- refs.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/refs.c

[PATCH v2 22/25] clone: define shallow clone boundary with --shallow-exclude

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-clone.txt | 5 + builtin/clone.c | 18 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 1b6b639..31e1610 100644 --- a

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