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

2014-03-18 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- 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 benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- t

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

2014-03-18 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c

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 gits...@pobox.com wrote: Benoit Pierre benoit.pie...@gmail.com 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 functionality does

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 gits...@pobox.com wrote: Benoit Pierre benoit.pie...@gmail.com writes: +test_expect_failure 'edit hunk commit -p -m message' ' + test_when_finished rm -f editor_was_started Not just when finished, run rm -f here to make sure that the file

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 sunsh...@sunshineco.com wrote: On Mon, Mar 17, 2014 at 3:46 PM, Benoit Pierre benoit.pie...@gmail.com wrote: On Mon, Mar 17, 2014 at 7:49 PM, Junio C Hamano gits...@pobox.com wrote: Benoit Pierre benoit.pie...@gmail.com writes: [...] diff

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 tbo...@web.de wrote: On 2014-03-11 22.03, Junio C Hamano wrote: Benoit Pierre benoit.pie...@gmail.com writes: Add (failing) test: with commit changing the environment to let hooks now that no editor will be used (by setting GIT_EDITOR

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

2014-03-15 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

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

2014-03-15 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- 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 benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- builtin/checkout.c | 8 builtin/clone.c | 4 ++-- builtin/commit.c| 35

[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 benoit.pie...@gmail.com --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c

[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 benoit.pie...@gmail.com --- t/t7505-prepare-commit-msg-hook.sh | 27

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 sand...@crustytoothpaste.net 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..3653bfa 100644 --- a/run

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 p...@peff.net 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. [...] This is a lot

[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 benoit.pie...@gmail.com --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c

[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

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

2014-03-10 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

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

2014-03-10 Thread Benoit Pierre
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 of '!' test patch hunk editing with commit -p -m commit: fix patch hunk editing with commit -p -m merge: fix GIT_EDITOR override for commit hook merge

[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 benoit.pie...@gmail.com --- 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 benoit.pie...@gmail.com --- t/t7513

[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 benoit.pie...@gmail.com --- builtin/checkout.c| 8 +++ builtin/clone.c | 4 ++-- builtin

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

2014-03-10 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- wt-status.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index

[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 NULL fmt

[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 benoit.pie...@gmail.com --- builtin/commit.c | 2 +- wt-status.c | 20 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git

[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 benoit.pie...@gmail.com --- t/t7513

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

2014-03-06 Thread Benoit Pierre
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 commit -p -m commit: fix patch hunk editing with commit -p -m merge: fix GIT_EDITOR override

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

2014-03-06 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- builtin/merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c

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

2014-03-06 Thread Benoit Pierre
Signed-off-by: Benoit Pierre benoit.pie...@gmail.com --- 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

[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 benoit.pie...@gmail.com --- 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 benoit.pie...@gmail.com --- builtin/commit.c | 35 --- builtin/merge.c