[PATCH 45/83] builtin/apply: move 'state' init into init_apply_state()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8508607..f2dffa9 100644 --- a/builtin/apply.c +++ b/builtin/a

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

2016-04-24 Thread Christian Couder
This negative number can be -2 if no patch header has been found, otherwise it is -1. As parse_chunk() is called only by apply_patch() which already returns -1 when an error happened, let's make it return -1 when parse_chunk() returns -1. Signed-off-by: Christian Couder <chrisc...@tuxfamily.

[PATCH 44/83] builtin/apply: move 'symlink_changes' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 50 -- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b4c2bd8..8508607 100644 --- a/builtin/apply.c

[PATCH 43/83] builtin/apply: move 'fn_table' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index f387340..b4c2bd8 100644 --- a/builtin/apply.c +++ b/b

[PATCH 29/83] builtin/apply: move 'limit_by_name' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
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 ab311c1..c8b9bf0 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -68,6

[PATCH 27/83] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/apply.c b/builtin/apply.c index 699cabf..be237d1 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -96,7 +96,6 @@ static enum ws_

[PATCH 74/83] builtin/apply: make try_create_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 49ef4c9..32c38f0 100644 --- a/builtin/apply.c +++ b/builtin/a

[PATCH 40/83] builtin/apply: move 'ws_ignore_action' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 7d91454..fa07b33 100644 --- a/builtin/apply.c +++ b/builtin/a

[PATCH 42/83] builtin/apply: move 'linenr' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 75 ++--- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index bb58174..f387340 100644 --- a/builtin/apply.c

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.h | 124 builtin/apply.c | 121 +- 2 files changed, 125 insertions(+), 120 deletions(-) create mode

[PATCH 75/83] builtin/apply: make create_one_file() return -1 on error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 32c38f0..5bd5154 100644 --- a/builtin/apply.c +++ b/builtin/a

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index eab5ae1..73247c7 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -

[PATCH 38/83] builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 259f256..52602af 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -79,6 +79,7 @@

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 787426f..6c0b153 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4670,10 +4670,10 @@ stat

[PATCH 35/83] builtin/apply: move 'whitespace_option' into 'struct apply_state'

2016-04-24 Thread Christian Couder
This will enable further refactoring. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 9c4f67f..64bc3e9 100644 --- a/builtin/apply.c

[PATCH 17/83] builtin/apply: move 'diffstat' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
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 ba828df..d90948a 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -33,6 +33,9 @@

[PATCH 19/83] builtin/apply: move 'summary' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 16d78f9..e488879 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -39,6 +39,8 @@

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

2016-04-24 Thread Christian Couder
Let's just rename the global 'state_p_value' as it will become 'state->p_value' in a following patch. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git

[PATCH 39/83] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 62 +++-- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 52602af..7d91454 100644 --- a/builtin/apply.c

[PATCH 33/83] builtin/apply: move 'root' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 82 ++--- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index fecdb66..209a1b4 100644 --- a/builtin/apply.c

[PATCH 36/83] builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 64bc3e9..401e111 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -147,10 +147,9 @@ stati

[PATCH 32/83] builtin/apply: move 'p_value_known' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 979849c..fecdb66 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -66,6 +66,7 @@

[PATCH 08/83] builtin/apply: move 'unidiff_zero' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 42 -- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 51e6af4..ad81210 100644 --- a/builtin/apply.c +++ b/b

[PATCH 10/83] builtin/apply: move 'check_index' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 69 + 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 6c628f6..3f8671c 100644 --- a/builtin/apply.c

[PATCH 13/83] builtin/apply: move 'apply_verbosely' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
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/builtin/apply.c index 67560e4..154679e 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -27,6

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/apply.c b/builtin/apply.c index 02239d9..8fd8dbc 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -79,7 +79,6 @@ static enum ws_

[PATCH 21/83] builtin/apply: move 'no-add' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 33a1f8f..506357c 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -43,6 +43,8 @@ struct apply

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

2016-04-24 Thread Christian Couder
p of next, the rebase took 3.044529494 s, with the git am command launched by the rebase command taking 0.583521168 s. No tests on Windows have been performed, but it could be interesting to test on this platform. Christian Couder (83): builtin/apply: make gitdiff_verify_name() return void builtin/a

[PATCH 25/83] builtin/apply: move 'p_context' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index f69f982..b6d2343 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -63,6 +63,8 @@

[PATCH 24/83] builtin/apply: move 'fake_ancestor' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
By the way remove a comment about '--index-info' that was renamed '--build-fake-ancestor' in commit 26b28007689d27a921ea90e5a29fc8eb74b0d297 (apply: get rid of --index-info in favor of --build-fake-ancestor, Sep 17 2007). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- b

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

2016-04-24 Thread Christian Couder
As the value returned by gitdiff_verify_name() is put into the same variable that is passed as a parameter to this function, it is simpler to pass the address of the variable and have gitdiff_verify_name() change the variable itself. Signed-off-by: Christian Couder <chrisc...@tuxfamily.

[PATCH 12/83] builtin/apply: move 'apply_with_reject' global into 'struct apply_state'

2016-04-24 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 755e0e3..67560e4 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -26,6 +26,7 @@

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

2016-04-24 Thread Christian Couder
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 e133b38..7115dc2 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -1516,7 +1516,7 @@ stat

[PATCH 28/83] builtin/apply: move 'patch_input_file' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index be237d1..ab311c1 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 37/83] builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 401e111..259f256 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -78,6

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Christian Couder
On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones <ram...@ramsayjones.plus.com> wrote: > > > On 24/04/16 14:33, Christian Couder wrote: >> This is a patch series about libifying `git apply` functionality, and >> using this libified functionality in `git am`, so that no 'git

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-24 Thread Christian Couder
On Sun, Apr 24, 2016 at 6:27 PM, Christian Couder <christian.cou...@gmail.com> wrote: > On Sun, Apr 24, 2016 at 5:23 PM, Ramsay Jones > <ram...@ramsayjones.plus.com> wrote: >> >> >> On 24/04/16 14:33, Christian Couder wrote: >>> This is a patch ser

Re: [PATCH 03/83] builtin/apply: avoid parameter shadowing 'linenr' global

2016-04-27 Thread Christian Couder
On Wed, Apr 27, 2016 at 6:27 PM, Junio C Hamano wrote: > > I think 02/83 that renamed the global-to-be-moved-to-state to > state_p_value was brilliant, and this should follow suit; you would > be moving linenr into the state eventually in later steps, right? Yeah, ok, I will

Re: [PATCH] trailer: load config to handle core.commentChar

2016-04-27 Thread Christian Couder
_char_line", but otherwise you can add "Reviewed-by: Christian Couder <chrisc...@tuxfamily.org>". Thanks! > Signed-off-by: Rafal Klys <rafalk...@wp.pl> > --- > trailer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/trailer.c b/tr

Re: [PATCH 47/83] builtin/apply: move applying patches into apply_all_patches()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 12:00 AM, Stefan Beller <sbel...@google.com> wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> > > Up to this patch, have

Re: [PATCH 18/83] builtin/apply: move 'numstat' global into 'struct apply_state'

2016-04-26 Thread Christian Couder
On Mon, Apr 25, 2016 at 11:40 PM, Stefan Beller <sbel...@google.com> wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> builtin/appl

Re: [PATCH 45/83] builtin/apply: move 'state' init into init_apply_state()

2016-04-27 Thread Christian Couder
On Mon, Apr 25, 2016 at 9:32 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sun, Apr 24, 2016 at 9:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> diff

Re: [PATCH 05/83] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:20 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >>> It's not clear why we need to declare buf here? Oh wait it is. It's just >>> moved from the start of the function. But w

Re: [PATCH 27/83] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:28 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> builtin/apply.c | 2 +- >> 1 file change

Re: [PATCH 39/83] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:36 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> +enum ws_error_action { >> + nowarn_ws_error, >> + warn_on_ws_error, >> + die_on_ws_error, >&g

Re: [PATCH 22/83] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:27 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> builtin/apply.c | 9 + >> 1 file cha

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-25 Thread Christian Couder
On Mon, Apr 25, 2016 at 11:02 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Sun, Apr 24, 2016 at 8:33 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Sorry if this patch series is a bit long. I can split it into two or >> more series if it is prefered.

Re: [PATCH 00/83] libify apply and use lib in am

2016-04-25 Thread Christian Couder
On Mon, Apr 25, 2016 at 2:14 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Mon, Apr 25, 2016 at 12:42 AM, Ramsay Jones > <ram...@ramsayjones.plus.com> wrote: >> >> >> On 24/04/16 17:56, Christian Couder wrote: >>> On Sun, Apr 24, 2016 at 6:27 PM, Chr

Re: [PATCH 49/83] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-04-30 Thread Christian Couder
On Mon, Apr 25, 2016 at 9:50 AM, Eric Sunshine wrote: >> @@ -4515,8 +4521,6 @@ static int write_out_results(struct apply_state >> *state, struct patch *list) >> return errs; >> } >> >> -static struct lock_file lock_file; > > Does the static lock_file in

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

2016-04-30 Thread Christian Couder
On Tue, Apr 26, 2016 at 3:20 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sun, Apr 24, 2016 at 9:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> To libify `git apply` functionality we have to signal errors >> to the caller instead of d

Re: [PATCH v2] trailer: load config to handle core.commentChar

2016-04-28 Thread Christian Couder
On Thu, Apr 28, 2016 at 10:00 PM, Rafal Klys wrote: > Fall throught git_default_config when reading config to update the > comment_line_char from default '#' to possible different value set in > core.commentChar. > > Signed-off-by: Rafal Klys > --- > > Added

Re: [PATCH 49/83] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-04-28 Thread Christian Couder
On Mon, Apr 25, 2016 at 7:55 PM, Junio C Hamano wrote: > Eric Sunshine writes: > >>> + /* >>> +* Since lockfile.c keeps a linked list of all created >>> +* lock_file structures, it isn't safe to free(lock_file). >>> +*/

Re: RFC: Supporting .git/hooks/$NAME.d/* && /etc/git/hooks/$NAME.d/*

2016-04-26 Thread Christian Couder
On Tue, Apr 26, 2016 at 6:09 PM, Ævar Arnfjörð Bjarmason wrote: > On Tue, Apr 26, 2016 at 3:40 PM, Marc Branchaud wrote: >> On 2016-04-26 06:58 AM, Ævar Arnfjörð Bjarmason wrote: >>> >>> Makes sense to have an experimental.* config tree for git for stuff

Re: [PATCH 09/83] builtin/apply: move 'check' global into 'struct apply_state'

2016-04-26 Thread Christian Couder
On Mon, Apr 25, 2016 at 8:57 PM, Stefan Beller <sbel...@google.com> wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> builtin/apply.c |

Re: [PATCH 05/83] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-04-26 Thread Christian Couder
On Mon, Apr 25, 2016 at 8:50 PM, Stefan Beller wrote: >> @@ -2251,7 +2319,7 @@ static int match_fragment(struct image *img, >> int match_beginning, int match_end) >> { >> int i; >> - char *fixed_buf, *buf, *orig, *target; >> +

Re: [PATCH 33/83] builtin/apply: move 'root' global into 'struct apply_state'

2016-04-26 Thread Christian Couder
On Mon, Apr 25, 2016 at 11:50 PM, Stefan Beller <sbel...@google.com> wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > <christian.cou...@gmail.com> wrote: > >> @@ -4630,9 +4644,10 @@ static int option_parse_whitespace(const struct >> option *opt, >

Re: Git reset --hard with staged changes

2016-05-23 Thread Christian Couder
On Mon, May 23, 2016 at 2:55 AM, Yotam Gingold wrote: > Pierre-François CLEMENT gmail.com> writes: >> 2014-06-10 17:27 GMT+02:00 David Kastrup gnu.org>: >>> Pierre-François CLEMENT gmail.com> writes: >>> ... Hm I see. Even though the documentation doesn't

Re: [PATCH v6 3/3] bisect--helper: `write_terms` shell function in C

2016-05-23 Thread Christian Couder
On Mon, May 23, 2016 at 1:07 PM, Johannes Schindelin wrote: > > On Fri, 20 May 2016, Pranit Bauva wrote: > >> Frankly, I have no idea what you mean by libification but I will use >> error() since efforts for libification have already started. > > The term

Re: [PATCH v1 3/3] travis-ci: run Git bisect on failed tests

2016-05-22 Thread Christian Couder
On Sun, May 22, 2016 at 1:00 PM, wrote: [...] > +# > +# Run Git bisect > +# > +run_bisect () { > + TEST_SCRIPT=$1 > + BAD_REV=$2 > + GOOD_RV=$3 > + TMPDIR=$(mktemp -d -t "ci-report-bisect-XX" 2>/dev/null) > + cat >

[PATCH v3 00/49] libify apply and use lib in am, part 1

2016-05-24 Thread Christian Couder
ebase command taking 3.705677431 s. With this series on top of next, the rebase took 3.044529494 s, with the git am command launched by the rebase command taking 0.583521168 s. Christian Couder (49): builtin/apply: make gitdiff_verify_name() return void builtin/apply: avoid parameter shadowing

[PATCH v3 02/49] builtin/apply: avoid parameter shadowing 'p_value' global

2016-05-24 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 v3 01/49] builtin/apply: make gitdiff_verify_name() return void

2016-05-24 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

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

2016-05-24 Thread Christian Couder
On Sat, May 14, 2016 at 8:27 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> On Thu, May 12, 2016 at 10:43 PM, Junio C Hamano <gits...@pobox.com> wrote: >>> Junio C Hamano <gits...@po

Re: [PATCH v3 00/49] libify apply and use lib in am, part 1

2016-05-24 Thread Christian Couder
On Tue, May 24, 2016 at 10:10 AM, Christian Couder <christian.cou...@gmail.com> wrote: > > I will send a diff between this version and the 50 first patches of v2 > soon as a reply to this email. Here is the diff: diff --git a/builtin/apply.c b/builtin/apply.c index ec55768.

[PATCH v3 31/49] builtin/apply: move 'has_include' global into 'struct apply_state'

2016-05-24 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 v3 46/49] builtin/apply: move 'state' check into check_apply_state()

2016-05-24 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 v3 29/49] builtin/apply: move 'patch_input_file' global into 'struct apply_state'

2016-05-24 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 v3 22/49] builtin/apply: move 'threeway' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'threeway' 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 +

[PATCH v3 34/49] builtin/apply: move 'root' global into 'struct apply_state'

2016-05-24 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 v3 36/49] builtin/apply: move 'whitespace_option' into 'struct apply_state'

2016-05-24 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 v3 24/49] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-05-24 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 v3 20/49] builtin/apply: move 'numstat' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'numstat' 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 v3 19/49] builtin/apply: move 'diffstat' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'diffstat' 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 v3 28/49] builtin/apply: move 'apply' global into 'struct apply_state'

2016-05-24 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 v3 26/49] builtin/apply: move 'fake_ancestor' global into 'struct apply_state'

2016-05-24 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 v3 18/49] builtin/apply: move 'cached' global into 'struct apply_state'

2016-05-24 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 v3 17/49] builtin/apply: move 'allow_overlap' global into 'struct apply_state'

2016-05-24 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 v3 21/49] builtin/apply: move 'summary' global into 'struct apply_state'

2016-05-24 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 | 8

[PATCH v3 30/49] builtin/apply: move 'limit_by_name' global into 'struct apply_state'

2016-05-24 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 v3 27/49] builtin/apply: move 'p_context' global into 'struct apply_state'

2016-05-24 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 | 7 +++

[PATCH v3 10/49] builtin/apply: move 'unidiff_zero' global into 'struct apply_state'

2016-05-24 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 v3 23/49] builtin/apply: move 'no_add' global into 'struct apply_state'

2016-05-24 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 v3 35/49] builtin/apply: move 'whitespace_error' global into 'struct apply_state'

2016-05-24 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 v3 09/49] builtin/apply: move 'state' init into init_apply_state()

2016-05-24 Thread Christian Couder
com> Reviewed-by: Stefan Beller <sbel...@google.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ae068

[PATCH v3 05/49] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-05-24 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 &

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

2016-05-24 Thread Christian Couder
On Fri, May 13, 2016 at 9:42 PM, Christian Couder <christian.cou...@gmail.com> wrote: > On Thu, May 12, 2016 at 9:56 PM, Junio C Hamano <gits...@pobox.com> wrote: >> Christian Couder <christian.cou...@gmail.com> writes: >> >>> This is just a small cle

[PATCH v3 03/49] builtin/apply: avoid parameter shadowing 'linenr' global

2016-05-24 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 v3 04/49] builtin/apply: avoid local variable shadowing 'len' parameter

2016-05-24 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> ---

Re: [PATCH v8 3/3] bisect--helper: `write_terms` shell function in C

2016-05-24 Thread Christian Couder
hell > function to C so as to use the existing test suite. As more functions > are ported, this subcommand will be retired and will be called by some > other method. > > Mentored-by: Lars Schneider <larsxschnei...@gmail.com> > Mentored-by: Christian Couder <chrisc...@tuxfamil

Re: Git reset --hard with staged changes

2016-05-24 Thread Christian Couder
On Mon, May 23, 2016 at 11:16 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >>> This should be clarified to define what a tracked file is. I propose >>> appending: >>> >>> A fil

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

2016-05-24 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 v3 14/49] builtin/apply: move 'apply_with_reject' global into 'struct apply_state'

2016-05-24 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 v3 16/49] builtin/apply: move 'update_index' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'update_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 48/49] builtin/apply: move 'lock_file' global into 'struct apply_state'

2016-05-24 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 v3 40/49] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-05-24 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 | 61 +++---

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

2016-05-24 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 v3 47/49] builtin/apply: move applying patches into apply_all_patches()

2016-05-24 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 v3 33/49] builtin/apply: move 'p_value_known' global into 'struct apply_state'

2016-05-24 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 v3 13/49] builtin/apply: move 'apply_in_reverse' global into 'struct apply_state'

2016-05-24 Thread Christian Couder
To libify the apply functionality the 'apply_in_reverse' 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 37/49] builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()

2016-05-24 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

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