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/
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 ++
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
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
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
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
-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/
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
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
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 ++
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
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,
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
.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.
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
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
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
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
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
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
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
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):
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
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,
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 +
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
. 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
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
---
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
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
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.
$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
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
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
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
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
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
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
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
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
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
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
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 ++---
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
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
$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(-
$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
$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
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 &&
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 ++
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:
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
.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.
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
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
.
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
-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/
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
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
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
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 -
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
-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/
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
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 ++
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
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
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
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
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
.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.
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
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
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
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
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
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
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 -
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 - 100 of 5892 matches
Mail list logo