[PATCH v3 39/49] builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'applied_after_fixing_ws' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 12/49] builtin/apply: move 'check_index' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'check_index' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 25/49] builtin/apply: move 'line_termination' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'line_termination' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 08/49] builtin/apply: introduce 'struct apply_state' to start libifying

2016-05-24 Thread Christian Couder
d the call chain. To start let's move the "prefix" and "prefix_length" global variables into "struct apply_state". Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 94 +

[PATCH v3 32/49] builtin/apply: move 'p_value' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'p_value' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/a

[PATCH v3 41/49] builtin/apply: move 'ws_ignore_action' into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'ws_ignore_action' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 45/49] builtin/apply: move 'symlink_changes' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'symlink_changes' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 43/49] builtin/apply: move 'state_linenr' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'state_linenr' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 42/49] builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'max_change' and 'max_len' variables should not be static and global to the file. Let's move them into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 38/49] builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'squelch_whitespace_errors' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 44/49] builtin/apply: move 'fn_table' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
bel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 47 +-- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index dd56a8e..47622be 100644 --- a/builtin/apply.c +

[PATCH v3 15/49] builtin/apply: move 'apply_verbosely' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'apply_verbosely' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v3 07/49] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-05-24 Thread Christian Couder
The 'read_stdin' variable doesn't need to be static and global to the file. It can be local to cmd_apply(), so let's move it there. This will make it easier to libify the apply functionality. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxf

[PATCH v3 11/49] builtin/apply: move 'check' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'check' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 14 +++---

Re: [PATCH] t0008: 4 tests fail with ksh88

2016-05-20 Thread Christian Couder
On Fri, May 20, 2016 at 6:10 PM, Junio C Hamano wrote: > Junio C Hamano writes: > > From: Armin Kunaschik > Date: Fri, 20 May 2016 16:31:30 +0200 > Subject: [PATCH] t0008: 4 tests fail with ksh88 > > In t0008, we have > >

Re: [PATCH v2 4/4] bundle v3: the beginning

2016-05-20 Thread Christian Couder
I am responding to this 2+ month old email because I am investigating adding an alternate object store at the same level as loose and packed objects. This alternate object store could be used for large files. I am working on this for GitLab. (Yeah, I am working, as a freelance, for both

[PATCH v2 08/94] builtin/apply: introduce 'struct apply_state' to start libifying

2016-05-11 Thread Christian Couder
d the call chain. To start let's move the "prefix" and "prefix_length" global variables into "struct apply_state". Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 94 +

[PATCH v2 07/94] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-05-11 Thread Christian Couder
The 'read_stdin' variable doesn't need to be static and global to the file. It can be local to cmd_apply(), so let's move it there. This will make it easier to libify the apply functionality. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxf

[PATCH v2 03/94] builtin/apply: avoid parameter shadowing 'linenr' global

2016-05-11 Thread Christian Couder
.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index e133b38..705a9c8 100644 --- a/builtin/apply.c +++ b/builtin

[PATCH v2 04/94] builtin/apply: avoid local variable shadowing 'len' parameter

2016-05-11 Thread Christian Couder
This is just a cleanup to avoid errors when compiling with -Wshadow and to make it safer to later move global variables into a "state" struct. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> ---

[PATCH v2 00/94] libify apply and use lib in am

2016-05-11 Thread Christian Couder
sted rebasing 13 commits in Booking.com's monorepo on a Red Hat 6.5 server with split-index and GIT_TRACE_PERFORMANCE=1. With Git v2.8.0, the rebase took 6.375888383 s, with the git am command launched by the rebase command taking 3.705677431 s. With this series on top of next, the rebas

[PATCH v2 01/94] builtin/apply: make gitdiff_verify_name() return void

2016-05-11 Thread Christian Couder
-1 instead of die()ing in case of error. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin/apply.c b/bui

[PATCH v2 09/94] builtin/apply: move 'state' init into init_apply_state()

2016-05-11 Thread Christian Couder
viewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ae068e7..e133033 100644 --- a/bui

[PATCH v2 10/94] builtin/apply: move 'unidiff_zero' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'unidiff_zero' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 06/94] builtin/apply: move 'options' variable into cmd_apply()

2016-05-11 Thread Christian Couder
The 'options' variable doesn't need to be static and global to the file. It can be local to cmd_apply(), so let's move it there. This will make it easier to libify the apply functionality. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxf

[PATCH v2 05/94] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-05-11 Thread Christian Couder
The match_fragment() function is very big and contains a big special case algorithm that does line by line fuzzy matching. So let's extract this algorithm in a separate line_by_line_fuzzy_match() function. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder &

[PATCH v2 54/94] builtin/apply: make parse_chunk() return a negative integer on error

2016-05-11 Thread Christian Couder
happened, it is ok for parse_chunk() to do the same. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/builtin/apply

[PATCH v2 62/94] builtin/apply: move check_apply_state() to apply.c

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we must make check_apply_state() usable outside "builtin/apply.c". Let's do that by moving it into "apply.c". Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 29 + apply

[PATCH v2 42/94] builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'max_change' and 'max_len' variables should not be static and global to the file. Let's move them into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 32/94] builtin/apply: move 'p_value' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'p_value' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/a

[PATCH v2 50/94] builtin/apply: move 'newfd' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'newfd' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[PATCH v2 84/94] builtin/am: use apply api in run_apply()

2016-05-11 Thread Christian Couder
ot; with split index: 1m22.476s This series on top of "next" without split index: 1m12.034s This series on top of "next" with split index: 0m15.678s (using branch "next" from mid April 2016.) Benchmarked-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>

[PATCH v2 55/94] builtin/apply: make parse_single_patch() return -1 on error

2016-05-11 Thread Christian Couder
adjust the related test cases accordingly. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c| 17 + t/t4012-diff-binary.sh | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 2

[PATCH v2 45/94] builtin/apply: move 'symlink_changes' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'symlink_changes' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 81/94] run-command: make dup_devnull() non static

2016-05-11 Thread Christian Couder
We will need this function in a later commit to redirect stdout and stderr to /dev/null. Helped-by: Johannes Sixt <j...@kdbg.org> Helped-by: Johannes Schindelin <johannes.schinde...@gmx.de> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- run-command.c | 2 +-

[PATCH v2 59/94] builtin/apply: move init_apply_state() to apply.c

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we must make init_apply_state() usable outside "builtin/apply.c". Let's do that by moving it into a new "apply.c". Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> ---

[PATCH v2 63/94] builtin/apply: make apply_all_patches() return -1 on error

2016-05-11 Thread Christian Couder
com> Helped-by: Johannes Schindelin <johannes.schinde...@gmx.de> Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff

[PATCH v2 72/94] builtin/apply: make create_file() return -1 on error

2016-05-11 Thread Christian Couder
returning instead of calling exit(). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 0e20467..2b562db 100644 --- a/builtin/apply

[PATCH v2 57/94] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in builtin/apply.c, parse_whitespace_option() should return -1 using error() instead of calling die(). Signed-off-by: Christian

[PATCH v2 58/94] builtin/apply: make parse_ignorewhitespace_option() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 657e986..a7e 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -57,20 +57,

[PATCH v2 69/94] builtin/apply: make remove_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", remove_file() should return -1 using error() instead of calling die(). Signed-off-by: Christ

[PATCH v2 49/94] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
(), so that the caller can supply the same instance to different calls. And let's alloc an instance in init_apply_state(), if the caller doesn't want to supply one. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 64/94] builtin/apply: make parse_traditional_patch() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", parse_traditional_patch() should return -1 using error() instead of calling die(). Signed-off-by:

[PATCH v2 61/94] builtin/apply: make check_apply_state() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", check_apply_state() should return -1 using error() instead of calling die(). Signed-off-by: Christ

[PATCH v2 56/94] apply: move 'struct apply_state' to apply.h

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we must make 'struct apply_state' usable outside "builtin/apply.c". Let's do that by creating a new "apply.h" and moving 'struct apply_state' there. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org>

[PATCH v2 31/94] builtin/apply: move 'has_include' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'has_include' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 6 ++

[PATCH v2 26/94] builtin/apply: move 'fake_ancestor' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
: get rid of --index-info in favor of --build-fake-ancestor, Sep 17 2007). Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bui

[PATCH v2 44/94] builtin/apply: move 'fn_table' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'fn_table' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 48/94] builtin/apply: rename 'prefix_' parameter to 'prefix'

2016-05-11 Thread Christian Couder
This is just a small cleanup. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 67c64a5..2aea8ba 100644 --- a/builtin/apply.c +++ b/builtin/a

[PATCH v2 41/94] builtin/apply: move 'ws_ignore_action' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'ws_ignore_action' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 47/94] builtin/apply: move applying patches into apply_all_patches()

2016-05-11 Thread Christian Couder
To libify the apply functionality we should provide a function to apply many patches. Let's move the code to do that into a new apply_all_patches() function. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/a

[PATCH v2 15/94] builtin/apply: move 'apply_verbosely' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'apply_verbosely' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 25/94] builtin/apply: move 'line_termination' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'line_termination' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 17/94] builtin/apply: move 'allow_overlap' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'allow_overlap' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 11 ++

[PATCH v2 23/94] builtin/apply: move 'no_add' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'no_add' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 6 +++--- 1

[PATCH v2 18/94] builtin/apply: move 'cached' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'cached' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 30/94] builtin/apply: move 'limit_by_name' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'limit_by_name' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 35/94] builtin/apply: move 'whitespace_error' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'whitespace_error' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 24/94] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'unsafe_paths' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 8

[PATCH v2 33/94] builtin/apply: move 'p_value_known' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'p_value_known' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 -

[PATCH v2 46/94] builtin/apply: move 'state' check into check_apply_state()

2016-05-11 Thread Christian Couder
To libify the apply functionality we should provide a function to check that the values in a 'struct apply_state' instance are coherent. Let's move the code to do that into a new check_apply_state() function. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder &

[PATCH v2 34/94] builtin/apply: move 'root' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'root' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 39/94] builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'applied_after_fixing_ws' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 36/94] builtin/apply: move 'whitespace_option' into 'struct apply_state'

2016-05-11 Thread Christian Couder
This will enable further refactoring, and it is more coherent and simpler if all the option_parse_*() functions are passed a 'struct apply_state' instance in opt->value. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> ---

[PATCH v2 37/94] builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()

2016-05-11 Thread Christian Couder
A previous change has move the whitespace_option variable from cmd_apply into 'struct apply_state', so that we can now avoid passing it separately to set_default_whitespace_mode(). Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxf

[PATCH v2 12/94] builtin/apply: move 'check_index' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'check_index' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 38/94] builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'squelch_whitespace_errors' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 02/94] builtin/apply: avoid parameter shadowing 'p_value' global

2016-05-11 Thread Christian Couder
il.com> Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index fe5aebd..e133b

[PATCH v2 28/94] builtin/apply: move 'apply' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'apply' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 14/94] builtin/apply: move 'apply_with_reject' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'apply_with_reject' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 27/94] builtin/apply: move 'p_context' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'p_context' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 8

[PATCH v2 11/94] builtin/apply: move 'check' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'check' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 16 +---

[PATCH v2 21/94] builtin/apply: move 'summary' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'summary' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 +

[PATCH v2 88/94] apply: don't print on stdout when be_silent is set

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index 5459ee1..e0fdd1d 100644 --- a/apply.c +++ b/apply.c @@ -4669,13 +4669,13 @@ static int apply_patch(struct apply_state

[PATCH v2 68/94] builtin/apply: make build_fake_ancestor() return -1 on error

2016-05-11 Thread Christian Couder
c Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 06c1c16..a2cc099 100644

[PATCH v2 40/94] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'ws_error_action' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 62 +++---

[PATCH v2 29/94] builtin/apply: move 'patch_input_file' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'patch_input_file' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

[PATCH v2 60/94] apply: make init_apply_state() return -1 instead of exit()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of exit()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", init_apply_state() should return -1 using error() instead of calling exit(). Signed-off-by:

[PATCH v2 86/94] apply: add 'be_silent' variable to 'struct apply_state'

2016-05-11 Thread Christian Couder
This variable should prevent anything to be printed on both stderr and stdout. Let's not take care of stdout and apply_verbosely for now though, as that will be taken care of in following patches. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.

[PATCH v2 85/94] write_or_die: use warning() instead of fprintf(stderr, ...)

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- write_or_die.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/write_or_die.c b/write_or_die.c index 49e80aa..c29f677 100644 --- a/write_or_die.c +++ b/write_or_die.c @@ -87,8 +87,7 @@ int write_or_whin

[PATCH v2 92/94] am: use be_silent in 'struct apply_state' to shut up applying patches

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/am.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index cc66a48..c158c4d 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1526,7 +

[PATCH v2 66/94] builtin/apply: make gitdiff_*() return -1 on error

2016-05-11 Thread Christian Couder
...@gmail.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b3a9c2e..42b0a24 100644 --- a/builtin/apply.c

[PATCH v2 83/94] environment: add set_index_file()

2016-05-11 Thread Christian Couder
*/ ... /* When finished reset the index file */ set_index_file(old_index_file); Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- cache.h | 1 + environment.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/cache.h b/cache.h index 160f8e3..452d0ec

[PATCH v2 74/94] builtin/apply: make write_out_results() return -1 on error

2016-05-11 Thread Christian Couder
ine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index f06bf16..97bc704 100644 --- a/builtin/apply.c

[PATCH v2 67/94] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-05-11 Thread Christian Couder
that let's change its name to check_unsafe_path(). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 42b0a24..06c1c16 100644 --- a/builtin/apply

[PATCH v2 70/94] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-05-11 Thread Christian Couder
d-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 52f36c2..ca3502f 100644 --- a/builtin

[PATCH v2 91/94] apply: change error_routine when be_silent is set

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 29 + apply.h | 3 +++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/apply.c b/apply.c index e0fdd1d..1dafc82 100644 --- a/apply.c +++ b/apply.c @@ -100,6 +100,11

[PATCH v2 89/94] usage: add set_warn_routine()

2016-05-11 Thread Christian Couder
There are already set_die_routine() and set_error_routine(), so let's add set_warn_routine() as this will be needed in a following commit. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- git-compat-util.h | 1 + usage.c | 5 + 2 files changed, 6 insertions(+)

[PATCH v2 77/94] builtin/apply: rename option parsing functions

2016-05-11 Thread Christian Couder
As these functions are going to be part of the libified apply api, let's give them a name that is more specific to the apply api. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 40 1 file changed, 20 insertions(

[PATCH v2 82/94] apply: roll back index lock file in case of error

2016-05-11 Thread Christian Couder
Schindelin <johannes.schinde...@gmx.de> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apply.c b/apply.c index 3285bf7..7480ae8 100644 --- a/apply.c +++ b/apply.c @@ -47

[PATCH v2 71/94] builtin/apply: make add_index_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", add_index_file() should return -1 using error() instead of calling die(). Signed-off-by: Christ

[PATCH v2 94/94] builtin/apply: add a cli option for be_silent

2016-05-11 Thread Christian Couder
Let's make it possible to request a silent operation on the command line. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/apply.c b/builtin/apply.c index ce12769..397ef26 100644 --- a/builtin/a

[PATCH v2 73/94] builtin/apply: make write_out_one_result() return -1 on error

2016-05-11 Thread Christian Couder
ng instead of calling exit(). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 2b562db..f06bf16 100644 --- a/builtin/apply

[PATCH v2 75/94] builtin/apply: make try_create_file() return -1 on error

2016-05-11 Thread Christian Couder
returns -1 to signal a recoverable error. To fix that, let's make it return 1 in case of a recoverable error and -1 in case of an unrecoverable error. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> ---

[PATCH v2 78/94] apply: rename and move opt constants to apply.h

2016-05-11 Thread Christian Couder
The constants for the "inaccurate-eof" and the "recount" options will be used in both "apply.c" and "builtin/apply.c", so they need to go into "apply.h", and therefore they need a name that is more specific to the API they belong to. Signed

[PATCH v2 53/94] builtin/apply: make find_header() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
returns -1 when no header is found, so let's make it return -2 instead in this case. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 33 ++--- t/t4254-am-corrupt.sh | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-)

[PATCH v2 80/94] apply: make some parsing functions static again

2016-05-11 Thread Christian Couder
Some parsing functions that were used in both "apply.c" and "builtin/apply.c" are now only used in the former, so they can be made static to "apply.c". Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 6 +++--- apply.h | 5 -

[PATCH v2 52/94] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. Let's do that by using error() instead of die()ing in read_patch_file(). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 8 +--- 1 file changed, 5 insertions

[PATCH v2 51/94] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
. In a later patch, apply_all_patches() will return -1 too instead of exiting. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 54 +++--- 1 file changed, 39 inser

[PATCH v2 43/94] builtin/apply: move 'state_linenr' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'state_linenr' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/

<    10   11   12   13   14   15   16   17   18   19   >