Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 02:08:46PM -0400, Jeff Hostetler wrote: > > That's not the minimal change you were going for, but I think the end > > result is simpler and more consistent. > > OK, let me take a stab at something like that and > see where it takes me. Thanks. I set the patch as a lump,

Re: [PATCH] refs.h: rename submodule arguments to submodule_path

2017-04-20 Thread Stefan Beller
+ Junio On Wed, Apr 12, 2017 at 1:00 PM, Stefan Beller wrote: > In submodule land we carefully need to distinguish between the path of a > submodule and its name. > > The path of a submodule is the path that is recorded in the working tree > of the superproject and describes where the submodule i

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff Hostetler
On 4/20/2017 12:13 PM, Jeff King wrote: On Thu, Apr 20, 2017 at 10:00:04AM -0400, Jeff Hostetler wrote: Perhaps the thing to learn from this (and the other ones) is that we have lots of places where we are building a sorted list by iterating over a sorted list. The insert routines are genera

Re: [PATCH] git-p4: improve branch option handling

2017-04-20 Thread Luke Diamand
On 20 April 2017 at 14:52, Andrew Oakley wrote: > It is sometimes useful (much quicker) to request commands only operate > on a single branch. > > The P4Sync command has been updated to handle self.branch being None for > consitency with the P4Submit. Should that be consistency? > > The P4Rebas

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-20 Thread Ben Peart
On 4/11/2017 4:05 PM, Jeff King wrote: On Tue, Apr 11, 2017 at 10:01:02PM +0200, Lars Schneider wrote: If you initialize errno to 0 right before a syscall, then yes, you can trust it without checking the return value of the syscall. I wouldn't trust it before calling more complicated functions,

Re: [PATCH v5 4/8] convert: Separate generic structures and variables from the filter specific ones

2017-04-20 Thread Ben Peart
On 4/18/2017 9:23 PM, Junio C Hamano wrote: Ben Peart writes: On 4/16/2017 11:31 PM, Junio C Hamano wrote: Lars Schneider writes: However, I think it eases code maintainability in the long run if a function is "as pure as possible" (IOW does rely on global state as less as possible). If

Re: [PATCH v5 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Brandon, > > On Wed, 19 Apr 2017, Brandon Williams wrote: > > > On 04/19, Johannes Sixt wrote: > > > Am 19.04.2017 um 07:43 schrieb Johannes Sixt: > > > >Am 19.04.2017 um 01:17 schrieb Brandon Williams: > > > >>Add a test to 't0061-run-command.sh' to ensu

Re: [PATCH v6 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Brandon, > > On Wed, 19 Apr 2017, Brandon Williams wrote: > > > Add a test to 't0061-run-command.sh' to ensure that run_command can > > continue to execute scripts which don't include a '#!' line. > > > > Signed-off-by: Brandon Williams > > Please add

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Brandon Williams
On 04/20, Johannes Schindelin wrote: > Hi Lars & Junio, > > On Thu, 20 Apr 2017, Lars Schneider wrote: > > > > * bw/forking-and-threading (2017-04-19) 11 commits > > > - run-command: block signals between fork and execve > > > - run-command: add note about forking and threading > > > - run-comman

[PATCH] test-lib: abort when can't remove trash directory

2017-04-20 Thread SZEDER Gábor
We had two similar bugs in the tests sporadically triggering error messages during the removal of the trash directory, see commits bb05510e5 (t5510: run auto-gc in the foreground, 2016-05-01) and ef09036cf (t6500: wait for detached auto gc at the end of the test script, 2017-04-13). The test scrip

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 06:42:59PM +0200, SZEDER Gábor wrote: > > I suppose so. It might be worth being picky just on the principle that > > if it _is_ gone that's unexpected and we'd prefer somebody notice and > > figure out why. > > OK, agreed. > > However, we do need the above 'test -d' for t

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-20 Thread SZEDER Gábor
On Fri, Apr 14, 2017 at 10:08 PM, Jeff King wrote: > On Thu, Apr 13, 2017 at 09:35:08PM +0200, SZEDER Gábor wrote: > >> >> diff --git a/t/test-lib.sh b/t/test-lib.sh >> >> index 13b569682..d7fa15a69 100644 >> >> --- a/t/test-lib.sh >> >> +++ b/t/test-lib.sh >> >> @@ -763,7 +763,7 @@ test_done () {

Re: [PATCH v3 05/12] refs: move submodule slash stripping code to get_submodule_ref_store

2017-04-20 Thread Johannes Sixt
Am 20.04.2017 um 13:56 schrieb Duy Nguyen: On Thu, Apr 20, 2017 at 5:02 AM, Johannes Sixt wrote: What is the source of the value of 'submodule'? Is it an index entry? Or did it pass through parse_pathspec? In these cases it is correct to compare against literal '/'. Otherwise, is_dir_sep() is p

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 10:00:04AM -0400, Jeff Hostetler wrote: > Perhaps the thing to learn from this (and the other ones) is that > we have lots of places where we are building a sorted list by > iterating over a sorted list. The insert routines are general > purpose and cannot assume this, so

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 12:40:52PM +0200, Johannes Schindelin wrote: > > > Teach register_rename_src() to see if new file pair can simply be > > > appended to the rename_src[] array before performing the binary search > > > to find the proper insertion point. > > > > I guess your perf results sho

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Jeff King
On Thu, Apr 20, 2017 at 04:59:21PM +0700, Duy Nguyen wrote: > On Wed, Apr 19, 2017 at 10:37:21PM -0700, Junio C Hamano wrote: > > * nd/worktree-add-lock (2017-04-16) 2 commits > > - SQUASH??? > > - worktree add: add --lock option > > > > Allow to lock a worktree immediately after it's created.

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Lars Schneider
Sorry for sending this email multiple times. My mobile email client created html... Should be fixed now! > > * ls/filter-process-delayed (2017-03-06) 1 commit > - convert: add "status=delayed" to filter process protocol > > What's the status of this one??? > cf. posted v3 here: https://public

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Jeff Hostetler
On 4/18/2017 11:18 PM, Jeff King wrote: On Tue, Apr 18, 2017 at 10:56:08PM -0400, Jeff King wrote: When adding many things, we often just append and then sort at the end after we finished adding. I wonder if recent "check the last one and append" optimization beats that strategy. The big q

[PATCH] git-p4: improve branch option handling

2017-04-20 Thread Andrew Oakley
It is sometimes useful (much quicker) to request commands only operate on a single branch. The P4Sync command has been updated to handle self.branch being None for consitency with the P4Submit. The P4Rebase command has been given a branch option which is forwarded to the P4Sync command it runs.

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Johannes Schindelin
Hi Lars & Junio, On Thu, 20 Apr 2017, Lars Schneider wrote: > > * bw/forking-and-threading (2017-04-19) 11 commits > > - run-command: block signals between fork and execve > > - run-command: add note about forking and threading > > - run-command: handle dup2 and close errors in child > > - run-co

Re: [PATCH v3 05/12] refs: move submodule slash stripping code to get_submodule_ref_store

2017-04-20 Thread Duy Nguyen
On Thu, Apr 20, 2017 at 5:02 AM, Johannes Sixt wrote: > Am 19.04.2017 um 13:01 schrieb Nguyễn Thái Ngọc Duy: >> >> @@ -1558,7 +1543,17 @@ struct ref_store *get_submodule_ref_store(const >> char *submodule) >> { >> struct strbuf submodule_sb = STRBUF_INIT; >> struct ref_store *refs

[PATCH 13/15] xdiff-interface.c: report errno on failure to stat() or fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- xdiff-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdiff-interface.c b/xdiff-interface.c index 060038c2d6..d3f78ca2a7 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -164,9 +164,9 @@ int read_mmfile(mmfile_t

[PATCH 14/15] config.c: handle error on failing to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
In the first case, we already correctly return -1 if fopen() fails to open. But we should report something so people know what's wrong. In the second case, config_file == NULL does not necessarily mean "no config file". Bail out if needed. Signed-off-by: Nguyễn Thái Ngọc Duy --- config.c

[PATCH 15/15] t1308: add a test case on open a config directory

2017-04-20 Thread Nguyễn Thái Ngọc Duy
We don't support config-as-a-directory (maybe someday we will?). Make sure we consistently fail in this case, which should happen on platforms where fopen() returns non-NULL if FREAD_READS_DIRECTORIES is defined. Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1308-config-set.sh | 9 + 1 file

[PATCH 08/15] rerere.c: report error on failure to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- rerere.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rerere.c b/rerere.c index 3bd55caf3b..ef9b11578f 100644 --- a/rerere.c +++ b/rerere.c @@ -202,8 +202,11 @@ static void read_rr(struct string_list *rr) struct strbuf buf

[PATCH 07/15] remote.c: report error on failure to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
There's plenty of error() in this code to safely assume --quiet is not a concern. Signed-off-by: Nguyễn Thái Ngọc Duy --- remote.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/remote.c b/remote.c index 801137c72e..8ccc1e7b99 100644 --- a/remote.c +++ b/remote

[PATCH 12/15] wt-status.c: report error on failure to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- wt-status.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wt-status.c b/wt-status.c index 0375484962..5c12bb6ae3 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1067,6 +1067,8 @@ static char *read_line_from_git_path(const char *filename) stru

[PATCH 04/15] clone: use xfopen() instead of fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
This code uses the result FILE pointer right away without the NULL check. Let's use xfopen() and die if we could not open the file. That's still better than crashing, Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/built

[PATCH 11/15] server-info: report error on failure to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- server-info.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server-info.c b/server-info.c index 7bc4e75d22..7fc2a76966 100644 --- a/server-info.c +++ b/server-info.c @@ -132,8 +132,11 @@ static int read_pack_info_file(const char *i

[PATCH 10/15] sequencer.c: report error on failure to fopen()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sequencer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 77afecaebf..8d5ebfc14f 100644 --- a/sequencer.c +++ b/sequencer.c @@ -919,8 +919,11 @@ static void record_in_rewritten(struct object_id *oid,

[PATCH 09/15] rerere.c: report correct errno

2017-04-20 Thread Nguyễn Thái Ngọc Duy
In the first case, we should have reported the reason fopen() fails. In the second case, fclose() might change errno but we want to report fopen() failure. Signed-off-by: Nguyễn Thái Ngọc Duy --- rerere.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rerere.c b/rerere.

[PATCH 06/15] commit.c: report error on failure to fopen() the graft file

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Suppressing the error (because the command requires --quiet) is not a concern because we already call error() just a couple lines down. Signed-off-by: Nguyễn Thái Ngọc Duy --- commit.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 73c78c2b80..8

[PATCH 05/15] log: report errno on failure to fopen() a file

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index b3b10cc1ed..26d6a3cf14 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -858,7 +858,8 @@ static int open_next_file(struct commit *commit

[PATCH 01/15] config.mak.uname: set FREAD_READS_DIRECTORIES for Linux and FreeBSD

2017-04-20 Thread Nguyễn Thái Ngọc Duy
This variable is added [1] with the assumption that on a sane system, fopen(, "r") should return NULL. Linux and FreeBSD do not meet this expectation while at least Windows and AIX do. Let's make sure they behave the same way. I only tested one version on Linux (4.7.0 with glibc 2.22) and FreeBSD

[PATCH 02/15] bisect: report on fopen() error

2017-04-20 Thread Nguyễn Thái Ngọc Duy
The main thing to catch here is when fopen() is called on a directory. It's safe even without this change because a few lines earlier we do check if "filename" is a regular file. Regardless, let's stay on the safe side in case somebody changes those lines. Unconditionally printing to stderr by war

[PATCH 00/15] Handle fopen() errors

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Some of you may recall a while back, nd/conditional-config-include failed on Windows because I accidentally fopen()'d a directory in a test, but it's not considered an serious error unless it's on Windows, where fopen() returns NULL. A couple of suggestions were thrown back and forth, but I was a

[PATCH 03/15] blame: report error on open if graft_file is a directory

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/blame.c b/builtin/blame.c index 07506a3e45..70afa1b05c 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2073,8 +2073,11 @@ static int read_ancestry(const c

Re: [PATCH v6 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Johannes Schindelin
Hi Brandon, On Wed, 19 Apr 2017, Brandon Williams wrote: > Add a test to 't0061-run-command.sh' to ensure that run_command can > continue to execute scripts which don't include a '#!' line. > > Signed-off-by: Brandon Williams Please add something like this to the commit message lest future rea

Re: [PATCH v5 02/11] t0061: run_command executes scripts without a #! line

2017-04-20 Thread Johannes Schindelin
Hi Brandon, On Wed, 19 Apr 2017, Brandon Williams wrote: > On 04/19, Johannes Sixt wrote: > > Am 19.04.2017 um 07:43 schrieb Johannes Sixt: > > >Am 19.04.2017 um 01:17 schrieb Brandon Williams: > > >>Add a test to 't0061-run-command.sh' to ensure that run_command can > > >>continue to execute scr

Re: [PATCH v1] diffcore-rename: speed up register_rename_src

2017-04-20 Thread Johannes Schindelin
Hi Peff, On Tue, 18 Apr 2017, Jeff King wrote: > On Tue, Apr 18, 2017 at 07:44:21PM +, g...@jeffhostetler.com wrote: > > > From: Jeff Hostetler > > > > Teach register_rename_src() to see if new file pair can simply be > > appended to the rename_src[] array before performing the binary sear

[PATCH 4/6] worktree move: accept destination as directory

2017-04-20 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, 18 insertions(+), 1 d

[PATCH 6/6] worktree remove: new command

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 21 + builtin/worktree.c | 79 ++ contrib/completion/git-completion.bash | 5 ++- t/t2028-worktree-move.sh | 26 +++ 4 files changed,

[PATCH 3/6] worktree move: new command

2017-04-20 Thread Nguyễn Thái Ngọc Duy
There are two options to move the main worktree, but both have complications, so it's not implemented yet. Anyway the options are: - convert the main worktree to a linked one and move it away, leave the git repository where it is. The repo essentially becomes bare after this move. - move

[PATCH 1/6] worktree.c: add validate_worktree()

2017-04-20 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. For example, if a worktree is moved manually, the worktree location recorded in $GIT_DIR/worktrees/.../gitdir is incorrect and we should not move th

[PATCH 2/6] worktree.c: add update_worktree_location()

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 21 + worktree.h | 6 ++ 2 files changed, 27 insertions(+) diff --git a/worktree.c b/worktree.c index 40cc031ac9..c695dcf982 100644 --- a/worktree.c +++ b/worktree.c @@ -360,6 +360,27 @@ int validate_worktree(const str

[PATCH 0/6] nd/worktree-move update

2017-04-20 Thread Nguyễn Thái Ngọc Duy
This - squashes in Johannes' fix (that's already on jch/nd/worktree-move) - fixes the compile problem on latest master (because prefix_filename takes one argument less) - fixes the test failure because real_path() is called twice (the first one hidden in read_gitfile_gently) but the outpu

[PATCH 5/6] worktree move: refuse to move worktrees with submodules

2017-04-20 Thread Nguyễn Thái Ngọc Duy
Submodules contains .git files with relative paths. After a worktree move, these files need to be updated or they may point to nowhere. This is a bandage patch to make sure "worktree move" don't break people's worktrees by accident. When .git file update code is in place, this validate_no_submodul

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Duy Nguyen
On Wed, Apr 19, 2017 at 10:37:21PM -0700, Junio C Hamano wrote: > * nd/worktree-add-lock (2017-04-16) 2 commits > - SQUASH??? > - worktree add: add --lock option > > Allow to lock a worktree immediately after it's created. This helps > prevent a race between "git worktree add; git worktree loc

Re: [PATCH v10 4/5] dir_iterator: rewrite state machine model

2017-04-20 Thread Michael Haggerty
On 04/19/2017 03:14 PM, Daniel Ferreira wrote: > Perform a rewrite of dir_iterator_advance(). dir_iterator has > ceased to rely on a combination of level.initialized and level.dir_state > state variables and now only tracks the state with level.dir_state, > which simplifies the iterator mechanism,

Your In-Person Representation Needed (US/Canada)

2017-04-20 Thread Shougang Group
-- Shougang Group 45 Huagong Road Xinji City, Hebei Province China. webpage: www.shougang.com.cn This is an official request for Professional/consultants who will stand as our regional representative to run logistics on behalf of Shougang Group. We are only looking for individual or company fr

<    1   2