[PATCH v2 23/25] t5500, t5539: tests for shallow depth excluding a ref

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 22 ++ t/t5539-fetch-http-shallow.sh | 22 ++ 2 files changed, 44 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 453c571..53de68c 100755 --- a/t/t5500

[PATCH v2 21/25] fetch: define shallow 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/fetch-options.txt | 5 + Documentation/git-fetch-pack.txt| 5 + Documentation/gitremote-helpers.txt | 4 builtin/fetch-pack.c| 10 ++ builtin/fetch.c | 17

[PATCH v2 20/25] upload-pack: support define shallow boundary by excluding revisions

2016-02-04 Thread Nguyễn Thái Ngọc Duy
ev-list --since=... --not ref". Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/pack-protocol.txt | 3 ++- Documentation/technical/protocol-capabilities.txt | 9 + upload-pack.c | 22 -- 3 files changed,

[PATCH v2 18/25] t5500, t5539: tests for shallow depth since a specific date

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 22 ++ t/t5539-fetch-http-shallow.sh | 24 2 files changed, 46 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index e5f83bf..453c571 100755 --- a/t

[PATCH v2 16/25] fetch: define shallow boundary 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/fetch-options.txt | 4 Documentation/git-fetch-pack.txt| 4 Documentation/gitremote-helpers.txt | 3 +++ builtin/fetch-pack.c| 4 builtin/fetch.c | 12 ++-- fetch-pack.c

[PATCH v2 24/25] upload-pack: make check_reachable_object() return unreachable list if asked

2016-02-04 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- object.h | 2 +- upload-pack.c | 51 --- 2 files changed, 45 insertions(+), 8 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 25/25] fetch, upload-pack: --deepen=N extends shallow boundary by N commits

2016-02-04 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 0/8] Resumable clone revisited, proof of concept

2016-02-05 Thread Nguyễn Thái Ngọc Duy
o "git fetch" to retry - Make "git clone" use "git fetch --resume" to get the pack [1] Quote from https://lwn.net/Articles/674392/ "she noted that Git still does not support interrupting and resuming download operations, which is an important bug to fix.&

[PATCH 4/8] upload-pack: new capability to pass --skip* to pack-objects

2016-02-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/pack-protocol.txt | 2 ++ Documentation/technical/protocol-capabilities.txt | 9 +++ upload-pack.c | 30 +-- 3 files changed, 39 insertions(+), 2 deletions

[PATCH 8/8] one ugly test to verify basic functionality

2016-02-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5544-fetch-resume.sh (new +x) | 42 1 file changed, 42 insertions(+) create mode 100755 t/t5544-fetch-resume.sh diff --git a/t/t5544-fetch-resume.sh b/t/t5544-fetch-resume.sh new file mode 100755 index 000

[PATCH 6/8] fetch: add --resume-pack=

2016-02-05 Thread Nguyễn Thái Ngọc Duy
d a new good pack is put in $GIT_DIR. Improvement point. We should be able to perform some heavy operations locally before connecting to the server (e.g. produce the skip hash from "blah", or index-pack consuming "blah"). Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin

[PATCH 5/8] fetch-pack.c: send "skip" line to pack-objects

2016-02-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- fetch-pack.c | 40 fetch-pack.h | 3 +++ 2 files changed, 43 insertions(+) diff --git a/fetch-pack.c b/fetch-pack.c index 01e34b6..ffb5254 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -15,6 +15,7 @@ #include

[PATCH 7/8] index-pack: --append-pack implies --strict

2016-02-05 Thread Nguyễn Thái Ngọc Duy
A frankenstein pack, generated by multiple pack-objects runs, certainly has higher risk of broken, especially when the server side could be some other implementation than pack-objects. Be safe and strict. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/index-pack.c | 2 ++ 1 file changed, 2

[PATCH 1/8] pack-objects: add --skip and --skip-hash

2016-02-05 Thread Nguyễn Thái Ngọc Duy
the skipped part does not match, it can abort early. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 21 csum-file.c| 52 ++ csum-file.h| 3 +++ 3 files changed, 72 insertions(+), 4

[PATCH 2/8] pack-objects: produce a stable pack when --skip is given

2016-02-05 Thread Nguyễn Thái Ngọc Duy
client can pass it back on the next fetch. Regardless, the input from client must be identical between fetches, the server should be able to extract a signature from that and use it to associate with a cached pack. So no need for sending keys from the server side. Signed-off-by: Nguyễn Thái Ngọc Du

[PATCH 3/8] index-pack: add --append-pack=

2016-02-05 Thread Nguyễn Thái Ngọc Duy
In this mode (--append-pack --stdin), index-pack consumes current content in first without producing anything else, then continues to read from stdin and append to . This is the consumer end of "pack-objects --skip". Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/index-p

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

2016-02-05 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 v6 01/11] grep: allow -F -i combination

2016-02-05 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 v6 00/11] Fix icase grep on non-ascii

2016-02-05 Thread Nguyễn Thái Ngọc Duy
v6 fixes comments from Ramsay and Eric. Interdiff below. The only thing to add is, I decided not to replace !icase_non_ascii with icase_ascii_only. I went with spelling out "!icase || ascii_only". I think it expresses the intention better. diff --git a/grep.c b/grep.c index 2e4f71d..aed4fe0 100644

[PATCH v6 07/11] grep/pcre: prepare locale-dependent tables for icase matching

2016-02-05 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 v6 09/11] grep/pcre: support utf-8

2016-02-05 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 v6 08/11] gettext: add is_utf8_locale()

2016-02-05 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 v6 10/11] diffcore-pickaxe: "share" regex error handling code

2016-02-05 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 v6 04/11] test-regex: expose full regcomp() to the command line

2016-02-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- test-regex.c | 51 +-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/test-regex.c b/test-regex.c index 8c51f5a..d1a952c 100644 --- a/test-regex.c +++ b/test-regex.c @@ -1,4 +1,21 @@ #include

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

2016-02-05 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 --- grep.c | 6 +- t/t7812-grep-icase-non-ascii.sh (new +x) | 23 +++ 2 files changed, 28

[PATCH v6 11/11] diffcore-pickaxe: support case insensitive match on non-ascii

2016-02-05 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 v6 06/11] grep/icase: avoid kwsset when -F is specified

2016-02-05 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 --- grep.c

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

2016-02-05 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 --- t/t0070-fundamental.sh | 2 +- test-regex.c | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions

[PATCH] setup.c: make check_filename() return 0 on ENAMETOOLONG

2016-02-06 Thread Nguyễn Thái Ngọc Duy
Noticed-by: Ole Tange Signed-off-by: Nguyễn Thái Ngọc Duy --- On Sun, Feb 7, 2016 at 4:56 AM, Ole Tange wrote: > If file name too long it should just try to see if it is a reference > to a revision. Looks easy enough to fix. setup.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH] Avoid interpreting too-long parameter as file name

2016-02-07 Thread Nguyễn Thái Ngọc Duy
re, if the check_filename() function encounters too long a command-line parameter, it should interpet the error code ENAMETOOLONG as a strong hint that this is not a file name instead of dying with an error message. Noticed-by: Ole Tange Helped-by: Johannes Schindelin Signed-off-by: Nguyễn Thá

[PATCH] rev-parse: take prefix into account in --git-common-dir

2016-02-11 Thread Nguyễn Thái Ngọc Duy
Most of the time, get_git_common_dir() returns an absolute path so prefix is irrelevant. If it returns a relative path (e.g. from the main worktree) then prefixing is required. Noticed-by: Mike Hommey Signed-off-by: Nguyễn Thái Ngọc Duy --- On Fri, Feb 12, 2016 at 10:47 AM, Mike Hommey wrote

[PATCH v7 00/12] nd/icase updates

2016-02-14 Thread Nguyễn Thái Ngọc Duy
;--bug")) return test_regex_bug(); else if (argc < 3) - die("usage: test-regex --bug\n" - " test-regex []"); + usage("test-regex --bug\n" + "test-regex []"); argv++;

[PATCH v7 03/12] test-regex: isolate the bug test code

2016-02-14 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 --- t/t0070-fundamental.sh | 2 +- test-regex.c | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions

[PATCH v7 01/12] grep: allow -F -i combination

2016-02-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 8c516a9..46c5ba1 100644 --- a/builtin/

[PATCH v7 05/12] grep/icase: avoid kwsset on literal non-ascii strings

2016-02-14 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 --- grep.c | 7 ++- t/t7812-grep-icase-non-ascii.sh (new +x) | 23 +++ 2 files changed, 29

[PATCH v7 07/12] grep/pcre: prepare locale-dependent tables for icase matching

2016-02-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 v7 06/12] grep/icase: avoid kwsset when -F is specified

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

[PATCH v7 08/12] gettext: add is_utf8_locale()

2016-02-14 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 v7 04/12] test-regex: expose full regcomp() to the command line

2016-02-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- 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-regex.c @@ -1,4 +1,21 @@ #include

[PATCH v7 09/12] grep/pcre: support utf-8

2016-02-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 v7 02/12] grep: break down an "if" stmt in preparation for next changes

2016-02-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- 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 grep_opt *opt) p

[PATCH v7 10/12] diffcore-pickaxe: "share" regex error handling code

2016-02-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 v7 12/12] grep.c: reuse "icase" variable

2016-02-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- grep.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/grep.c b/grep.c index 6e99b01..cb058a5 100644 --- a/grep.c +++ b/grep.c @@ -445,10 +445,7 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt

[PATCH v7 11/12] diffcore-pickaxe: support case insensitive match on non-ascii

2016-02-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 0/4] .gitignore, reinclude rules, take 2

2016-02-15 Thread Nguyễn Thái Ngọc Duy
cases I can imagine. Nguyễn Thái Ngọc Duy (4): dir.c: fix match_pathname() dir.c: support tracing exclude dir.c: support marking some patterns already matched dir.c: don't exclude whole dir prematurely Documentation/git-check-ignore.txt | 1 + Documentation/gi

[PATCH 1/4] dir.c: fix match_pathname()

2016-02-15 Thread Nguyễn Thái Ngọc Duy
tched in this case and fall back to fnmatch(), which also fails to catch it. Fix it. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dir.c b/dir.c index f0b6d0a..bcaafac 100644 --- a/dir.c +++ b/dir.c @@ -878,7

[PATCH 2/4] dir.c: support tracing exclude

2016-02-15 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-check-ignore.txt | 1 + Documentation/git.txt | 5 + dir.c | 20 3 files changed, 26 insertions(+) diff --git a/Documentation/git-check-ignore.txt b/Documentation/git

[PATCH 3/4] dir.c: support marking some patterns already matched

2016-02-15 Thread Nguyễn Thái Ngọc Duy
we can mark it "sticky", so that all files and dirs inside the matched path also matches. This is a simpler solution than modify all match scenarios to fix that. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 77 --- di

[PATCH 4/4] dir.c: don't exclude whole dir prematurely

2016-02-15 Thread Nguyễn Thái Ngọc Duy
If there is a pattern "!foo/bar", this patch makes it not exclude "foo" right away. This gives us a chance to examine "foo" and re-include "foo/bar". Helped-by: brian m. carlson Helped-by: Micha Wiedenmann Signed-off-by: Nguyễn Thái Ng

[PATCH 1/2] worktree: fix "add -B"

2016-02-15 Thread Nguyễn Thái Ngọc Duy
point of view. We do not need the special case for -B. Signed-off-by: Nguyễn Thái Ngọc Duy --- Complete patch. builtin/worktree.c | 4 +--- t/t2025-worktree-add.sh | 8 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c inde

[PATCH 2/2] worktree add -B: do the checkout test before update branch

2016-02-15 Thread Nguyễn Thái Ngọc Duy
e, we have already updated the branch and mess up the other checkout. Repeat the die_if_checked_out() test again for this specific case before "git branch" runs. Signed-off-by: Nguyễn Thái Ngọc Duy --- Something extra while I was studying this code. I'm not so sure if this is the right

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

2016-02-16 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 v2 00/26] worktree lock, move, remove and unlock

2016-02-16 Thread Nguyễn Thái Ngọc Duy
7; | cut -c 19-)" __gitcomp "$list" } complete -o bashdefault -o default -o nospace -F _git_cw cw 2>/dev/null || \ complete -o default -o nospace -F _git_cw cw -- 8< -- Nguyễn Thái Ngọc Duy (26): usage.c: move format processing out of die_errno() usage.c:

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

2016-02-16 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 693a336..fd1d374 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -408,6 +408,7 @@ extern

[PATCH v2 05/26] copy.c: convert bb_(p)error_msg to (sys_)error

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- copy.c | 85 -- 1 file changed, 31 insertions(+), 54 deletions(-) diff --git a/copy.c b/copy.c index d24a8ae..cdb38d5 100644 --- a/copy.c +++ b/copy.c @@ -82,23 +82,16 @@ int FAST_FUNC

[PATCH v2 04/26] copy.c: delete unused code in copy_file()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
- selinux preservation code - make-link code - delete link dereference code - non-recursive copy code - stat no preservation code - verbose printing code Signed-off-by: Nguyễn Thái Ngọc Duy --- copy.c | 101 + 1 file changed

[PATCH v2 03/26] copy.c: import copy_file() from busybox

2016-02-16 Thread Nguyễn Thái Ngọc Duy
This is busybox's unmodified copy_file() in libbb/copy_file.c from the GPL2+ commit f2c043acfcf9dad9fd3d65821b81f89986bbe54e (busybox: fix uninitialized memory when displaying IPv6 addresses - 2016-01-18) Signed-off-by: Nguyễn Thái Ngọc Duy --- copy.c

[PATCH v2 07/26] copy.c: convert copy_file() to copy_dir_recursively()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
This finally enables busybox's copy_file() code under a new name (because "copy_file" is already taken in Git code base). Because this comes from busybox, POSIXy (or even Linuxy) behavior is expected. More changes may be needed for Windows support. Signed-off-by: Nguyễ

[PATCH v2 06/26] copy.c: style fix

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- copy.c | 50 +- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/copy.c b/copy.c index cdb38d5..00f8349 100644 --- a/copy.c +++ b/copy.c @@ -111,8 +111,10 @@ int FAST_FUNC copy_file(const char

[PATCH v2 11/26] path.c: add git_common_path() and strbuf_git_common_path()

2016-02-16 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 30a2708..04818c2 100644 --- a/cache.h +++ b/cache.h @@ -765,11 +765,14 @@ extern int check_repository_format(void

[PATCH v2 09/26] git-worktree.txt: keep subcommand listing in alphabetical order

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 10 +- builtin/worktree.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 62c76c1..1c9d7c1 100644 --- a

[PATCH v2 10/26] wrapper.c: allow to create an empty file with write_file()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
This is used later on to create empty .git/worktrees/xxx/locked when "git worktree lock" is called with no reason given. Signed-off-by: Nguyễn Thái Ngọc Duy --- wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper.c b/wrapper.c index 29a45d2..1dc1

[PATCH v2 19/26] worktree.c: add is_worktree_locked()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 18 ++ worktree.h | 6 ++ 2 files changed, 24 insertions(+) diff --git a/worktree.c b/worktree.c index 04aac73..facb907 100644 --- a/worktree.c +++ b/worktree.c @@ -219,6 +219,24 @@ int is_main_worktree(const struct

[PATCH v2 16/26] worktree.c: add is_main_worktree()

2016-02-16 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 v2 17/26] worktree.c: add validate_worktree()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
This function is later used by "worktree move" and "worktree remove" to ensure that we have a good connection between the repository and the worktree. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 63 ++ work

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

2016-02-16 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 cfc848d..97666cc 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -263,7 +263,7 @@ static int add_worktree(const

[PATCH v2 15/26] worktree.c: add find_worktree_by_path()

2016-02-16 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 v2 18/26] worktree.c: add update_worktree_location()

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 25 + worktree.h | 6 ++ 2 files changed, 31 insertions(+) diff --git a/worktree.c b/worktree.c index 28195b1..04aac73 100644 --- a/worktree.c +++ b/worktree.c @@ -282,6 +282,31 @@ int validate_worktree(const

[PATCH v2 24/26] worktree: add "move" commmand

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 6 +++- builtin/worktree.c | 60 ++ contrib/completion/git-completion.bash | 2 +- t/t2028-worktree-move.sh | 29 4 files changed

[PATCH v2 25/26] worktree move: accept destination as directory

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Similar to "mv a b/", which is actually "mv a b/a", we extract basename of source worktree and create a directory of the same name at destination if dst path is a directory. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/worktree.c | 19 ++- 1 file changed,

[PATCH v2 14/26] worktree.c: add clear_worktree()

2016-02-16 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 v2 23/26] worktree: add "unlock" command

2016-02-16 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 | 31 +++ contrib/completion/git-completion.bash | 2 +- t/t2028-worktree-move.sh | 14 ++ 4 files changed, 51

[PATCH v2 21/26] worktree: simplify prefixing paths

2016-02-16 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 97666cc..b261e11 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -332,7 +332,7 @@ static int add(int ac

[PATCH v2 26/26] worktree: add "remove" command

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 22 + builtin/worktree.c | 81 ++ contrib/completion/git-completion.bash | 5 ++- t/t2028-worktree-move.sh | 26 +++ 4 files changed

[PATCH v2 13/26] worktree.c: store "id" instead of "git_dir"

2016-02-16 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 v2 22/26] worktree: add "lock" command

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 12 -- builtin/worktree.c | 41 ++ contrib/completion/git-completion.bash | 5 - t/t2028-worktree-move.sh (new +x) | 34

[PATCH v2 12/26] worktree.c: use is_dot_or_dotdot()

2016-02-16 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 68341e4..cfc848d 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -94,7 +94,7

[PATCH v2 08/26] completion: support git-worktree

2016-02-16 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- contrib/completion/git-completion.bash | 23 +++ 1 file changed, 23 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 45ec47f..099d52e 100644 --- a/contrib/completion/git

[PATCH 0/3] Turn git-rebase--*.sh to external helpers

2016-02-17 Thread Nguyễn Thái Ngọc Duy
ual command call. But nothing > unfeasible. We do want to turn all these scripts to C in the end, regardless if the conversion is part of any GSoC. So I dug up my code and prepared this. Now we need people to convert any git-rebase*.sh to C :) Nguyễn Thái Ngọc Duy (3): rebase: move common

[PATCH 1/3] rebase: move common functions to rebase--lib.sh

2016-02-17 Thread Nguyễn Thái Ngọc Duy
These functions are used by git-rebase--*.sh, which will be made separate programs later. At that point, we can reinclude rebase--lib.sh to provide the functions without duplicating code. Signed-off-by: Nguyễn Thái Ngọc Duy --- Makefile | 1 + git-rebase--lib.sh (new) | 41

[PATCH 2/3] rebase: move cleanup code to exit_rebase()

2016-02-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git-rebase--lib.sh (mode +x) | 38 ++ git-rebase.sh| 37 + 2 files changed, 39 insertions(+), 36 deletions(-) mode change 100644 => 100755 git-rebase--lib.sh d

[PATCH 3/3] rebase: turn git-rebase--*.sh into separate programs

2016-02-17 Thread Nguyễn Thái Ngọc Duy
This is the first step of turning any of these scripts into C. We can see now what variables are exchanged between git-rebase.sh and the subscript (but we don't see all in this patch, variables may have been exported earlier in git-rebase.sh) Signed-off-by: Nguyễn Thái Ngọc Duy --- Mak

[PATCH 3/3] Correct conditions to free textconv result data

2016-02-22 Thread Nguyễn Thái Ngọc Duy
tconv(). Correct all call sites. Changes in combine-diff.c are not clear from diff output. We need to force not running fill_textconv() unless the function returns a new buffer so that it falls to the "else" case and allocates a new buffer with no conversion. Signed-off-by: Nguyễ

[PATCH 2/3] diff.c: remove unnecessary typecast

2016-02-22 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 8b3a3db..5bdc3c0 100644 --- a/diff.c +++ b/diff.c @@ -717,8 +717,8 @@ static void emit_rewrite_diff(const char *name_a, ecbdata.opt = o; if

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

2016-02-23 Thread Nguyễn Thái Ngọc Duy
ot be used together"); + die("git upload-pack: deepen and deepen-since (or deepen-not) cannot be used together"); if (depth > 0) deepen(depth, deepen_relative, &shallows); else if (deepen_rev_list) { @@ -801,16 +821,17 @@ static void r

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

2016-02-23 Thread Nguyễn Thái Ngọc Duy
For now we can handle two types, string and boolean, in set_helper_option(). Later on we'll add string_list support, which does not fit well. The new function strbuf_set_helper_option() can be reused for a separate function that handles string-list. Signed-off-by: Nguyễn Thái Ngọ

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

2016-02-23 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 v3 01/25] remote-curl.c: convert fetch_git() to use argv_array

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

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

2016-02-23 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 v3 08/25] upload-pack: tighten number parsing at "deepen" lines

2016-02-23 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 v3 05/25] upload-pack: remove unused variable "backup"

2016-02-23 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 v3 10/25] fetch-pack: use skip_prefix() instead of starts_with()

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

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

2016-02-23 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 v3 20/25] fetch: define shallow boundary with --shallow-exclude

2016-02-23 Thread Nguyễn Thái Ngọc Duy
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 | 4 builtin/fetch-pack.c| 7 +++ builtin/fetch.c | 21

[PATCH v3 18/25] refs: add expand_ref()

2016-02-23 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. The first user is "git clone/fetch --shallow-exclude". Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 8 +++- refs.h | 1

[PATCH v3 21/25] clone: define shallow clone boundary with --shallow-exclude

2016-02-23 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 a410409..5049663 100644 --- a

[PATCH v3 19/25] upload-pack: support define shallow boundary by excluding revisions

2016-02-23 Thread Nguyễn Thái Ngọc Duy
But deepen-not can be mixed with deepen-since. The result is exactly how you do the command "git rev-list --since=... --not ref". Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/pack-protocol.txt | 3 ++- Documentation/technical/protocol-capabilities.txt | 9

[PATCH v3 15/25] fetch: define shallow boundary with --shallow-since

2016-02-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/fetch-options.txt | 4 Documentation/git-fetch-pack.txt| 4 Documentation/gitremote-helpers.txt | 3 +++ builtin/fetch-pack.c| 4 builtin/fetch.c | 29

[PATCH v3 22/25] t5500, t5539: tests for shallow depth excluding a ref

2016-02-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 22 ++ t/t5539-fetch-http-shallow.sh | 22 ++ 2 files changed, 44 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 26f050d..a3fe5ca 100755 --- a/t/t5500

[PATCH v3 17/25] t5500, t5539: tests for shallow depth since a specific date

2016-02-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 24 t/t5539-fetch-http-shallow.sh | 26 ++ 2 files changed, 50 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index e5f83bf..26f050d 100755 --- a/t

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