[PATCH 02/12] alias.c: mark split_cmdline_strerror() strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
This function can be part of translated messages. To make sure we don't have a sentence with mixed languages, mark the strings for translation, but only use translated strings in places we know we will output translated strings. Signed-off-by: Nguyễn Thái Ngọc Duy --- alias.c | 4 ++-- b

[PATCH 03/12] archive.c: mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive.c b/archive.c index 9d16b7fadf..757519a9d6 100644 --- a/archive.c +++ b/archive.c @@ -385,12 +385,12 @@ static void parse_treeish_arg(const char **argv,

[PATCH 05/12] read-cache.c: mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
There are a couple other improvements on these strings as well: - add missing colon (as separator) - quote paths - provide more information on error messages - keep first word in lowercase - some die() become BUG() Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c| 63 ++

[PATCH 00/12] Mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Not much to write here. I make a note whenever I see unstranslated strings during review and this is the result. There are some more code changes than just adding _() though, e.g. 10/12. Nguyễn Thái Ngọc Duy (12): git.c: mark more strings for translation alias.c: mark split_cmdline_strerror()

[PATCH 04/12] attr.c: mark more string for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 60d284796d..4ebc169abe 100644 --- a/attr.c +++ b/attr.c @@ -372,7 +372,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,

[PATCH 01/12] git.c: mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/git.c b/git.c index adac132956..1ad565c5c8 100644 --- a/git.c +++ b/git.c @@ -338,27 +338,27 @@ static int handle_alias(int *argcp, const char ***argv

[PATCH 11/12] parse-options.c: mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options.c | 18 +- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/parse-options.c b/parse-options.c index 0bf817193d..949aac287f 100644 --- a/parse-options.c +++ b/parse-op

[PATCH 12/12] fsck: mark strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/fsck.c | 113 - t/t1410-reflog.sh | 6 +- t/t1450-fsck.sh| 50 t/t6050-replace.sh | 4 +- t/t7415-submodule-names.sh | 6 +- 5 files changed, 94 ins

[PATCH 06/12] read-cache.c: add missing colon separators

2018-10-27 Thread Nguyễn Thái Ngọc Duy
typechange_fmt and added_fmt should have a colon before "needs update". Align the statements to make it easier to read and see. Also drop the unnecessary (). Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/read-c

[PATCH 07/12] reflog: mark strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reflog.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index b5941c1ff3..33cb20b7d8 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -13,11 +13,15

[PATCH 10/12] parse-options: replace opterror() with optname()

2018-10-27 Thread Nguyễn Thái Ngọc Duy
There are a few issues with opterror() - it tries to assemble an English sentence from pieces. This is not great for translators because we give them pieces instead of a full sentence. - It's a wrapper around error() and needs some hack to let the compiler know it always returns -1. - Sinc

[PATCH 08/12] remote.c: mark messages for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 49 + 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/remote.c b/remote.c index 81f4f01b00..11b33d1625 100644 --- a/remote.c +++ b/remote.c @@ -359,7 +359,7 @@ static int handle_conf

[PATCH 09/12] repack: mark more strings for translation

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/repack.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index c6a7943d5c..0af20fa0fc 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -197,7 +197,7 @@ stati

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-27 Thread Duy Nguyen
On Sun, Oct 28, 2018 at 7:25 AM Torsten Bögershausen wrote: > > On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > > can but only in three patterns: > > > > - '**/' matches zero or more leading director

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-27 Thread Torsten Bögershausen
On Sat, Oct 27, 2018 at 10:48:23AM +0200, Nguyễn Thái Ngọc Duy wrote: > In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' > can but only in three patterns: > > - '**/' matches zero or more leading directories > - '/**/' matches zero or more directories in between > - '/**' mat

t7405.17 breakage vanishes with GETTEXT_POISON=1

2018-10-27 Thread Duy Nguyen
Something fishy is going on but I don't think I'll spend time hunting it down so I post here in case somebody else is interested. It might also indicate a problem with poison gettext, not the test case too. -- Duy

[PATCH] update git-http-backend doc for lighttpd

2018-10-27 Thread Glenn Strauss
use "GIT_HTTP_EXPORT_ALL" => "1" with a value for best compatiblity. lighttpd 1.4.51 setenv.add-environment does add vars with empty value. lighttpd setenv.set-environment does, but was only introduced in 1.4.46 git-http-backend may be found at /usr/libexec/git-core/git-http-backend scope lighttp

[PATCH v2 04/16] sequencer: introduce todo_list_write_to_file()

2018-10-27 Thread Alban Gruin
This introduce a new function to recreate the text of a todo list from its commands, and then to write it to the disk. This will be useful in the future, the buffer of a todo list won’t be treated as a strict mirror of the todo file by some of its functions once they will be refactored. This func

[PATCH v2 09/16] sequencer: change complete_action() to use the refactored functions

2018-10-27 Thread Alban Gruin
complete_action() used functions that read the todo-list file, made some changes to it, and wrote it back to the disk. The previous commits were dedicated to separate the part that deals with the file from the actual logic of these functions. Now that this is done, we can call directly the "logic

[PATCH v2 14/16] sequencer: use edit_todo_list() in complete_action()

2018-10-27 Thread Alban Gruin
This changes complete_action() to use edit_todo_list(), now that it can handle the initial edit of the todo list. Signed-off-by: Alban Gruin --- sequencer.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/sequencer.c b/sequencer.c index a03505f582..076

[PATCH v2 10/16] sequencer: refactor skip_unnecessary_picks() to work on a todo_list

2018-10-27 Thread Alban Gruin
This refactors skip_unnecessary_picks() to work on a todo_list. The file-handling logic is completely dropped here, as its only usage is made by complete_action(). Instead of truncating the todo list’s buffer, the items are moved to the beginning of the list, eliminating the need to reparse the l

[PATCH v2 05/16] sequencer: refactor check_todo_list() to work on a todo_list

2018-10-27 Thread Alban Gruin
This refactors check_todo_list() to work on a todo_list to avoid redundant reads and writes to the disk. The function is renamed todo_list_check(). The parsing of the two todo lists is left to the caller. As rebase -p still need to check the todo list from the disk, a new function is introduced,

[PATCH v2 08/16] sequencer: make sequencer_make_script() write its script to a strbuf

2018-10-27 Thread Alban Gruin
This makes sequencer_make_script() write its script to a strbuf (ie. the buffer of a todo_list) instead of a FILE. This reduce the amount of read/write made by rebase interactive. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 13 +++- sequencer.c | 38

[PATCH v2 12/16] rebase-interactive: append_todo_help() changes

2018-10-27 Thread Alban Gruin
This moves the writing of the comment "Rebase $shortrevisions onto $shortonto ($command_count commands)" from complete_action() to append_todo_help(). shortrevisions, shortonto, and command_count are passed as parameters to append_todo_help(). During the initial edit of the todo list, shortrevisi

[PATCH v2 11/16] rebase-interactive: use todo_list_write_to_file() in edit_todo_list()

2018-10-27 Thread Alban Gruin
Just like complete_action(), edit_todo_list() used a function (transform_todo_file()) that read the todo list from the disk and wrote it back, resulting in useless disk accesses. This changes edit_todo_list() to call directly todo_list_write_to_file() instead. Signed-off-by: Alban Gruin --- reb

[PATCH v2 13/16] rebase-interactive: rewrite edit_todo_list() to handle the initial edit

2018-10-27 Thread Alban Gruin
edit_todo_list() is changed to work on a todo_list, and to handle the initial edition of the todo list (ie. making a backup of the todo list). It does not check for dropped commits yet, as todo_list_check() does not take the commits that have already been processed by the rebase (ie. the todo list

[PATCH v2 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list

2018-10-27 Thread Alban Gruin
This refactors sequencer_add_exec_commands() to work on a todo_list to avoid redundant reads and writes to the disk. An obvious way to do this would be to insert the `exec' command between the other commands, and reparse it once this is done. This is not what is done here. Instead, the command i

[PATCH v2 16/16] rebase--interactive: move transform_todo_file() to rebase--interactive.c

2018-10-27 Thread Alban Gruin
As transform_todo_file() is only needed inside of rebase--interactive.c, it is moved there from sequencer.c. Signed-off-by: Alban Gruin --- builtin/rebase--interactive.c | 20 sequencer.c | 20 sequencer.h | 1 - 3 fi

[PATCH v2 15/16] sequencer: fix a call to error() in transform_todo_file()

2018-10-27 Thread Alban Gruin
This replaces a call to error() by a call to error_errno() after writing the content of the todo list to the disk in transform_todo_file(). Signed-off-by: Alban Gruin --- No changes since v1, was commit 14/15. sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seque

[PATCH v2 07/16] sequencer: refactor rearrange_squash() to work on a todo_list

2018-10-27 Thread Alban Gruin
This refactors rearrange_squash() to work on a todo_list to avoid redundant reads and writes. The function is renamed todo_list_rearrange_squash(). The old version created a new buffer, which was directly written to the disk. This new version creates a new item list by just memcpying items from

[PATCH v2 01/16] sequencer: changes in parse_insn_buffer()

2018-10-27 Thread Alban Gruin
This clears the number of items of a todo_list before parsing it to allow to parse the same list multiple times without issues. As its items are not dynamically allocated, or don’t need to allocate memory, no additionnal memory management is required here. Furthermore, if a line is invalid, the t

[PATCH v2 03/16] sequencer: refactor transform_todos() to work on a todo_list

2018-10-27 Thread Alban Gruin
This refactors transform_todos() to work on a todo_list. The function is renamed todo_list_transform(). As rebase -p still need to check the todo list from the disk, a new function is introduced, transform_todo_file(). It is still used by complete_action() and edit_todo_list() for now, but they

[PATCH v2 00/16] sequencer: refactor functions working on a todo_list

2018-10-27 Thread Alban Gruin
At the center of the "interactive" part of the interactive rebase lies the todo list. When the user starts an interactive rebase, a todo list is generated, presented to the user (who then edits it using a text editor), read back, and then is checked and processed before the actual rebase takes pla

[PATCH v2 02/16] sequencer: make the todo_list structure public

2018-10-27 Thread Alban Gruin
This makes the structures todo_list and todo_item, and the functions todo_list_release() and parse_insn_buffer(), accessible outside of sequencer.c. Signed-off-by: Alban Gruin --- No changes since v1. sequencer.c | 66 + sequencer.h | 48 +

Re: Git Test Coverage Report (Saturday, Oct 27)

2018-10-27 Thread Derrick Stolee
On 10/27/2018 9:55 AM, Junio C Hamano wrote: Derrick Stolee writes: Uncovered in mater not in master@{1} Does this typo indicate that some part of the process to produce and send out this report involve manual editing? I kick off four builds with on Azure

Re: Git Test Coverage Report (Saturday, Oct 27)

2018-10-27 Thread brian m. carlson
On Sat, Oct 27, 2018 at 09:27:21AM -0400, Derrick Stolee wrote: > In an effort to ensure new code is reasonably covered by the test suite, we > now have contrib/coverage-diff.sh to combine the gcov output from 'make > coverage-test ; make coverage-report' with the output from 'git diff A B' to > di

[PATCH v2 10/10] read-cache.c: initialize copy_len to shut up gcc 8

2018-10-27 Thread Nguyễn Thái Ngọc Duy
It was reported that when building with NO_PTHREADS=1, -Wmaybe-uninitialized is triggered. Just initialize the variable from the beginning to shut the compiler up (because this warning is enabled in config.dev) Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 4 +--- 1 file changed, 1 inse

[PATCH v2 02/10] index-pack: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/index-pack.c | 68 1 file changed, 18 insertions(+), 50 deletions(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 2004e25da2..bbd66ca025 100644 --- a/builtin/index-pack.c +++ b/builtin/

[PATCH v2 03/10] name-hash.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- name-hash.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/name-hash.c b/name-hash.c index 1fcda73cb3..b3c9ac791d 100644 --- a/name-hash.c +++ b/name-hash.c @@ -7,6 +7,7 @@ */ #define NO_THE_INDEX_COMPATIBILIT

[PATCH v2 04/10] attr.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/attr.c b/attr.c index 60d284796d..eaece6658d 100644 --- a/attr.c +++ b/attr.c @@ -41,23 +41,17 @@ const char *git_attr_name(const struct git_attr *attr) struct attr_hashmap {

[PATCH v2 08/10] read-cache.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 49 ++--- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/read-cache.c b/read-cache.c index d57958233e..ba870bc3fd 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1920,19 +1920,15 @

[PATCH v2 05/10] grep: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 59 +++--- grep.c | 6 - grep.h | 6 - 3 files changed, 22 insertions(+), 49 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index d8508ddf79..6dd15dbaa2 10064

[PATCH v2 09/10] Clean up pthread_create() error handling

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Normally pthread_create() rarely fails and sometimes error handling can be neglected. But with new pthreads wrapper, pthread_create() will return ENOSYS on a system without thread support. Threaded code _is_ protected by HAVE_THREADS and pthread_create() should never run in the first place. But th

[PATCH v2 07/10] pack-objects: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 26 ++ pack-objects.h | 6 -- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index b059b86aee..12edd6da16 100644 --- a/builtin/pac

[PATCH v2 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Nguyễn Thái Ngọc Duy
When built with NO_PTHREADS, the macros are used make the code build even though pthreads header and library may be missing. The code can still have different code paths for no threads support with HAVE_THREADS variable. There are of course impacts on no-pthreads builds: - data structure may get

[PATCH v2 06/10] preload-index.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- preload-index.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/preload-index.c b/preload-index.c index 9e7152ab14..0e24886aca 100644 --- a/preload-index.c +++ b/preload-index.c @@ -7,17 +7,7 @@ #include "fsmonitor.h"

[PATCH v2 00/10] Reduce #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
The send-pack.c patch is dropped since it's tied to async code and like transport-helper.c (or more cleanups in index-pack.c) could be left for later. I added one more patch to shut up -Wmaybe-uninitialized but since I could not reproduce it, Jeff would need to verify if it works for him. Nguyễn

Re: [PATCH 00/10] Reduce #ifdef NO_PTHREADS

2018-10-27 Thread Duy Nguyen
On Sat, Oct 27, 2018 at 10:13 AM Jeff King wrote: > > On Sat, Oct 27, 2018 at 09:09:53AM +0200, Nguyễn Thái Ngọc Duy wrote: > > > People seemed to support the idea of removing these #ifdef NO_PTHREADS [1] > > so this is a complete series. I left the #ifdef in run-command.c and > > transport-helper

Re: bug?: git grep HEAD with exclude in pathspec not taken into account

2018-10-27 Thread Duy Nguyen
On Wed, Oct 24, 2018 at 4:55 PM Christophe Bliard wrote: > > Hi, > > I observed an unexpected behavior while using git grep with both git > 2.19.1 and 2.14.3. Quick note. I confirm this is a bug in tree_entry_interesting() perhaps being over-optimistic. It'll take me more time to familiarize myse

Re: [PATCH 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Duy Nguyen
On Sat, Oct 27, 2018 at 10:15 AM Jeff King wrote: > > On Sat, Oct 27, 2018 at 09:40:13AM +0200, Duy Nguyen wrote: > > > > We expect to be able to store a void pointer here and get it back, which > > > should work even for a single thread. Do we need something like: > > > > > > extern void *pthre

Re: [PATCH v3 10/12] Add a base implementation of SHA-256 support

2018-10-27 Thread Jakub Narebski
"brian m. carlson" writes: > SHA-1 is weak and we need to transition to a new hash function. For > some time, we have referred to this new function as NewHash. Recently, > we decided to pick SHA-256 as NewHash. Even if we have decided to not repeat the reasoning behind the need to switch away

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-27 Thread Duy Nguyen
On Sat, Oct 27, 2018 at 11:34 AM Jeff King wrote: > Taking one step back, the root problem in this thread is that stat() on > non-existing files is slow (which makes has_sha1_file slow). > > One solution there is to cache the results of looking in .git/objects > (or any alternate object store) for

Re: Git Test Coverage Report (Saturday, Oct 27)

2018-10-27 Thread Junio C Hamano
Derrick Stolee writes: > In an effort to ensure new code is reasonably covered by the test > suite, we now have contrib/coverage-diff.sh to combine the gcov output > from 'make coverage-test ; make coverage-report' with the output from > 'git diff A B' to discover _new_lines of code that are not

Git Test Coverage Report (Saturday, Oct 27)

2018-10-27 Thread Derrick Stolee
In an effort to ensure new code is reasonably covered by the test suite, we now have contrib/coverage-diff.sh to combine the gcov output from 'make coverage-test ; make coverage-report' with the output from 'git diff A B' to discover _new_lines of code that are not covered. This report ignores

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-27 Thread Ævar Arnfjörð Bjarmason
On Sat, Oct 27 2018, Jeff King wrote: > On Sat, Oct 27, 2018 at 04:26:50PM +0900, Junio C Hamano wrote: > >> Ævar Arnfjörð Bjarmason writes: >> >> > But as Junio notes the devil's in the details, another one I thought of >> > is: >> > >> > GIT_OBJECT_DIRECTORY=/some/other/repository git clo

Re: [PATCH] i18n: make GETTEXT_POISON a runtime option

2018-10-27 Thread Ævar Arnfjörð Bjarmason
On Sat, Oct 27 2018, Jeff King wrote: > On Fri, Oct 26, 2018 at 09:20:56PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> >> I was thinking: >> >> >> >> $ git var -e GIT_WHATEVER_ENV >> >> >> >> [-e for environment]. >> >> >> >> ... but that is really no different than git-config. ;-) >> > >> > Ac

Re: [PATCH] Poison gettext with the Ook language

2018-10-27 Thread Jakub Narebski
SZEDER Gábor writes: > On Mon, Oct 22, 2018 at 05:36:33PM +0200, Nguyễn Thái Ngọc Duy wrote: >> >> The current gettext() function just replaces all strings with >> '# GETTEXT POISON #' including format strings and hides the things >> that we should be allowed to grep (like branch names, or some ot

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 04:26:50PM +0900, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > > > But as Junio notes the devil's in the details, another one I thought of > > is: > > > > GIT_OBJECT_DIRECTORY=/some/other/repository git clone ... > > > > It seems to me that ... > > Actua

Hallo Freund

2018-10-27 Thread Wang jianlin
Ich beabsichtige, Ihnen einen Teil meines Vermögens als freiwillige finanzielle Spende an Sie zu geben. Wang Jianlin Wanda Gruppe

Re: [PATCH v4 10/12] Add a base implementation of SHA-256 support

2018-10-27 Thread Christian Couder
On Thu, Oct 25, 2018 at 4:42 AM brian m. carlson wrote: > +static void blk_SHA256_Transform(blk_SHA256_CTX *ctx, const unsigned char > *buf) > +{ > + > + uint32_t S[8], W[64], t0, t1; > + int i; > + > + /* copy state into S */ > + for (i = 0; i < 8; i++) { > +

[PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

2018-10-27 Thread Nguyễn Thái Ngọc Duy
In WM_PATHNAME mode (or FNM_PATHNAME), '*' does not match '/' and '**' can but only in three patterns: - '**/' matches zero or more leading directories - '/**/' matches zero or more directories in between - '/**' matches zero or more trailing directories/files When '**' is present but not in one

Re: [PATCH/RFC] thread-utils: better wrapper to avoid #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:26:28AM +0200, Duy Nguyen wrote: > On Fri, Oct 26, 2018 at 4:09 PM Ben Peart wrote: > > I agree though I'm still curious if there are still no-threaded > > platforms taking new versions of git. Perhaps we should do the > > depreciation warning you suggested elsewhere a

Re: [PATCH 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:40:13AM +0200, Duy Nguyen wrote: > > We expect to be able to store a void pointer here and get it back, which > > should work even for a single thread. Do we need something like: > > > > extern void *pthread_specific_data; > > > > #define pthread_setspecific(key, dat

Re: [PATCH 00/10] Reduce #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:53AM +0200, Nguyễn Thái Ngọc Duy wrote: > People seemed to support the idea of removing these #ifdef NO_PTHREADS [1] > so this is a complete series. I left the #ifdef in run-command.c and > transport-helper.c because those code looked complicated so perhaps we > could

[RFC PATCH] remote: add --fetch option to git remote set-url

2018-10-27 Thread Denton Liu
This adds the --fetch option to `git remote set-url` such that when executed we move the remote.*.url to remote.*.pushurl and set remote.*.url to the given url argument. For example, if we have the following config: [remote "origin"] url = g...@github.com:git/git.git `git

[PATCH v2 sg/test-rebase-editor-fix] t3404-rebase-interactive: test abbreviated commands

2018-10-27 Thread Johannes Sixt
Make sure that each short command is tested at least once. To not exacerbate the runtime of the test script, do not add new tests, but modify existing ones according to these criteria: - The test does not have a prerequisite. - The 'git rebase' command is not guarded by test_must_fail. The pick c

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:59AM +0200, Nguyễn Thái Ngọc Duy wrote: > diff --git a/builtin/grep.c b/builtin/grep.c > index d8508ddf79..29221e1003 100644 > --- a/builtin/grep.c > +++ b/builtin/grep.c > @@ -34,7 +34,6 @@ static int recurse_submodules; > #define GREP_NUM_THREADS_DEFAULT 8 > stati

Re: [PATCH 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Duy Nguyen
On Sat, Oct 27, 2018 at 9:31 AM Jeff King wrote: > > +#define pthread_setspecific(key, data) > > +#define pthread_getspecific(key) NULL > > We expect to be able to store a void pointer here and get it back, which > should work even for a single thread. Do we need something like: > > extern void

Re: [PATCH 05/10] send-pack.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:58AM +0200, Nguyễn Thái Ngọc Duy wrote: > While at there correct "#include cache.h" position. It must be one of > the first includes. > [...] > @@ -1,4 +1,5 @@ > #include "builtin.h" > +#include "cache.h" I think it's actually fine as it is. The rule is not about ca

Re: [PATCH 02/10] index-pack: remove #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:55AM +0200, Nguyễn Thái Ngọc Duy wrote: > static inline struct thread_local *get_thread_data(void) > { > -#ifndef NO_PTHREADS > - if (threads_active) > - return pthread_getspecific(key); > - assert(!threads_active && > -"This should o

Re: [PATCH 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:54AM +0200, Nguyễn Thái Ngọc Duy wrote: > +/* > + * macros instead of typedefs because pthread definitions may have > + * been pulled in by some system dependencies even though the user > + * wants to disable pthread. > + */ > +#define pthread_t int > +#define pthread

Re: What's cooking in git.git (Oct 2018, #05; Fri, 26)

2018-10-27 Thread Junio C Hamano
Stefan Beller writes: >> >> * sb/strbuf-h-update (2018-09-29) 1 commit >> (merged to 'next' on 2018-10-26 at e4ad935cb0) >> + strbuf.h: format according to coding guidelines >> >> Code clean-up to serve as a BCP example. >> >> Will merge to 'master'. >> Further clean-up patches may need to

Re: [RFC PATCH] index-pack: improve performance on NFS

2018-10-27 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > But as Junio notes the devil's in the details, another one I thought of > is: > > GIT_OBJECT_DIRECTORY=/some/other/repository git clone ... > > It seems to me that ... Actually I take all of that back ;-) For the purpose of this patch, use of existing .clon

Re: [PATCH/RFC] thread-utils: better wrapper to avoid #ifdef NO_PTHREADS

2018-10-27 Thread Duy Nguyen
On Fri, Oct 26, 2018 at 4:09 PM Ben Peart wrote: > I agree though I'm still curious if there are still no-threaded > platforms taking new versions of git. Perhaps we should do the > depreciation warning you suggested elsewhere and see how much push back > we get. It's unlikely we'd get lucky and

Re: [PATCH 00/10] Reduce #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:53AM +0200, Nguyễn Thái Ngọc Duy wrote: > People seemed to support the idea of removing these #ifdef NO_PTHREADS [1] > so this is a complete series. I left the #ifdef in run-command.c and > transport-helper.c because those code looked complicated so perhaps we > could

Re: [PATCH] Clear --exclude list after 'git rev-parse --all'

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 04:12:40PM +0900, Junio C Hamano wrote: > > Yeah, I agree that would be fine, too. I think there are two dimensions > > in which to look at the problem, like so: > > > > rev-list rev-parse > > - > > --globclearsclears > > --all

Re: [PATCH] Clear --exclude list after 'git rev-parse --all'

2018-10-27 Thread Junio C Hamano
Jeff King writes: >> I actually was hoping to see a test that contrasts "--all" (which >> lacks the alleged "clear exclude" bug) with another option that does >> have the "clear exclude", both used with rev-parse, i.e. >> >> $ git rev-parse --exclude='*' --glob='*' --glob='*' >> ... all

can we deprecate NO_PTHREADS?, was: better wrapper to avoid #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Fri, Oct 26, 2018 at 10:09:46AM -0400, Ben Peart wrote: > > Yeah, I don't think carrying around a handful of ints is going to be a > > big deal. > > Just to be complete, there _is_ an additional cost. Today, code paths that > are only executed when there are pthreads available are excluded fr

[PATCH 01/10] thread-utils: macros to unconditionally compile pthreads API

2018-10-27 Thread Nguyễn Thái Ngọc Duy
When built with NO_PTHREADS, the macros are used make the code build even though pthreads header and library may be missing. The code can still have different code paths for no threads support with HAVE_THREADS variable. There are of course impacts on no-pthreads builds: - data structure may get

[PATCH 02/10] index-pack: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/index-pack.c | 68 1 file changed, 18 insertions(+), 50 deletions(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 2004e25da2..bbd66ca025 100644 --- a/builtin/index-pack.c +++ b/builtin/

[PATCH 00/10] Reduce #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
People seemed to support the idea of removing these #ifdef NO_PTHREADS [1] so this is a complete series. I left the #ifdef in run-command.c and transport-helper.c because those code looked complicated so perhaps we could clean them up later. Even these updated files could be updated more, I think,

[PATCH 08/10] pack-objects: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-objects.c | 26 ++ pack-objects.h | 6 -- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index b059b86aee..12edd6da16 100644 --- a/builtin/pac

[PATCH 07/10] preload-index.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- preload-index.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/preload-index.c b/preload-index.c index 9e7152ab14..0e24886aca 100644 --- a/preload-index.c +++ b/preload-index.c @@ -7,17 +7,7 @@ #include "fsmonitor.h"

[PATCH 09/10] read-cache.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 49 ++--- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/read-cache.c b/read-cache.c index d57958233e..ba870bc3fd 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1920,19 +1920,15 @

[PATCH 10/10] Clean up pthread_create() error handling

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Normally pthread_create() rarely fails and sometimes error handling can be neglected. But with new pthreads wrapper, pthread_create() will return ENOSYS on a system without thread support. Threaded code _is_ protected by HAVE_THREADS and pthread_create() should never run in the first place. But th

[PATCH 05/10] send-pack.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
While at there correct "#include cache.h" position. It must be one of the first includes. Signed-off-by: Nguyễn Thái Ngọc Duy --- send-pack.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/send-pack.c b/send-pack.c index e920ca57df..fa7dc44b36 100644 --- a/send-pack.

[PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 58 +- grep.c | 6 -- grep.h | 6 -- 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index d8508ddf79..29221e1003 100

[PATCH 03/10] name-hash.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- name-hash.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/name-hash.c b/name-hash.c index 1fcda73cb3..b3c9ac791d 100644 --- a/name-hash.c +++ b/name-hash.c @@ -7,6 +7,7 @@ */ #define NO_THE_INDEX_COMPATIBILIT

[PATCH 04/10] attr.c: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/attr.c b/attr.c index 60d284796d..eaece6658d 100644 --- a/attr.c +++ b/attr.c @@ -41,23 +41,17 @@ const char *git_attr_name(const struct git_attr *attr) struct attr_hashmap {

Re: [PATCH] i18n: make GETTEXT_POISON a runtime option

2018-10-27 Thread Jeff King
On Fri, Oct 26, 2018 at 09:20:56PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> I was thinking: > >> > >> $ git var -e GIT_WHATEVER_ENV > >> > >> [-e for environment]. > >> > >> ... but that is really no different than git-config. ;-) > > > > Actually, "git var" already does pull bits from the env