[PATCH 1/6] test patch hunk editing with "commit -p -m"

2014-03-06 Thread Benoit Pierre
Add (failing) test: with commit changing the environment to let hooks now that no editor will be used (by setting GIT_EDITOR to ":"), the "edit hunk" functionality does not work (no editor is launched and the whole hunk is committed). Signed-off-by: Benoit Pierre ---

[PATCH 0/6] fix hunk editing with 'commit -p -m'

2014-03-06 Thread Benoit Pierre
lper (to set both GIT_EDITOR and GIT_INDEX_FILE) N.B.: the merge builtin 'prepare-commit-msg' hook handling has also been updated to be consistent; i.e. GIT_EDITOR will not be set to ':' if the '--edit' option is used. Benoit Pierre (6): test patch hunk editing with "

[PATCH 5/6] merge hook tests: fix missing '&&' in test

2014-03-06 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index ae7b2db..604c06e 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505

[PATCH 3/6] merge: fix GIT_EDITOR override for commit hook

2014-03-06 Thread Benoit Pierre
Don't set GIT_EDITOR to ":" when calling prepare-commit-msg hook if the editor is going to be called (e.g. with "merge -e"). Signed-off-by: Benoit Pierre --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/buil

[PATCH 6/6] merge hook tests: use 'test_must_fail' instead of '!'

2014-03-06 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 604c06e..1be6cec 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t

[PATCH 4/6] merge hook tests: fix and update tests

2014-03-06 Thread Benoit Pierre
- update 'no editor' hook test and add 'editor' hook test - reset tree at the beginning of failing hook tests to avoid failures due to an unclean tree after running a previous test Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 17 -

[PATCH 2/6] commit: fix patch hunk editing with "commit -p -m"

2014-03-06 Thread Benoit Pierre
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre --- builtin/commit.c | 35 --- builtin/merge.c

[PATCH 5/7] merge: fix GIT_EDITOR override for commit hook

2014-03-10 Thread Benoit Pierre
Don't set GIT_EDITOR to ":" when calling prepare-commit-msg hook if the editor is going to be called (e.g. with "merge -e"). Signed-off-by: Benoit Pierre --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/buil

[PATCH 7/7] run-command: mark run_hook_with_custom_index as deprecated

2014-03-10 Thread Benoit Pierre
--- run-command.h | 1 + 1 file changed, 1 insertion(+) diff --git a/run-command.h b/run-command.h index 88460f9..3653bfa 100644 --- a/run-command.h +++ b/run-command.h @@ -51,6 +51,7 @@ extern int run_hook_le(const char *const *env, const char *name, ...); extern int run_hook_ve(const char *co

[PATCH 2/7] merge hook tests: use 'test_must_fail' instead of '!'

2014-03-10 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 1c95652..5531abb 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t

[PATCH V2 0/7] fix hunk editing with 'commit -p -m'

2014-03-10 Thread Benoit Pierre
#x27; hook handling has also been updated to be consistent; i.e. GIT_EDITOR will not be set to ':' if the '--edit' option is used. Benoit Pierre (7): merge hook tests: fix missing '&&' in test merge hook tests: use 'test_must_fail' instead o

[PATCH 6/7] merge hook tests: fix and update tests

2014-03-10 Thread Benoit Pierre
- update 'no editor' hook test and add 'editor' hook test - make sure the tree is reset to a clean state after running a test (using test_when_finished) so later tests are not impacted Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 27 +++

[PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-10 Thread Benoit Pierre
Add (failing) test: with commit changing the environment to let hooks now that no editor will be used (by setting GIT_EDITOR to ":"), the "edit hunk" functionality does not work (no editor is launched and the whole hunk is committed). Signed-off-by: Benoit Pierre ---

[PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"

2014-03-10 Thread Benoit Pierre
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre --- builtin/checkout.c| 8 +++ builtin/clone.c | 4 ++

[PATCH 1/7] merge hook tests: fix missing '&&' in test

2014-03-10 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 3573751..1c95652 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505

[PATCH 1/2] status: allow NULL fmt for status_printf/status_vprintf_ln

2014-03-10 Thread Benoit Pierre
Useful for calling status_printf only to change/reset the color (and output an additional '\n' with status_vprintf_ln). Signed-off-by: Benoit Pierre --- wt-status.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index 4e55810..17f6

[PATCH 0/2] fix status_printf_ln calls "zero-length format" warnings

2014-03-10 Thread Benoit Pierre
Those happens with "gcc -Wformat-zero-length". Since passing NULL does not generate a warning (as __attribute__((printf())) does not imply nonull), modify status_printf/status_printf_ln to allow a NULL format and update calls with an empty string. Benoit Pierre (2): status: allow NU

[PATCH 2/2] fix status_printf_ln calls "zero-length format" warnings

2014-03-10 Thread Benoit Pierre
Those happens with "gcc -Wformat-zero-length". Change empty strings to NULL now that it's allowed. Signed-off-by: Benoit Pierre --- builtin/commit.c | 2 +- wt-status.c | 20 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/builtin/com

Re: [PATCH 7/7] run-command: mark run_hook_with_custom_index as deprecated

2014-03-11 Thread Benoit Pierre
On Tue, Mar 11, 2014 at 2:00 AM, brian m. carlson wrote: > On Mon, Mar 10, 2014 at 07:49:37PM +0100, Benoit Pierre wrote: >> --- >> run-command.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/run-command.h b/run-command.h >> index 88460f9

Re: [PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"

2014-03-11 Thread Benoit Pierre
On Mon, Mar 10, 2014 at 9:07 PM, Jeff King wrote: > On Mon, Mar 10, 2014 at 07:49:34PM +0100, Benoit Pierre wrote: > >> Don't change git environment: move the GIT_EDITOR=":" override to the >> hook command subprocess, like it's already done for GIT_INDEX_FILE

Re: [PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-15 Thread Benoit Pierre
On Sat, Mar 15, 2014 at 1:28 PM, Torsten Bögershausen wrote: > On 2014-03-11 22.03, Junio C Hamano wrote: >> Benoit Pierre writes: >> >>> Add (failing) test: with commit changing the environment to let hooks >>> now that no editor will be used (by setting GIT_E

[PATCH 1/7] merge hook tests: fix missing '&&' in test

2014-03-15 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 3573751..1c95652 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505

[PATCH 2/7] merge hook tests: use 'test_must_fail' instead of '!'

2014-03-15 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 1c95652..5531abb 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t

[PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-15 Thread Benoit Pierre
Add (failing) tests: with commit changing the environment to let hooks know that no editor will be used (by setting GIT_EDITOR to ":"), the "edit hunk" functionality does not work (no editor is launched and the whole hunk is committed). Signed-off-by: Benoit Pierre --- t/t

[PATCH 7/7] run-command: mark run_hook_with_custom_index as deprecated

2014-03-15 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- run-command.h | 1 + 1 file changed, 1 insertion(+) diff --git a/run-command.h b/run-command.h index 88460f9..3653bfa 100644 --- a/run-command.h +++ b/run-command.h @@ -51,6 +51,7 @@ extern int run_hook_le(const char *const *env, const char *name, ...); extern

[PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"

2014-03-15 Thread Benoit Pierre
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre --- builtin/checkout.c | 8 builtin/clone.c | 4 ++-- builtin/

[PATCH 5/7] merge: fix GIT_EDITOR override for commit hook

2014-03-15 Thread Benoit Pierre
Don't set GIT_EDITOR to ":" when calling prepare-commit-msg hook if the editor is going to be called (e.g. with "merge -e"). Signed-off-by: Benoit Pierre --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/buil

[PATCH 6/7] merge hook tests: fix and update tests

2014-03-15 Thread Benoit Pierre
- update 'no editor' hook test and add 'editor' hook test - make sure the tree is reset to a clean state after running a test (using test_when_finished) so later tests are not impacted Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 27 +++

Re: [PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-17 Thread Benoit Pierre
On Mon, Mar 17, 2014 at 7:49 PM, Junio C Hamano wrote: > Benoit Pierre writes: > >> Add (failing) tests: with commit changing the environment to let hooks >> know that no editor will be used (by setting GIT_EDITOR to ":"), the >> "edit hunk" functional

Re: [PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-17 Thread Benoit Pierre
On Mon, Mar 17, 2014 at 7:53 PM, Junio C Hamano wrote: > Benoit Pierre writes: > >> +test_expect_failure 'edit hunk "commit -p -m message"' ' >> + test_when_finished "rm -f editor_was_started" && > > Not just "when

Re: [PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-17 Thread Benoit Pierre
On Mon, Mar 17, 2014 at 8:51 PM, Eric Sunshine wrote: > On Mon, Mar 17, 2014 at 3:46 PM, Benoit Pierre > wrote: >> On Mon, Mar 17, 2014 at 7:49 PM, Junio C Hamano wrote: >>> Benoit Pierre writes: >>> >>>> [...] >>>> >>>&

[PATCH 7/7] run-command: mark run_hook_with_custom_index as deprecated

2014-03-18 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- run-command.h | 1 + 1 file changed, 1 insertion(+) diff --git a/run-command.h b/run-command.h index 88460f9..3653bfa 100644 --- a/run-command.h +++ b/run-command.h @@ -51,6 +51,7 @@ extern int run_hook_le(const char *const *env, const char *name, ...); extern

[PATCH 4/7] commit: fix patch hunk editing with "commit -p -m"

2014-03-18 Thread Benoit Pierre
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre --- builtin/checkout.c | 8 builtin/clone.c | 4 ++-- builtin/

[PATCH 6/7] merge hook tests: fix and update tests

2014-03-18 Thread Benoit Pierre
- update 'no editor' hook test and add 'editor' hook test - make sure the tree is reset to a clean state after running a test (using test_when_finished) so later tests are not impacted Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 27 +++

[PATCH 2/7] merge hook tests: use 'test_must_fail' instead of '!'

2014-03-18 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 1c95652..5531abb 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t

[PATCH 3/7] test patch hunk editing with "commit -p -m"

2014-03-18 Thread Benoit Pierre
Add (failing) tests: with commit changing the environment to let hooks know that no editor will be used (by setting GIT_EDITOR to ":"), the "edit hunk" functionality does not work (no editor is launched and the whole hunk is committed). Signed-off-by: Benoit Pierre --- t/t

[PATCH 1/7] merge hook tests: fix missing '&&' in test

2014-03-18 Thread Benoit Pierre
Signed-off-by: Benoit Pierre --- t/t7505-prepare-commit-msg-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 3573751..1c95652 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505

[PATCH 5/7] merge: fix GIT_EDITOR override for commit hook

2014-03-18 Thread Benoit Pierre
Don't set GIT_EDITOR to ":" when calling prepare-commit-msg hook if the editor is going to be called (e.g. with "merge -e"). Signed-off-by: Benoit Pierre --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/buil