Re: [RFC/PATCH 01/48] builtin/apply: avoid parameter shadowing 'p_value' global

2016-03-10 Thread Christian Couder
On Thu, Mar 10, 2016 at 1:54 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Thu, Mar 10, 2016 at 6:27 AM, Junio C Hamano <gits...@pobox.com> wrote: >> Christian Couder <christian.cou...@gmail.com> writes: >> >>> Signed-off-by: Christian Couder <chrisc..

Re: [RFC/PATCH 00/48] Libifying git apply

2016-03-11 Thread Christian Couder
On Wed, Mar 9, 2016 at 7:14 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> One point I'd especially welcome feedback about is the fact that there >> are many boolean options that are using OPT_BO

Re: [PATCH] builtin/apply: exit when parse_binary() fails

2016-03-19 Thread Christian Couder
On Wed, Mar 16, 2016 at 8:44 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> In parse_binary() there is: >> >> forward = parse_binary_hunk(, , , ); >> if (!forward && !st

Re: [PATCH v2] builtin/apply: exit when parse_binary() fails

2016-03-19 Thread Christian Couder
On Thu, Mar 17, 2016 at 10:23 AM, Christian Couder <christian.cou...@gmail.com> wrote: > In parse_binary() there is: ... Of course just after sending this I realized that I should probably change the title of the patch to something like "builtin/apply: handle parse_binary(

Re: [RFC/PATCH 00/48] Libifying git apply

2016-03-11 Thread Christian Couder
On Thu, Mar 10, 2016 at 10:26 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Thu, Mar 10, 2016 at 12:48 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> This is a patch series about libifying "git apply" functionality, to >> be able to us

Draft of Git Rev News edition 13

2016-03-13 Thread Christian Couder
Hi, A draft of Git Rev News edition 13 is available here: https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-13.md Everyone is welcome to contribute in any section either by editing the above page on GitHub and sending a pull request, or by commenting on this GitHub

Re: [PATCH/RFC/GSoC 12/17] rebase-todo: introduce rebase_todo_item

2016-03-14 Thread Christian Couder
On Sat, Mar 12, 2016 at 11:46 AM, Paul Tan wrote: > In an interactive rebase, commands are read and executed from a todo > list (.git/rebase-merge/git-rebase-todo) to perform the rebase. > > In the upcoming re-implementation of git-rebase -i in C, it is useful to > be able to

Re: [PATCH 4/4] builtin/am: passthrough -t and --trailer flags

2016-04-07 Thread Christian Couder
On Thu, Apr 7, 2016 at 11:23 AM, Michael S. Tsirkin wrote: > Pass -t and --trailer flags to git-reinterpret-trailers. s/git-reinterpret-trailers/git-interpret-trailers/ Thanks, Christian. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message

Re: [PATCH] sequencer.c: fix detection of duplicate s-o-b

2016-04-07 Thread Christian Couder
On Wed, Apr 6, 2016 at 12:37 PM, Willy Tarreau wrote: > On Wed, Apr 06, 2016 at 07:57:01AM -0700, Junio C Hamano wrote: >> This seems to have been lost, perhaps because the top part that was >> quite long didn't look like a patch submission message or something. > > Don't worry, we

Re: git interpret-trailers with multiple keys

2016-04-06 Thread Christian Couder
On Wed, Apr 6, 2016 at 3:30 PM, Michael S. Tsirkin wrote: > On Wed, Apr 06, 2016 at 10:42:42AM -0700, Junio C Hamano wrote: >> "Michael S. Tsirkin" writes: >> >> > On Wed, Apr 06, 2016 at 06:58:30PM +0200, Matthieu Moy wrote: >> >> "Michael S. Tsirkin"

Re: [PATCH v2 12/21] bisect: replace clear_distance() by unique markers

2016-04-12 Thread Christian Couder
On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer wrote: > > @@ -123,10 +116,9 @@ static void show_list(const char *debug, int counted, > int nr, > const char *subject_start; > int subject_len; > > - fprintf(stderr, "%c%c%c ", > +

Re: [PATCH v2 11/21] bisect: use struct node_data array instead of int array

2016-04-12 Thread Christian Couder
On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer wrote: > > @@ -321,14 +321,13 @@ static struct commit_list *do_find_bisection(struct > commit_list *list, > * add one for p itself if p is to be counted, > * otherwise inherit it

Re: git interpret-trailers with multiple keys

2016-04-10 Thread Christian Couder
On Sun, Apr 10, 2016 at 11:32 AM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Wed, Apr 06, 2016 at 10:28:21PM -0400, Christian Couder wrote: >> On Wed, Apr 6, 2016 at 3:30 PM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Wed, Apr 06, 2016 at 10:42:42

[ANNOUNCE] Git Rev News edition 13

2016-03-19 Thread Christian Couder
Hi everyone, I'm happy announce that the 13th edition of Git Rev News is now published: http://git.github.io/rev_news/2016/03/16/edition-13/ Thanks a lot to all the contributors and helpers, especially Lars Schneider and Sebastian Schuberth! Enjoy, Christian, Thomas and Nicola. -- To

[PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-19 Thread Christian Couder
When parse_chunk() fails it can return -1, for example when find_header() doesn't find a patch header. In this case it's better in apply_patch() to free the "struct patch" that we just allocated instead of leaking it. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> ---

Re: GSoC Project | Improvise git bisect

2016-03-19 Thread Christian Couder
Hi, On Sat, Mar 19, 2016 at 1:48 PM, Matthieu Moy wrote: >> Subject: Re: GSoC Project | Improvise git bisect > > > "Improve" I guess. > > Pranit Bauva writes: > >> Hey everyone! > > Hi, > >> What I

[PATCH v3] builtin/apply: handle parse_binary() failure

2016-03-19 Thread Christian Couder
rts to make it just return -1. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Only the title of the patch changed in this version compared to v2. builtin/apply.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/apply.c b/builtin/apply.c index 42c610e..c399c9

Re: [PATCH 1/2] git-compat-util: st_add4: work around gcc 4.2.x compiler crash

2016-03-20 Thread Christian Couder
On Mon, Mar 21, 2016 at 5:35 AM, Eric Sunshine wrote: > > diff --git a/git-compat-util.h b/git-compat-util.h > index c07e0c1..4743954 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -715,8 +715,8 @@ static inline size_t st_add(size_t a, size_t b) >

Re: GSoC Project | Improvise git bisect

2016-03-20 Thread Christian Couder
On Sun, Mar 20, 2016 at 12:35 PM, Pranit Bauva wrote: > The project Idea: Incremental Rewrite from shell to C of git-bisect.sh > > The plan: > > - Place bisect.c in builtin/ > - Implement a skeletal cmd_bisect() which will redirect to > git-bisect.sh (1e1ea69f) > -

Re: [PATCH 00/16] git bisect improvements

2016-03-22 Thread Christian Couder
On Mon, Mar 21, 2016 at 11:22 PM, Stephan Beyer wrote: > > Also sorry, I am not following the list so I didn't know there was a > GSoC project for bisect. > >> If it is okay with you then can I work more upon these >> patches in my GSoC project. > > I'm totally fine with that, of

Re: [PATCH] bisect--helper: convert a function in shell to C

2016-03-22 Thread Christian Couder
On Tue, Mar 22, 2016 at 1:28 AM, Stefan Beller wrote: > On Mon, Mar 21, 2016 at 12:00 PM, Pranit Bauva wrote: >> Convert the code literally without changing its design even though it >> seems that its obscure as to the use of comparing revision to

[PATCH 0/3] builtin/apply: simplify some gitdiff_* functions

2016-03-22 Thread Christian Couder
While working on libifying "git apply" it appeared that some gitdiff_* functions are unnecessarily complex. Christian Couder (3): builtin/apply: get rid of useless 'name' variable builtin/apply: make gitdiff_verify_name() return void builtin/apply: simplify gitdiff_{old,new}name()

[PATCH 3/3] builtin/apply: simplify gitdiff_{old,new}name()

2016-03-22 Thread Christian Couder
After the previous simplifications, it is easy to see that there is no need to free the original string passed to gitdiff_verify_name(), because this string can be changed only when it is NULL. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 6 --

[PATCH 1/3] builtin/apply: get rid of useless 'name' variable

2016-03-22 Thread Christian Couder
While at it put an 'else' on the same line as the previous '}'. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 42c610e..465f954

[PATCH 2/3] builtin/apply: make gitdiff_verify_name() return void

2016-03-22 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.

Re: [PATCH 2/3] builtin/apply: make gitdiff_verify_name() return void

2016-03-22 Thread Christian Couder
On Tue, Mar 22, 2016 at 10:25 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> As the value returned by gitdiff_verify_name() is put into the >> same variable that is passed as a parameter to this func

Re: GSoC 2016 | Proposal | Incremental Rewrite of git bisect

2016-03-25 Thread Christian Couder
mmits. > > Step 2: Starting from the good ends (or end), associate some kind of > “weight” which depends on its distance from the good commit also > considering some other factors. > > Step 3: Find the midpoint of the max weight which will be the bisection > commit. > >

Re: [PATCH/GSoC] add a add.patch config variable

2016-03-25 Thread Christian Couder
On Thu, Mar 24, 2016 at 10:09 PM, XZS wrote: > > diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh > index deae948..25e4b2e 100755 > --- a/t/t3701-add-interactive.sh > +++ b/t/t3701-add-interactive.sh > @@ -380,4 +380,13 @@ test_expect_success 'patch mode

Re: GSoC 2016 | Proposal | Incremental Rewrite of git bisect

2016-03-25 Thread Christian Couder
On Fri, Mar 25, 2016 at 11:15 AM, Pranit Bauva wrote: >> - you will add an option to "git bisect--helper" to perform what the >> git-bisect.sh function did, and >> - you will create a test script for "git bisect--helper" in which you >> will test each option? > > I had

Re: GSoC Project | Improvise git bisect

2016-03-21 Thread Christian Couder
Hi Pranit, On Mon, Mar 21, 2016 at 8:29 AM, Pranit Bauva wrote: > On Mon, Mar 21, 2016 at 12:48 PM, Johannes Schindelin > wrote: >> Hi Pranit, >> >> On Sun, 20 Mar 2016, Pranit Bauva wrote: >> >>> I could first move individual functions to

[PATCH v2] builtin/apply: exit when parse_binary() fails

2016-03-19 Thread Christian Couder
rts to make it just return -1. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/apply.c b/builtin/apply.c index 42c610e..c399c97 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @

[PATCH] builtin/apply: exit when parse_binary() fails

2016-03-19 Thread Christian Couder
return -1, because that's what error() returns. Also parse_binary_hunk() sets "status" to -1 in case of error and parse_binary() does "if (status) return status;". In this case parse_chunk() should just exit, rather than add -1 to the patchsize it computes. Signed-off-by: Chr

[PATCH v2] Documentation: talk about pager in api-trace.txt

2016-03-07 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Documentation/technical/api-trace.txt | 44 +++ 1 file changed, 44 insertions(+) diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt index 097a651..0e1af02

t9700-perl-git.sh is broken on some configurations

2016-03-04 Thread Christian Couder
Hi, It looks like t9700-perl-git.sh is broken on one machine I use but not on my laptop since commit d53c2c67380f769f91fd45cc8c63a5883245ccca (mingw: fix t9700's assumption about directory separators, Jan 27 17:19:56 2016). I get: Initialized empty Git repository in

Re: t9700-perl-git.sh is broken on some configurations

2016-03-04 Thread Christian Couder
On Fri, Mar 4, 2016 at 9:56 AM, Jeff King <p...@peff.net> wrote: > On Fri, Mar 04, 2016 at 09:13:51AM +0100, Christian Couder wrote: > >> Indeed on the command line I get: >> >> >> $ t/t9700/test.pl >> ok 2 - use Git; >> B

Re: [PATCH] t9700: fix test for perl older than 5.14

2016-03-04 Thread Christian Couder
On Fri, Mar 4, 2016 at 1:21 PM, Dennis Kaarsemaker wrote: > On vr, 2016-03-04 at 06:43 -0500, Jeff King wrote: >> On Fri, Mar 04, 2016 at 11:58:24AM +0100, Dennis Kaarsemaker wrote: >> >> > On vr, 2016-03-04 at 03:56 -0500, Jeff King wrote: >> > > ? Those are just guesses,

"./t0001-init.sh --valgrind" is broken

2016-03-02 Thread Christian Couder
Hi, It looks like commit 57ea7123c86771f47f34e7d92d1822d8b429897a (git.c: make sure we do not leak GIT_* to alias scripts, Dec 20 14:50:19 2015) broke "./t0001-init.sh --valgrind". I get: expecting success: ( env | sed -ne "/^GIT_/s/=.*//p" && echo

Re: [PATCH] Documentation: talk about pager in api-trace.txt

2016-03-03 Thread Christian Couder
On Mon, Feb 29, 2016 at 10:31 PM, Jeff King <p...@peff.net> wrote: > On Mon, Feb 29, 2016 at 03:21:20PM +0100, Christian Couder wrote: > >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> >> --- >> Documentation/technical/api-trace.txt | 43 >>

Re: Rebase performance

2016-03-02 Thread Christian Couder
On Thu, Feb 25, 2016 at 5:31 PM, Ævar Arnfjörð Bjarmason <ava...@gmail.com> wrote: > On Wed, Feb 24, 2016 at 11:09 PM, Christian Couder > <christian.cou...@gmail.com> wrote: > > [Resent because I was accidentally in GMail's HTML mode and the ML rejected > it] > &

Re: [PATCH v3] builtin/apply: handle parse_binary() failure

2016-04-01 Thread Christian Couder
On Fri, Apr 1, 2016 at 1:16 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: >> >> It looks like this patch is not in pu. Maybe it has fallen through the >> cracks? > > Yup, it indeed was ignored (givin

Re: [PATCH v3] builtin/apply: handle parse_binary() failure

2016-03-31 Thread Christian Couder
On Fri, Mar 18, 2016 at 1:30 PM, Christian Couder <christian.cou...@gmail.com> wrote: > In parse_binary() there is: > > forward = parse_binary_hunk(, , , ); > if (!forward && !status) > /* there has to be one hunk (forward hunk) */ &

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder <christian.cou...@gmail.com> wrote: > When parse_chunk() fails it can return -1, for example > when find_header() doesn't find a patch header. > > In this case it's better in apply_patch() to free the > "struct patch"

Re: Signed-off-by vs Reviewed-by

2016-03-31 Thread Christian Couder
On Thu, Mar 31, 2016 at 4:57 PM, Sidhant Sharma wrote: > Hi, > > On Thursday 31 March 2016 08:05 PM, Miklos Vajna wrote: >> Hi, >> >> On Thu, Mar 31, 2016 at 07:54:47PM +0530, Pranit Bauva >> wrote: >>> Are you suggesting to use a different email

Re: Signed-off-by vs Reviewed-by

2016-03-31 Thread Christian Couder
On Thu, Mar 31, 2016 at 4:32 PM, Jeff King wrote: > On Thu, Mar 31, 2016 at 02:35:07PM +0200, Miklos Vajna wrote: > >> Hi, >> >> Some projects like LibreOffice don't use Signed-off-by, instead usually >> use Gerrit for code review, and reviewers add a Reviewed-by line when >> they

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Fri, Apr 1, 2016 at 12:56 AM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder >> <christian.cou...@gmail.com> wrote: >>> When parse_chunk()

Re: GIT_CONFIG - what's the point?

2016-04-01 Thread Christian Couder
On Fri, Apr 1, 2016 at 2:54 AM, Matthew Persico wrote: > Greetings. > > Given the GIT_CONFIG environment variable can change 'git config' > behaves, it stands to reason that if GIT_CONFIG is defined, then ALL > git commands obey the value of GIT_CONFIG and use that file

Re: RPM spec file broken by README.md

2016-04-01 Thread Christian Couder
On Fri, Apr 1, 2016 at 1:23 PM, Christian Couder <christian.cou...@gmail.com> wrote: > Hi! > > On Fri, Apr 1, 2016 at 7:35 AM, Ron Isaacson <isaacson.lj...@gmail.com> wrote: >> Hi everyone, >> >> I've noticed that "make rpm" is failing for 2.

Re: RPM spec file broken by README.md

2016-04-01 Thread Christian Couder
Hi! On Fri, Apr 1, 2016 at 7:35 AM, Ron Isaacson wrote: > Hi everyone, > > I've noticed that "make rpm" is failing for 2.8.0 because README was > replaced with README.md. This line in git.spec is the culprit: > > %doc README COPYING Documentation/*.txt > > Would it be

Re: git alias quoting help

2016-04-01 Thread Christian Couder
On Wed, Mar 30, 2016 at 6:13 AM, shawn wilson wrote: > I've also tried to make this a plain bash script (w/o the function or > if statements and am failing at the same place). The issue seems to be > with the quoting in the filter-branch | ls-files bit. Also, the end > goal

Re: [PATCH v2 16/21] bisect: make total number of commits global

2016-04-13 Thread Christian Couder
On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer wrote: > The total number of commits in a bisect process is a property of > the bisect process. Making this property global helps to make the code > clearer. > > Signed-off-by: Stephan Beyer > --- > bisect.c | 74

Re: [PATCH v2 19/21] bisect: use a bottom-up traversal to find relevant weights

2016-04-13 Thread Christian Couder
On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer wrote: > The idea is to reverse the DAG and perform a traversal > starting on all sources of the reversed DAG. > > We walk from the bottom commits, incrementing the weight while > walking on a part of the graph that is single strand

Re: [PATCH v2 17/21] bisect: rename count_distance() to compute_weight()

2016-04-13 Thread Christian Couder
On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer wrote: > > @@ -70,7 +70,7 @@ static inline int distance_direction(struct commit *commit) > return 0; > } > > -static int count_distance(struct commit *elem) > +static int compute_weight(struct commit *elem) > { >

[PATCH 82/83] environment: add set_index_file()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- cache.h | 1 + environment.c | 5 + 2 files changed, 6 insertions(+) diff --git a/cache.h b/cache.h index 2711048..7f36aa3 100644 --- a/cache.h +++ b/cache.h @@ -461,6 +461,7 @@ extern int is_inside_work_tree(void);

[PATCH 80/83] run-command: make dup_devnull() non static

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- run-command.c | 2 +- run-command.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/run-command.c b/run-command.c index 8c7115a..29d2bda 100644 --- a/run-command.c +++ b/run-command.c @@ -85,7 +85,7 @@

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b6d2343..699cabf 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@

[PATCH 15/83] builtin/apply: move 'allow_overlap' 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 b57be2c..a5dff99 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -25,6 +25,7 @@

[PATCH 18/83] builtin/apply: move 'numstat' 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 d90948a..16d78f9 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -36,6 +36,9 @@

[PATCH 11/83] builtin/apply: move 'apply_in_reverse' global into 'struct apply_state'

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

[PATCH 16/83] builtin/apply: move 'cached' global 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, 21 insertions(+), 16 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index a5dff99..ba828df 100644 --- a/builtin/apply.c +++ b/builtin/a

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 7115dc2..78849e4 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -2194,17 +2

[PATCH 14/83] builtin/apply: move 'update_index' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 46 +++--- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 154679e..b57be2c 100644 --- a/builtin/apply.c +++ b/b

[PATCH 79/83] apply: make some parsing functions static again

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 6 +++--- apply.h | 5 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apply.c b/apply.c index 99b7a2d..86e0d20 100644 --- a/apply.c +++ b/apply.c @@ -27,7 +27,7 @@ static void git_apply_confi

[PATCH 81/83] apply: roll back index in case of error

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apply.c b/apply.c index 86e0d20..7cee834 100644 --- a/apply.c +++ b/apply.c @@ -4718,8 +4718,11 @@ int apply_all_patches(

[PATCH 30/83] builtin/apply: move 'has_include' global into 'struct apply_state'

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

[PATCH 07/83] builtin/apply: introduce 'struct apply_state' to start libifying

2016-04-24 Thread Christian Couder
d the call chain. To start let's move the "prefix" and "prefix_length" global variables into "struct apply_state". Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 94 ++--- 1 file chan

[PATCH 22/83] builtin/apply: move 'unsafe_paths' 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 506357c..c45e481 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -57,6 +57,8 @@

[PATCH 83/83] builtin/am: use apply api in run_apply()

2016-04-24 Thread Christian Couder
-index --split-index` Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/am.c | 103 --- 1 file changed, 85 insertions(+), 18 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index d003939..85a77d7 100644 --- a/b

[PATCH 20/83] builtin/apply: move 'threeway' global into 'struct apply_state'

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

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ad81210..6c628f6 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -25,12 +25,15 @@

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

2016-04-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. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Makefile| 1 + apply.c | 80 + apply.h | 8 ++ builtin/apply.c | 75 - 4 files chang

[PATCH 77/83] apply: rename and move opt constants to apply.h

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.h | 3 +++ builtin/apply.c | 11 --- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apply.h b/apply.h index 35d4d15..3df0128 100644 --- a/apply.h +++ b/apply.h @@ -129,4 +129,7 @@ exte

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8b7a8e0..69bb94c 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -

[PATCH 60/83] apply: libify init_apply_state()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 7 --- apply.h | 2 +- builtin/apply.c | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apply.c b/apply.c index 9c5f258..11bec48 100644 --- a/apply.c +++ b/apply.c @@ -56,7

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 29 + apply.h | 2 +- builtin/apply.c | 29 - 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/apply.c b/apply.c index 11bec48..b

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 128 ++-- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 94bf120..787426f 100644 --- a/builtin/apply.c

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

2016-04-24 Thread Christian Couder
We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c keeps a linked list of all created lock_file structures. So let's make the 'lock_file' variable a pointer to a 'struct lock_file' and let's alloc the struct when needed. Signed-off-by: Christian Couder <chr

[PATCH 72/83] builtin/apply: make write_out_one_result() 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, 16 insertions(+), 22 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index ebac9ee..dae89e2 100644 --- a/builtin/apply.c +++ b/builtin/a

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

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 bc209f5..c0bb24c 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -454,10 +454,10 @@ stati

[PATCH 50/83] builtin/apply: get rid of the 'newfd' global

2016-04-24 Thread Christian Couder
The 'newfd' global is useless now as we can just test for "lock_file == NULL" instead of "newfd < 0". Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builtin/ap

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 5a5be49..e021fad 100644 --- a/builtin/apply.c +++ b/b

[PATCH 61/83] builtin/apply: libify check_apply_state()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index e3ee199..7576ec5 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4534,17 +4

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

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

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

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 69bb94c..89118c1 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4071,17 +4

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

2016-04-24 Thread Christian Couder
To be compatible with the rest of the error handling in builtin/apply.c, find_header() should return -1 instead of calling die(). Unfortunately find_header() already returns -1 when no header is found, so let's make it return -2 instead in this case. Signed-off-by: Christian Couder <chr

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

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

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

2016-04-24 Thread Christian Couder
. In a later patch, apply_all_patches() will return -1 too instead of exiting. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c

[PATCH 76/83] builtin/apply: rename option parsing functions

2016-04-24 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 58/83] builtin/apply: libify parse_ignorewhitespace_option()

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 8d96f70..2f89922 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -57,20 +57,20 @@

[PATCH 23/83] builtin/apply: move 'line_termination' global into 'struct apply_state'

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

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

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

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

2016-04-24 Thread Christian Couder
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 e1d6c8b..de5c745 100644 --- a/builtin/a

[PATCH 66/83] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

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 268356b..8b7a8e0 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3699,7 +3699,7 @@

[PATCH 34/83] builtin/apply: move 'whitespace_error' global into 'struct apply_state'

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

[PATCH 41/83] builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'

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

[PATCH 31/83] builtin/apply: move 'p_value' global into 'struct apply_state'

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 151 +--- 1 file changed, 99 insertions(+), 52 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 0717cd2..979849c 100644 --- a/builtin/apply.c

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

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

[PATCH 57/83] builtin/apply: libify parse_whitespace_option()

2016-04-24 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 1c1ac7d..8d96f70 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -27,34

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

2016-04-24 Thread Christian Couder
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 e021fad..ebac9ee 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -

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

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

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