[PATCH v3 23/25] upload-pack: split check_unreachable() in two, prep for get_reachable_list()

2016-02-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 95a0bfb..9e4a4fa 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -452,24 +452,24 @@ static

[PATCH v3 07/25] upload-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 --- upload-pack.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index bfb7985..257ad48 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -276,7 +276,7 @@ static void

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

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

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

2016-02-23 Thread Nguyễn Thái Ngọc Duy
st not cheap to do. The second way is mark one "x" as shallow commit instead of "a" and produce this graph at client side: x -- a -- o // c -- b -- o More commits, but simpler grafting rules. Signed-off-by: Nguyễn Thái Ngọc Duy ---

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

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

[PATCH v3 16/25] clone: define shallow clone boundary based on time 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/git-clone.txt | 3 +++ builtin/clone.c | 16 +--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index b7c467a..a410409 100644 --- a

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

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

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

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

[PATCH v3 24/25] upload-pack: add get_reachable_list()

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

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

2016-02-23 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] unpack-trees: do not delete i-t-a entries in worktree even when forced

2016-02-24 Thread Nguyễn Thái Ngọc Duy
Intent-to-add entries are basically "I may want to commit these files later, but for now they are untracked". As such, when the user does "git reset --hard ", which removes i-t-a entries from the index, i-t-a entries in worktree should be kept as untracked. Signed-off-by:

[PATCH 00/22] Mark more strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
On Sat, Feb 27, 2016 at 6:41 AM, Junio C Hamano wrote: > In previous cycles, I often left many topics in 'next' when tagging > this zero-th preview, but eventually merged them before the final. > I decided to do things a bit differently for this cycle: a topic, > once it hits 'next', will not be r

[PATCH 01/22] credential-cache--daemon: enable localized messages

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- credential-cache--daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c index caef21e..63ca7c8 100644 --- a/credential-cache--daemon.c +++ b/credential-cache--daemon.c @@ -263,6 +263,8 @@ int

[PATCH 04/22] builtin/clone.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 9ac6c01..6616392 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -236,8 +236,8 @@ static char *guess_dir_name(const

[PATCH 08/22] convert.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- convert.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/convert.c b/convert.c index f524b8d..59d03b0 100644 --- a/convert.c +++ b/convert.c @@ -199,9 +199,11 @@ static void check_safe_crlf(const char

[PATCH 02/22] builtin/blame.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 58 - 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index e982fb8..988a38a 100644 --- a/builtin/blame.c +++ b/builtin/blame.c

[PATCH 03/22] builtin/checkout.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index cfa66e2..efcbd8f 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -662,7 +662,7 @@ static void

[PATCH 09/22] credential-cache--daemon.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- credential-cache--daemon.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c index 63ca7c8..ab33355 100644 --- a/credential-cache--daemon.c +++ b

[PATCH 06/22] builtin/config.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/config.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/builtin/config.c b/builtin/config.c index 98ca43d..b07df26 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -90,7 +90,7

[PATCH 07/22] builtin/update-index.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index 1c94ca5..21e38a8 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1127,9

[PATCH 05/22] builtin/config.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/config.c b/builtin/config.c index ca9f834..98ca43d 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -378,7 +378,7 @@ static int get_colorbool(const char

[PATCH 14/22] refs/files-backend.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 86 ++-- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 81f68f8..bf76094 100644 --- a/refs/files-backend.c +++ b/refs

[PATCH 11/22] ident.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ident.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ident.c b/ident.c index 6e12582..367a5dc 100644 --- a/ident.c +++ b/ident.c @@ -75,13 +75,13 @@ static int add_mailname_host(struct strbuf *buf) mailname

[PATCH 12/22] notes.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- notes.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/notes.c b/notes.c index 88cf474..0f03f77 100644 --- a/notes.c +++ b/notes.c @@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node

[PATCH 10/22] http.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- http.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/http.c b/http.c index 1d5e3bb..d56cb52 100644 --- a/http.c +++ b/http.c @@ -404,7 +404,7 @@ static void init_curl_proxy_auth(CURL *result

[PATCH 15/22] remote-curl.c: mark strings for translation

2016-02-26 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, 20 insertions(+), 20 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index 15e48e2..d5b33aa 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -177,7 +177,7 @@ static

[PATCH 13/22] ref-filter.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ref-filter.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index bb79d6b..bc551a7 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -74,14 +74,14 @@ static void

[PATCH 18/22] submodule.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- submodule.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/submodule.c b/submodule.c index 24fb81a..4dd6ab3 100644 --- a/submodule.c +++ b/submodule.c @@ -187,7 +187,7 @@ void gitmodules_config(void

[PATCH 16/22] run-command.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- run-command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-command.c b/run-command.c index 863dad5..1ee2357 100644 --- a/run-command.c +++ b/run-command.c @@ -909,7 +909,7 @@ static int default_start_failure(struct

[PATCH 19/22] trailer.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- trailer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trailer.c b/trailer.c index 94b387b..8e48a5c 100644 --- a/trailer.c +++ b/trailer.c @@ -234,7 +234,7 @@ static const char *apply_command(const char *command, const char *arg

[PATCH 17/22] sha1_file.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1_file.c | 189 ++-- 1 file changed, 96 insertions(+), 93 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 0251700..f669499 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -194,7 +194,7

[PATCH 21/22] transport.c: mark strings for translating

2016-02-26 Thread Nguyễn Thái Ngọc Duy
More strings can be translated in print_ref_status() at least, but we need to deal with utf-8 string length there. Let's stick with a safe subset for now. Signed-off-by: Nguyễn Thái Ngọc Duy --- transport.c | 41 ++--- 1 file changed, 22 insertions(+

[PATCH 20/22] transport-helper.c: mark strings for translating

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Debug printing is kept in English to reduce workload for translators. Those rare who actually debug this can read English anyway. Signed-off-by: Nguyễn Thái Ngọc Duy --- transport-helper.c | 84 +++--- 1 file changed, 42 insertions(+), 42

[PATCH 22/22] wrapper.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrapper.c b/wrapper.c index 9afc1a0..d2e3068 100644 --- a/wrapper.c +++ b/wrapper.c @@ -91,10 +91,10 @@ static void *do_xmallocz(size_t size, int gentle) void *ret

[PATCH 4/3] sha1_file.c: mark strings for translation

2016-02-26 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Since jk/pack-idx-corruption-safety is already in 'next', can we add this patch on top? Surrounding strings are handled separately [1] by another series. [1] http://thread.gmane.org/gmane.comp.version-control.git/287661/focus=287678 sha1_

[PATCH] dir.c: fix dir re-inclusion rules with "NODIR" and "MUSTBEDIR"

2016-03-09 Thread Nguyễn Thái Ngọc Duy
ory, which is "toplevel" in the above paragraphs, to begin with. The remaining matching case (neither NODIR nor MUSTBEDIR is set) is already fixed in a60ea8f (dir.c: fix match_pathname() - 2016-02-15) Reported-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- The fix may look like this (I

[PATCH 3/2] dir.c: fix dir re-inclusion rules with "NODIR" and "MUSTBEDIR"

2016-03-18 Thread Nguyễn Thái Ngọc Duy
cost on normal/common case (and what's being described here is NOT normal) down to minimum. On top of that, exclude code is already complicated as it is. It's best to not turn the code upside down. Not until this approach is proved insufficient. Signed-off-by: Nguyễn Thái Ngọc Duy --- This

[PATCH 1/2] dir.c: fix bug in 'nd/exclusion-regression-fix' topic

2016-03-19 Thread Nguyễn Thái Ngọc Duy
addir() and cannot control the order of entries. Which means we can't write a test for .gitignore that will reliably fail without this fix. Which is why this patch only adds a test for sparse checkout, even though the same above steps happen to .gitignore. (*) The problem is known and will be fixe

[PATCH 2/2] dir.c: correct "stuck" logging logic

2016-03-19 Thread Nguyễn Thái Ngọc Duy
; } ... } With this loop, if sticky_paths.nr is non-zero and exc is not NULL, we know we have found a sticky path and can log " (stuck)". With the last patch, the "continue;" line is removed and that won't work anymore. So explicitly keep track of when to print " (stuck)

[PATCH 2/2] dir.c: correct "stuck" logging logic

2016-03-19 Thread Nguyễn Thái Ngọc Duy
; } ... } With this loop, if sticky_paths.nr is non-zero and exc is not NULL, we know we have found a sticky path and can log " (stuck)". With the last patch, the "continue;" line is removed and that won't work anymore. So explicitly keep track of when to print " (stuck)"

[PATCH 1/2] dir.c: fix bug in 'nd/exclusion-regression-fix' topic

2016-03-19 Thread Nguyễn Thái Ngọc Duy
() and cannot control the order of entries. Which means we can't write a test for .gitignore that will reliably fail without this fix. Which is why this patch only adds a test for sparse checkout, even though the same above steps happen to .gitignore. (*) which will be fixed later and descr

[PATCH] sha1_name.c: add an option to abort on ambiguous refs

2016-03-23 Thread Nguyễn Thái Ngọc Duy
There are cases when a warning on ambiguous refs may go unnoticed (e.g. git-log filling up the whole screen). There are also cases when people want to catch ambiguity early (e.g. it happens deep in some script). In either case, aborting the program would accomplish it. Signed-off-by: Nguyễn Thái

Re: git-apply does not work in a sub-directory of a Git repository

2016-03-24 Thread Nguyễn Thái Ngọc Duy
+Brian who also had issues with git-apply. On Thu, Mar 24, 2016 at 5:49 PM, Duy Nguyen wrote: > On Wed, Mar 23, 2016 at 11:55 PM, Junio C Hamano wrote: >> Junio C Hamano writes: >> >>> See >>> >>> http://thread.gmane.org/gmane.comp.version-control.git/288316/focus=288321 >>> >>> I agree it is

[PATCH 3/4] apply: add --whole to apply git patch without prefix filtering

2016-03-24 Thread Nguyễn Thái Ngọc Duy
--whole to make it more convenient to do so without moving cwd around. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-apply.txt | 8 +++- builtin/apply.c | 4 +++- t/t4111-apply-subdir.sh | 32 3 files changed, 42 insertions(+), 2

[PATCH 2/4] git-apply.txt: mention the behavior inside a subdir

2016-03-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-apply.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index 5444d2f..8ddb207 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -21,6 +21,8

[PATCH 4/4] apply: report patch skipping in verbose mode

2016-03-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/apply.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/apply.c b/builtin/apply.c index 01e1d5e..9cbb186 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4384,6 +4384,8 @@ static int apply_patch(int fd, const char *filename, int

[PATCH 1/4] git-apply.txt: remove a space

2016-03-24 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-apply.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index d9ed6a1..5444d2f 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt

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

2016-04-13 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 01/26] remote-curl.c: convert fetch_git() to use argv_array

2016-04-13 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 06/26] upload-pack: move "unshallow" sending code out of deepen()

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

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

2016-04-13 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 07/26] upload-pack: use skip_prefix() instead of starts_with()

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

[PATCH 05/26] upload-pack: remove unused variable "backup"

2016-04-13 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 00/26] nd/shallow-deepen updates

2016-04-13 Thread Nguyễn Thái Ngọc Duy
Compared to 'pu' 14/26 has a fix from Jeff, about incorrectly sharing variable for iteration. Interdiff --- a/shallow.c +++ b/shallow.c @@ -188,13 +188,14 @@ struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av, */ for (p = not_shallow_list; p; p = p->next

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

2016-04-13 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 04/26] upload-pack: move "shallow" sending code out of deepen()

2016-04-13 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 12/26] fetch-pack.c: mark strings for translating

2016-04-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- fetch-pack.c | 75 ++-- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 4020744..08caf1d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -208,7 +208,7

[PATCH 10/26] fetch-pack: use skip_prefix() instead of starts_with()

2016-04-13 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 08/26] upload-pack: tighten number parsing at "deepen" lines

2016-04-13 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 11/26] fetch-pack: use a common function for verbose printing

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

[PATCH 19/26] refs: add expand_ref()

2016-04-13 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 26/26] fetch, upload-pack: --deepen=N extends shallow boundary by N commits

2016-04-13 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 21/26] fetch: define shallow boundary with --shallow-exclude

2016-04-13 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 23/26] t5500, t5539: tests for shallow depth excluding a ref

2016-04-13 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 20/26] upload-pack: support define shallow boundary by excluding revisions

2016-04-13 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 25/26] upload-pack: add get_reachable_list()

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

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

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

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

2016-04-13 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

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

2016-04-13 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 16/26] fetch: define shallow boundary with --shallow-since

2016-04-13 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 14/26] shallow.c: implement a generic shallow boundary finder based on rev-list

2016-04-13 Thread Nguyễn Thái Ngọc Duy
st not cheap to do. The second way is mark one "x" as shallow commit instead of "a" and produce this graph at client side: x -- a -- o // c -- b -- o More commits, but simpler grafting rules. Signed-off-by: Nguyễn Thái Ngọc Duy ---

[PATCH 24/26] upload-pack: split check_unreachable() in two, prep for get_reachable_list()

2016-04-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 95a0bfb..9e4a4fa 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -452,24 +452,24 @@ static

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

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

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

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

[PATCH 00/25] worktree lock, move, remove and unlock

2016-04-13 Thread Nguyễn Thái Ngọc Duy
This is basically a resend from last time, which happened during rc time. It adds 4 more commands, basically cleaning up the "TODO" list in git-worktree.txt. So far I've only actually used move and remove (and maybe unlock once because worktree-add failed on me and I had to unlock it manually). An

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

2016-04-13 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 02/25] usage.c: add sys_error() that prints strerror() automatically

2016-04-13 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 4743954..e8e7765 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -412,6 +412,7 @@ extern

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

2016-04-13 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 07/25] copy.c: convert copy_file() to copy_dir_recursively()

2016-04-13 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 05/25] copy.c: convert bb_(p)error_msg to (sys_)error

2016-04-13 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 12/25] worktree.c: store "id" instead of "git_dir"

2016-04-13 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 04/25] copy.c: delete unused code in copy_file()

2016-04-13 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 10/25] path.c: add git_common_path() and strbuf_git_common_path()

2016-04-13 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 213a8d3..c81f654 100644 --- a/cache.h +++ b/cache.h @@ -767,11 +767,14 @@ extern int check_repository_format(void

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

2016-04-13 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 11/25] worktree.c: use is_dot_or_dotdot()

2016-04-13 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 575f899..7ff66fa 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -94,7 +94,7

[PATCH 08/25] completion: support git-worktree

2016-04-13 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 e3918c8..f66db2d 100644 --- a/contrib/completion/git

[PATCH 06/25] copy.c: style fix

2016-04-13 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 23/25] worktree: add "move" commmand

2016-04-13 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 19/25] worktree: avoid 0{40}, too many zeroes, hard to read

2016-04-13 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 7ff66fa..e041d7f 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -261,7 +261,7 @@ static int add_worktree(const

[PATCH 20/25] worktree: simplify prefixing paths

2016-04-13 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 e041d7f..a9e91ab 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -330,7 +330,7 @@ static int add(int ac

[PATCH 18/25] worktree.c: add is_worktree_locked()

2016-04-13 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 e526e25..37eec09 100644 --- a/worktree.c +++ b/worktree.c @@ -219,6 +219,24 @@ int is_main_worktree(const struct

[PATCH 14/25] worktree.c: add find_worktree_by_path()

2016-04-13 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 15/25] worktree.c: add is_main_worktree()

2016-04-13 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 22/25] worktree: add "unlock" command

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

[PATCH 16/25] worktree.c: add validate_worktree()

2016-04-13 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 21/25] worktree: add "lock" command

2016-04-13 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 25/25] worktree: add "remove" command

2016-04-13 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 13/25] worktree.c: add clear_worktree()

2016-04-13 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 24/25] worktree move: accept destination as directory

2016-04-13 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 17/25] worktree.c: add update_worktree_location()

2016-04-13 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..e526e25 100644 --- a/worktree.c +++ b/worktree.c @@ -282,6 +282,31 @@ int validate_worktree(const

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