[PATCH v4 1/3] t7063: use --force-untracked-cache to speed up a bit

2015-08-19 Thread Nguyễn Thái Ngọc Duy
When in the middle of t7063, we are sure untracked cache is supported, so we can use --force-untracked-cache to skip the support detection phase and save a few seconds. It's also good that --force-untracked-cache is exercised in the test suite. Signed-off-by: Nguyễn Thái Ngọc Duy --- t/

[PATCH v4 0/3] dt/untracked-subdir

2015-08-19 Thread Nguyễn Thái Ngọc Duy
cked-cache: fix subdirectory handling Nguyễn Thái Ngọc Duy (2): t7063: use --force-untracked-cache to speed up a bit untracked cache: fix entry invalidation dir.c | 82 +++--- t/t7063-status-untracked-cache.sh | 102 ++

[PATCH v4 2/3] untracked-cache: fix subdirectory handling

2015-08-19 Thread Nguyễn Thái Ngọc Duy
r 'foo/bar' (instead of just looking for 'bar'). This would cause untracked cache corruption. Instead, treat_directory learns to track the base length of the parent directory, so that only the last path component is passed to lookup_untracked. Helped-by: Nguyễn Thái Ngọc Duy Signe

[PATCH v4 3/3] untracked cache: fix entry invalidation

2015-08-19 Thread Nguyễn Thái Ngọc Duy
ry. In this case we may have to invalidate back to root. See the comment block for detail. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 68 --- t/t7063-status-untracked-cache.sh | 28 +++- 2 files changed, 83 insertio

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

2015-08-21 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 v4 02/10] grep: break down an "if" stmt in preparation for next changes

2015-08-21 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 b58c7c6..bd32f66 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 v4 01/10] grep: allow -F -i combination

2015-08-21 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 d04f440..2d392e9 100644 --- a/builtin/

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

2015-08-21 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 v4 00/10] icase match on non-ascii

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Sorry it took more than a month for a simple reroll. Free time (with energy left) is rare these days. v4 adds system regex's icase support detection and only runs tests in these cases. This should fix test failures on Windows where compat regex does not support icase. Diff from v3 below diff --gi

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

2015-08-21 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 v4 06/10] grep/pcre: prepare locale-dependent tables for icase matching

2015-08-21 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 v4 07/10] gettext: add is_utf8_locale()

2015-08-21 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 v4 08/10] grep/pcre: support utf-8

2015-08-21 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 v4 10/10] diffcore-pickaxe: support case insensitive match on non-ascii

2015-08-21 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 v4 09/10] diffcore-pickaxe: "share" regex error handling code

2015-08-21 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 v2 1/5] path.c: delete an extra space

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.c b/path.c index 95acbaf..a536ee3 100644 --- a/path.c +++ b/path.c @@ -431,7 +431,7 @@ const char *enter_repo(const char *path, int strict) } if

[PATCH v2 2/5] enter_repo: avoid duplicating logic, use is_git_directory() instead

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/path.c b/path.c index a536ee3..7340e11 100644 --- a/path.c +++ b/path.c @@ -441,8 +441,7 @@ const char *enter_repo(const char *path, int strict) else if (chdir(path

[PATCH v2 3/5] enter_repo: allow .git files in strict mode

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Strict mode is about not guessing where .git is. If the user points to a .git file, we know exactly where the target .git dir will be. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/path.c b/path.c index 7340e11

[PATCH v2 4/5] clone: allow --local from a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 6 -- t/t2025-worktree-add.sh | 5 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 578da85..836fb64 100644 --- a/builtin/clone.c +++ b

[PATCH v2 0/5] fix local clone from a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
already delayed to let "git worktree add" in, I think we > could keep this patch out of tree for now. I will split it up, add > tests and resubmit once the release is out. Please remind me if you > see nothing from me for too long. Here it is. Mostly the same as the previous patc

[PATCH v2 5/5] clone: better error when --reference is a linked checkout

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/clone.c b/builtin/clone.c index 836fb64..7a010bb 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -294,9 +294,14 @@ static int add_one_reference(struct

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

2015-08-21 Thread Nguyễn Thái Ngọc Duy
and we'll > incrementally rebuild on top. Here comes the rebuild. This adds --shift-ita option (and an internal flag) to enable this behavior. Those only take the last two patches. The remaining is to make sure we handle i-t-a entries correctly in some commands. Nguyễn Thái Ngọc Duy (8):

[PATCH 2/8] Add and use convenient macro ce_intent_to_add()

2015-08-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/rm.c | 2 +- cache-tree.c | 2 +- cache.h | 1 + read-cache.c | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/rm.c b/builtin/rm.c index 80b972f..8829b09 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -211,7

[PATCH 3/8] apply: fix adding new files on i-t-a entries

2015-08-21 Thread Nguyễn Thái Ngọc Duy
t in the index. This patch tightens the "exists in index" check, ignoring i-t-a entries. Reported-by: Patrick Higgins Reported-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/apply.c | 9 + t/t2203-add-intent.sh | 13 + 2 files changed,

[PATCH 4/8] apply: make sure check_preimage() does not leave empty file on error

2015-08-21 Thread Nguyễn Thái Ngọc Duy
es the same code pattern (look up an index entry, if on-disk version is not found, restore using the cached version). Fix it too (even though it's not exercised in any test case) Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/apply.c | 4 ++-- t/t2203-add-intent.sh | 16 +

[PATCH 1/8] blame: remove obsolete comment

2015-08-21 Thread Nguyễn Thái Ngọc Duy
That "someday" in the comment happened two years later in b65982b (Optimize "diff-index --cached" using cache-tree - 2009-05-20) Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 5 - 1 file changed, 5 deletions(-) diff --git a/builtin/blame.c b/builtin/b

[PATCH 5/8] checkout(-index): do not checkout i-t-a entries

2015-08-21 Thread Nguyễn Thái Ngọc Duy
. For example, "git checkout -- foo" will complain that "foo" does not match pathspec, just like when "foo" is not registered with "git add -N" Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout-index.c | 5 - builtin/checkout.c

[PATCH 6/8] grep: make it clear i-t-a entries are ignored

2015-08-21 Thread Nguyễn Thái Ngọc Duy
The expression "!S_ISREG(ce)" covers i-t-a entries as well because ce->ce_mode would be zero then. I could make a comment saying that, but it's probably better just to comment with code, in case i-t-a entry content changes in future. Signed-off-by: Nguyễn Thái Ngọc Duy ---

[PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits

2015-08-21 Thread Nguyễn Thái Ngọc Duy
I renamed both "flags" and "touched_flags" fields while making this patch to make sure I was aware of how these flags were manipulated (besides DIFF_OPT* macros). So hopefully I didn't miss anything. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 2

[PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits

2015-08-21 Thread Nguyễn Thái Ngọc Duy
I renamed both "flags" and "touched_flags" fields while making this patch to make sure I was aware of how these flags were manipulated (besides DIFF_OPT* macros). So hopefully I didn't miss anything. Signed-off-by: Nguyễn Thái Ngọc Duy --- Resend to the right recipients

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

2015-08-21 Thread Nguyễn Thái Ngọc Duy
tionally to display i-t-a entries correctly. See d95d728 for details about "git status" and i-t-a entries. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/diff-options.txt | 6 ++ diff-lib.c | 14 ++ diff.c | 2 ++ diff.

[PATCH v3] gc: save log from daemonized gc --auto and print it next time

2015-08-21 Thread Nguyễn Thái Ngọc Duy
$GIT_DIR/gc.log. Following gc runs will not be daemonized and gc.log printed out until the user removes gc.log. Signed-off-by: Nguyễn Thái Ngọc Duy --- Let's try again. Compared to v2 [1], this version does not delete gc.log automatically any more. The user needs to take action, then d

[PATCH 0/2] gitignore, re-inclusion fix

2015-08-23 Thread Nguyễn Thái Ngọc Duy
clude something in abc/def so it does not exclude "abc" and "abc/def" outright to give the last rule a chance to match. [1] http://article.gmane.org/gmane.comp.version-control.git/259870 [2] http://thread.gmane.org/gmane.comp.version-control.git/265901/focus=266227 Nguyễn Thái Ng

[PATCH 1/2] dir.c: make last_exclude_matching_from_list() run til the end

2015-08-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dir.c b/dir.c index c00c7e2..3a7630a 100644 --- a/dir.c +++ b/dir.c @@ -901,6 +901,7 @@ static struct exclude *last_exclude_matching_from_list(const char *pathname

[PATCH 2/2] dir.c: don't exclude whole dir prematurely if neg pattern may match

2015-08-23 Thread Nguyễn Thái Ngọc Duy
hing (i.e. "trailing slash in the pattern") does not work well with this. For example, if we descend in "foo" and are examining "foo/abc", current code for "foo/" pattern will check if path "foo/abc", not "foo", is a directory. The same prob

[PATCH] setup: update the right file in multiple checkouts

2015-08-25 Thread Nguyễn Thái Ngọc Duy
ckout move. Note the name, "$R/gitdir", not "$R/gitfile". Correct the path to be updated accordingly. While at there, make sure I/O errors are not silently dropped. Signed-off-by: Nguyễn Thái Ngọc Duy --- The code was right in v2 [1] and became "gitfile" since v3 [2

[PATCH v3 5/5] clone: better error when --reference is a linked checkout

2015-09-12 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/clone.c b/builtin/clone.c index 39d4adf..3e14491 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -294,9 +294,14 @@ static int add_one_reference(struct

[PATCH v3 3/5] enter_repo: allow .git files in strict mode

2015-09-12 Thread Nguyễn Thái Ngọc Duy
Strict mode is about not guessing where .git is. If the user points to a .git file, we know exactly where the target .git dir will be. This is needed even in local clone case because transport.c code uses upload-pack for fetching remote refs. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 9

[PATCH v3 4/5] clone: allow --local from a linked checkout

2015-09-12 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 6 -- t/t2025-worktree-add.sh | 5 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 578da85..39d4adf 100644 --- a/builtin/clone.c +++ b

[PATCH v3 1/5] path.c: delete an extra space

2015-09-12 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.c b/path.c index 95acbaf..a536ee3 100644 --- a/path.c +++ b/path.c @@ -431,7 +431,7 @@ const char *enter_repo(const char *path, int strict) } if

[PATCH v3 2/5] enter_repo: avoid duplicating logic, use is_git_directory() instead

2015-09-12 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/path.c b/path.c index a536ee3..7340e11 100644 --- a/path.c +++ b/path.c @@ -441,8 +441,7 @@ const char *enter_repo(const char *path, int strict) else if (chdir(path

[PATCH v3 0/5] fix local clone from a linked checkout

2015-09-12 Thread Nguyễn Thái Ngọc Duy
strbuf_addstr(&dest, "/objects"); copy_or_link_directory(&src, &dest, src_repo, src.len); strbuf_release(&src); strbuf_release(&dest); -- 8< -- Nguyễn Thái Ngọc Duy (5): path.c: delete an extra space enter_repo: avoid du

[PATCH v2 0/2] gitignore, re-inclusion fix

2015-09-12 Thread Nguyễn Thái Ngọc Duy
No code change. Explain why 1/2 is needed in the commit message. Nguyễn Thái Ngọc Duy (2): dir.c: make last_exclude_matching_from_list() run til the end dir.c: don't exclude whole dir prematurely if neg pattern may match Documentation/gitignore.txt| 21 ++---

[PATCH v2 1/2] dir.c: make last_exclude_matching_from_list() run til the end

2015-09-12 Thread Nguyễn Thái Ngọc Duy
The next patch adds some post processing to the result value before it's returned to the caller. Make all branches reach the end of the function, so we can do it all in one place. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 15 ++- 1 file changed, 10 insertions(+), 5 dele

[PATCH v2 2/2] dir.c: don't exclude whole dir prematurely if neg pattern may match

2015-09-12 Thread Nguyễn Thái Ngọc Duy
hing (i.e. "trailing slash in the pattern") does not work well with this. For example, if we descend in "foo" and are examining "foo/abc", current code for "foo/" pattern will check if path "foo/abc", not "foo", is a directory. The same prob

[PATCH v4] gc: save log from daemonized gc --auto and print it next time

2015-09-12 Thread Nguyễn Thái Ngọc Duy
$GIT_DIR/gc.log. Following gc --auto will not run and gc.log printed out until the user removes gc.log. Signed-off-by: Nguyễn Thái Ngọc Duy --- When gc.log exists, gc --auto now simply exits builtin/gc.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-

[PATCH v5] gc: save log from daemonized gc --auto and print it next time

2015-09-18 Thread Nguyễn Thái Ngọc Duy
$GIT_DIR/gc.log. Following gc --auto will not run and gc.log printed out until the user removes gc.log. Signed-off-by: Nguyễn Thái Ngọc Duy --- This is the lock-based version. I'm sending an alternative that does not need atexit() with comparison b

[Alt. PATCH v5] gc: save log from daemonized gc --auto and print it next time

2015-09-18 Thread Nguyễn Thái Ngọc Duy
$GIT_DIR/gc.log. Following gc --auto will not run and gc.log printed out until the user removes gc.log. Signed-off-by: Nguyễn Thái Ngọc Duy --- The lock-based version has an advantage that the following gc runs will never see partial gc.log. But it requires some more hook at atexit() and maybe s

[PATCH/RFC] Add test_repo_expect_success for running tests in a new repository

2015-09-19 Thread Nguyễn Thái Ngọc Duy
This could be convenient when tests are independent from the rest in the same file. Normally we would do this test_expect_success '...' ' git init foo && ( cd foo &&

[PATCH v3 1/2] dir.c: make last_exclude_matching_from_list() run til the end

2015-09-21 Thread Nguyễn Thái Ngọc Duy
The next patch adds some post processing to the result value before it's returned to the caller. Keep all branches reach the end of the function, so we can do it all in one place. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 15 ++- 1 file changed, 10 insertions(+), 5 dele

[PATCH v3 0/2] gitignore, re-inclusion fix

2015-09-21 Thread Nguyễn Thái Ngọc Duy
cat >fooo/.gitignore <<-\EOF && + !/* + EOF mkdir -p foo/bar && touch abc foo/def foo/bar/ghi foo/bar/bar && git ls-files -o --exclude-standard >../actual && -- 8< -- N

[PATCH v3 2/2] dir.c: don't exclude whole dir prematurely if neg pattern may match

2015-09-21 Thread Nguyễn Thái Ngọc Duy
hing (i.e. "trailing slash in the pattern") does not work well with this. For example, if we descend in "foo" and are examining "foo/abc", current code for "foo/" pattern will check if path "foo/abc", not "foo", is a directory. The same prob

[PATCH] ls-remote.txt: delete unsupported option

2015-09-28 Thread Nguyễn Thái Ngọc Duy
upport it. While at there, fix --upload-pack syntax too. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-ls-remote.txt | 3 +-- builtin/ls-remote.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/git-ls-remote.txt b/Documentation/git

[PATCH v4 0/6] fix local clone from a linked checkout

2015-09-28 Thread Nguyễn Thái Ngọc Duy
test_cmp expected actual +' + +test_expect_success 'enter_repo strict mode' ' + git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual && + cat >expected <<-\EOF && + 946e985ab20de757ca5b872b16d64e92ff3803a9HEAD + 946e985ab20de757ca5b872

[PATCH v4 6/6] clone: better error when --reference is a linked checkout

2015-09-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtin/clone.c b/builtin/clone.c index 39d4adf..3e14491 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -294,9 +294,14 @@ static int add_one_reference(struct

[PATCH v4 5/6] clone: allow --local from a linked checkout

2015-09-28 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 6 -- t/t2025-worktree-add.sh | 5 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 578da85..39d4adf 100644 --- a/builtin/clone.c +++ b

[PATCH v4 3/6] enter_repo: avoid duplicating logic, use is_git_directory() instead

2015-09-28 Thread Nguyễn Thái Ngọc Duy
It matters for linked checkouts where 'refs' directory won't be available in $GIT_DIR. is_git_directory() knows about $GIT_COMMON_DIR and can handle this case. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 3 +-- t/t0002-gitfile.sh | 14 ++ 2 fi

[PATCH v4 2/6] t0002: add test for enter_repo(), non-strict mode

2015-09-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t0002-gitfile.sh | 18 ++ 1 file changed, 18 insertions(+) diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh index 9393322..545bfe2 100755 --- a/t/t0002-gitfile.sh +++ b/t/t0002-gitfile.sh @@ -116,4 +116,22 @@ test_expect_success

[PATCH v4 4/6] enter_repo: allow .git files in strict mode

2015-09-28 Thread Nguyễn Thái Ngọc Duy
for fetching remote refs. But right now the clone/transport code goes with non-strict. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 9 +++-- t/t0002-gitfile.sh | 10 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/path.c b/path.c index 7340e11

[PATCH v4 1/6] path.c: delete an extra space

2015-09-28 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.c b/path.c index 95acbaf..a536ee3 100644 --- a/path.c +++ b/path.c @@ -431,7 +431,7 @@ const char *enter_repo(const char *path, int strict) } if

[PATCH] read-cache: fix untracked cache invalidation when split-index is used

2015-06-07 Thread Nguyễn Thái Ngọc Duy
The code should check this flag and not invalidate untracked cache. This causes a second invalidation violates test expectation. The fix is obvious. Noticed-by: Thomas Gummerer Signed-off-by: Nguyễn Thái Ngọc Duy --- PS. perhaps I should rename ADD_CACHE_KEEP_CACHE_TREE to ADD_CACHE_KEEP_CACHE, o

[PATCH] checkout: don't check worktrees when not necessary

2015-06-12 Thread Nguyễn Thái Ngọc Duy
When --patch or pathspecs are passed to git checkout, the working tree will not be switching branch, so there's no need to check if the branch that we are running checkout on is already checked out. Original-patch-by: Spencer Baugh Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/check

[PATCH] strbuf: stop out-of-boundary warnings from Coverity

2015-06-17 Thread Nguyễn Thái Ngọc Duy
e cleaner defect list and better chances of spotting true defects. (*) It's not entirely wrong though. Somebody may do sb.buf[0] = 'f' right after variable declaration and ruin all unused strbuf. Signed-off-by: Nguyễn Thái Ngọc Duy --- There are lots of false warnings like th

[PATCH] apply: fix adding new files on i-t-a entries

2015-06-23 Thread Nguyễn Thái Ngọc Duy
t am" use "git apply" underneath, they are broken too before this patch and fixed now. Reported-by: Patrick Higgins Reported-by: Bjørnar Snoksrud Signed-off-by: Nguyễn Thái Ngọc Duy --- I think I'm opening a can of worms with d95d728. There's nothing wrong with that p

[PATCH] blame: remove obsolete comment

2015-06-25 Thread Nguyễn Thái Ngọc Duy
That "someday" in the comment happened two years later in b65982b (Optimize "diff-index --cached" using cache-tree - 2009-05-20) Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 5 - 1 file changed, 5 deletions(-) diff --git a/builtin/blame.c b/builtin/b

[PATCH] setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR

2015-06-26 Thread Nguyễn Thái Ngọc Duy
ORK_TREE should be set too unless there's no work tree. But setting $GIT_WORK_TREE inside set_git_dir() may backfire. We don't know at that point if work tree is already configured by the caller. So set it when work tree is detected. It does not harm if $GIT_WORK_TREE is set while $GIT_DI

[PATCH] worktree: new place for "git prune --worktrees"

2015-06-29 Thread Nguyễn Thái Ngọc Duy
Commit 23af91d (prune: strategies for linked checkouts - 2014-11-30) adds "--worktrees" to "git prune" without realizing that "git prune" is for object database only. This patch moves the same functionality to a new command "git worktree". Signed-off-by

[PATCH] Avoid the need of "--" when wildcard pathspec is used

2015-06-30 Thread Nguyễn Thái Ngọc Duy
llow wildcards, you can only hit that "needs '--'" new rule if you use ":/", "^{/}" or ":wildcards/in/literal/paths". So it's really rare. The rules after this patch become: (1) if an arg is a rev, then it must either exist in worktree or not a wild car

[PATCH v2] Add tests for wildcard "path vs ref" disambiguation

2015-07-01 Thread Nguyễn Thái Ngọc Duy
quot;:/" a lot, you may need to type "--" more. Signed-off-by: Nguyễn Thái Ngọc Duy --- v2 just adds tests as the code is already in 'master' for some time. t/t2019-checkout-ambiguous-ref.sh | 26 ++ 1 file changed, 26 insertions(+) diff --gi

[PATCH] grep: use regcomp() for icase search with non-ascii patterns

2015-07-06 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index b58c7c6..48db15a 100644 --- a/grep.c +++ b/grep.c @@ -378,7 +378,7 @@ static void free_pcre_regexp(struct grep_pat *p

[PATCH v2 4/9] grep/icase: avoid kwsset when -F is specified

2015-07-08 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 v2 0/9] icase match on non-ascii

2015-07-08 Thread Nguyễn Thái Ngọc Duy
as_non_ascii() functions back, or rename one to something else. Patch 5 is "funny". The patch itself is in iso-8859-1, but my name in the commit message is in utf-8. Let's see how it goes on the apply side. We may need to fix something in this area.. Nguyễn Thái Ngọc Duy (9): grep:

[PATCH v2 3/9] grep/icase: avoid kwsset on literal non-ascii strings

2015-07-08 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) | 19 +++ 2 files changed, 25 insertions(+), 1 deletion

[PATCH v2 9/9] diffcore-pickaxe: support case insensitive match on non-ascii

2015-07-08 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 v2 2/9] grep: break down an "if" stmt in preparation for next changes

2015-07-08 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 b58c7c6..bd32f66 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 v2 6/9] gettext: add is_utf8_locale()

2015-07-08 Thread Nguyễn Thái Ngọc Duy
This function returns true if git is running under an UTF-8 locale. pcre in the next patch will need this. Signed-off-by: Nguyễn Thái Ngọc Duy --- gettext.c | 7 ++- gettext.h | 5 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gettext.c b/gettext.c index 7378ba2

[PATCH v2 7/9] grep/pcre: support utf-8

2015-07-08 Thread Nguyễn Thái Ngọc Duy
. Noticed-by: Plamen Totev Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 2 ++ t/t7812-grep-icase-non-ascii.sh | 6 ++ 2 files changed, 8 insertions(+) diff --git a/grep.c b/grep.c index c79aa70..7c9e437 100644 --- a/grep.c +++ b/grep.c @@ -326,6 +326,8 @@ static void

[PATCH v2 1/9] grep: allow -F -i combination

2015-07-08 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 d04f440..2d392e9 100644 --- a/builtin/

[PATCH v2 8/9] diffcore-pickaxe: "share" regex error handling code

2015-07-08 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 v2 5/9] grep/pcre: prepare locale-dependent tables for icase matching

2015-07-08 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 | 7 +-- grep.h

[PATCH 2/2] pack-objects: rename the field "type" to "real_type"

2015-07-08 Thread Nguyễn Thái Ngọc Duy
the pack, delta types are fine (it's actually markers for reused deltas) Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 36 ++-- pack-bitmap-write.c| 6 +++--- pack-objects.h | 2 +- 3 files changed, 22 insertions(+), 22 deleti

[PATCH 1/2] index-pack: rename the field "type" to "in_pack_type"

2015-07-08 Thread Nguyễn Thái Ngọc Duy
We have two types in this code: in-pack and canonical. "in_pack_type" makes it clearer than plain "type". Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/index-pack.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff -

[PATCH v3 0/9] icase match on non-ascii

2015-07-14 Thread Nguyễn Thái Ngọc Duy
Compared to v2 - fix grep/pcre on utf-8 even in case is sensitive - peek at $LANG and friends anyway for utf-8 detection even when gettext support is not built in git - s/quote we quote/so we quote/ in 9/9 - rename t7813, s/non-ascii/iso/ Nguyễn Thái Ngọc Duy (9): grep: allow -F -i

[PATCH v3 1/9] grep: allow -F -i combination

2015-07-14 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 d04f440..2d392e9 100644 --- a/builtin/

[PATCH v3 2/9] grep: break down an "if" stmt in preparation for next changes

2015-07-14 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 b58c7c6..bd32f66 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 v3 4/9] grep/icase: avoid kwsset when -F is specified

2015-07-14 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 v3 3/9] grep/icase: avoid kwsset on literal non-ascii strings

2015-07-14 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) | 19 +++ 2 files changed, 25 insertions(+), 1 deletion

[PATCH v3 5/9] grep/pcre: prepare locale-dependent tables for icase matching

2015-07-14 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 v3 7/9] grep/pcre: support utf-8

2015-07-14 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 v3 6/9] gettext: add is_utf8_locale()

2015-07-14 Thread Nguyễn Thái Ngọc Duy
UTF-8. pcre library might support utf-8 even if libc or git is built without locale support.. The peeking code is a copy from compat/regex/regcomp.c. Helped-by: Torsten Bögershausen Signed-off-by: Nguyễn Thái Ngọc Duy --- gettext.c | 24 ++-- gettext.h | 1 + 2 files ch

[PATCH v3 8/9] diffcore-pickaxe: "share" regex error handling code

2015-07-14 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 v3 9/9] diffcore-pickaxe: support case insensitive match on non-ascii

2015-07-14 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 00/11] nd/icase updates

2016-06-23 Thread Nguyễn Thái Ngọc Duy
amp;& git grep --debug -i -F "^*TILR^AUN:.* \\Halló \$He[]imur!\$" 2>&1 >/dev/null | grep fixed >debug1 && - echo "fixed \\^*TILR^AUN:\\.\\* Halló \$He\\[]imur!\\\$" >expect1 && + test_write_lines

[PATCH 01/11] grep: break down an "if" stmt in preparation for next changes

2016-06-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- grep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grep.c b/grep.c index 7b2b96a..609f218 100644 --- a/grep.c +++ b/grep.c @@ -403,7 +403,9 @@ static void compile_regexp(struct grep_pat *p, struct

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

2016-06-23 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 anymore. Noticed-by: Plamen Totev Helped-by: René Scharfe Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C

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

2016-06-23 Thread Nguyễn Thái Ngọc Duy
instead. Slower, but accurate. Noticed-by: Plamen Totev Helped-by: René Scharfe Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- grep.c | 7 ++- t/t7812-grep-icase-non-ascii.sh (new +x) | 23

[PATCH 02/11] test-regex: isolate the bug test code

2016-06-23 Thread Nguyễn Thái Ngọc Duy
This is in preparation to turn test-regex into some generic regex testing command. Helped-by: Eric Sunshine Helped-by: Ramsay Jones Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t0070-fundamental.sh | 2 +- test-regex.c | 12 ++-- 2 files changed

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

2016-06-23 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 Signed-off-by: Junio C Hamano --- grep.c

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

2016-06-23 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 Signed-off-by: Junio C Hamano --- diffcore-pickaxe.c | 16 -

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

2016-06-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- test-regex.c | 51 +-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/test-regex.c b/test-regex.c index 67a1a65..eff26f5 100644 --- a/test-regex.c +++ b/test

  1   2   3   4   5   6   7   8   9   10   >