[RFC/PATCH 0/8] Add initial experimental external ODB support

2016-06-13 Thread Christian Couder
ommits/jk/external-odb-wip Initial discussions about this new series are there: http://thread.gmane.org/gmane.comp.version-control.git/288151/focus=295160 Links ~ This patch series is available here: https://github.com/chriscool/git/commits/external-odb Christian Couder (6): t0400: use

[RFC/PATCH 5/8] t0400: add test for 'put' command

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t0400-external-odb.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index 0f1bb97..6c6da5c 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-odb.sh @@

[RFC/PATCH 3/8] t0400: use --batch-all-objects to get all objects

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t0400-external-odb.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index 2b01617..fe85413 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-

[RFC/PATCH 7/8] external-odb: accept only blobs for now

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- external-odb.c | 4 1 file changed, 4 insertions(+) diff --git a/external-odb.c b/external-odb.c index bb70fe3..6dd7b25 100644 --- a/external-odb.c +++ b/external-odb.c @@ -133,6 +133,10 @@ int external_odb_write_object

[RFC/PATCH 1/8] Add initial external odb support

2016-06-13 Thread Christian Couder
From: Jeff King <p...@peff.net> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Makefile| 2 + cache.h | 9 ++ external-odb.c | 115 +++ external-odb.h | 8 ++ odb-helper.c

[RFC/PATCH 6/8] external odb: add write support

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- external-odb.c | 15 +++ external-odb.h | 2 ++ odb-helper.c | 41 + odb-helper.h | 3 +++ sha1_file.c| 2 ++ 5 files changed, 59 insertions(+), 4 deletions(-) diff

[RFC/PATCH 4/8] t0400: add 'put' command to odb-helper script

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t0400-external-odb.sh | 14 ++ 1 file changed, 14 insertions(+) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index fe85413..0f1bb97 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-

[RFC/PATCH 8/8] t0400: add test for external odb write support

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t0400-external-odb.sh | 8 1 file changed, 8 insertions(+) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index 6c6da5c..3c868ca 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-odb.sh @@

Draft of Git Rev News edition 16

2016-06-11 Thread Christian Couder
Hi, A draft of a new Git Rev News edition is available here: https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-16.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

[PATCH v7 17/40] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-06-13 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 b506369..429fddd 100644 --- a/builtin/apply

[PATCH v7 23/40] builtin/apply: make write_out_one_result() return -1 on error

2016-06-13 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 76d473c..291e24e 100644 --- a/builtin/apply

[PATCH v7 07/40] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Couder <chr

[PATCH v7 21/40] builtin/apply: make add_index_file() return -1 on error

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v7 09/40] builtin/apply: move init_apply_state() to apply.c

2016-06-13 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 v7 36/40] usage: add set_warn_routine()

2016-06-13 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 v7 24/40] builtin/apply: make write_out_results() return -1 on error

2016-06-13 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 291e24e..f35c901 100644 --- a/builtin/apply.c

[PATCH v7 33/40] apply: add 'be_silent' variable to 'struct apply_state'

2016-06-13 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 v7 19/40] builtin/apply: make remove_file() return -1 on error

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v7 06/40] builtin/apply: make parse_single_patch() return -1 on error

2016-06-13 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 a

[PATCH v7 18/40] builtin/apply: make build_fake_ancestor() return -1 on error

2016-06-13 Thread Christian Couder
ine <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 429fddd..e74b068 100644 --- a/builtin

[PATCH v7 31/40] environment: add set_index_file()

2016-06-13 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 81d4ac3..28fc0bf

[PATCH v7 30/40] apply: make some parsing functions static again

2016-06-13 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 v7 22/40] builtin/apply: make create_file() return -1 on error

2016-06-13 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 005ba78..76d473c 100644 --- a/builtin/apply

[PATCH v7 15/40] builtin/apply: make gitdiff_*() return 1 at end of header

2016-06-13 Thread Christian Couder
ase of a real error. This will be done in a following patch. Helped-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/builtin/ap

[PATCH v7 38/40] apply: change error_routine when be_silent is set

2016-06-13 Thread Christian Couder
To avoid printing anything when applying with be_silent set, let's save the existing warn and error routines before applying and replace them with a routine that does nothing. Then after applying, let's restore the saved routines. Signed-off-by: Christian Couder <chrisc...@tuxfamily.

[PATCH v7 28/40] apply: rename and move opt constants to apply.h

2016-06-13 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 v7 35/40] apply: don't print on stdout when be_silent is set

2016-06-13 Thread Christian Couder
This variable should prevent anything to be printed on both stderr and stdout. 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 dd9b301..2529534 100644 --- a/apply.c

[PATCH v7 25/40] builtin/apply: make try_create_file() return -1 on error

2016-06-13 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 v7 14/40] builtin/apply: make parse_traditional_patch() return -1 on error

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v7 11/40] builtin/apply: make check_apply_state() return -1 instead of die()ing

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v7 05/40] builtin/apply: make parse_chunk() return a negative integer on error

2016-06-13 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 | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/builtin/apply.c b/bui

[PATCH v7 26/40] builtin/apply: make create_one_file() return -1 on error

2016-06-13 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", create_one_file() should return -1 instead of calling exit(). Signed-off-by: Christian Coud

[PATCH v7 13/40] builtin/apply: make apply_all_patches() return -1 on error

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

[PATCH v7 01/40] apply: move 'struct apply_state' to apply.h

2016-06-13 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 v7 20/40] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-06-13 Thread Christian Couder
ine <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 694c65b..0997384 100644 --- a/builtin/apply.c

Re: [PATCH v7 00/40] libify apply and use lib in am, part 2

2016-06-13 Thread Christian Couder
On Mon, Jun 13, 2016 at 6:09 PM, Christian Couder <christian.cou...@gmail.com> wrote: > > I will send a diff between this version and the previous one, as a > reply to this email. Here is the diff: diff --git a/apply.c b/apply.c index cd4cd01..98a 100644 --- a/apply.

Re: [PATCH v7 02/40] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-14 Thread Christian Couder
On Tue, Jun 14, 2016 at 12:55 AM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> +/* >> + * Try to apply a patch. >> + * >> + * Returns: >> + * -1 if an error happened >> + * 0 if t

Re: [PATCH v7 01/40] apply: move 'struct apply_state' to apply.h

2016-06-14 Thread Christian Couder
On Tue, Jun 14, 2016 at 12:49 AM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> To libify `git apply` functionality we must make 'struct apply_state' >> usable outside "builtin/apply.c". >&g

[ANNOUNCE] Sharness v1.0.0

2016-06-14 Thread Christian Couder
Hi, Version 1.0.0 of Sharness [1] -- the test harness library derived from Git's test lib -- is released. This release contains many upstream fixes and improvements from Git and a lot of specific user contributed features [2]. It's the first release since v0.3.0 in April 2013 [3]. Sharness was

Re: [ANNOUNCE] Sharness v1.0.0

2016-06-14 Thread Christian Couder
On Tue, Jun 14, 2016 at 9:48 PM, Stefan Beller <sbel...@google.com> wrote: > On Tue, Jun 14, 2016 at 12:34 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> >> Sharness was first announced on this list in July 2012 [4]. It was >> created from Git

[ANNOUNCE] Git Rev News edition 16

2016-06-15 Thread Christian Couder
Hi everyone, I'm happy announce that the 16th edition of Git Rev News is now published: http://git.github.io/rev_news/2016/06/15/edition-16/ Thanks a lot to all the contributors and helpers, especially Duy and the Ensimag students! Enjoy, Christian, Thomas and Nicola. -- To unsubscribe from

[PATCH v7 39/40] builtin/am: use apply api in run_apply()

2016-06-13 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 v7 12/40] builtin/apply: move check_apply_state() to apply.c

2016-06-13 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 | 32 apply

[PATCH v7 37/40] usage: add get_error_routine() and get_warn_routine()

2016-06-13 Thread Christian Couder
Let's make it possible to get the current error_routine and warn_routine, so that we can store them before using set_error_routine() or set_warn_routine() to use new ones. This way we will be able put back the original routines, when we are done with using new ones. Signed-off-by: Christian

[PATCH v7 27/40] builtin/apply: rename option parsing functions

2016-06-13 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 v7 34/40] apply: make 'be_silent' incompatible with 'apply_verbosely'

2016-06-13 Thread Christian Couder
It should be an error to have both be_silent and apply_verbosely set, so let's check that in check_apply_state(). And by the way let's not automatically set apply_verbosely when be_silent is set. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 9 +++-- 1 file c

[PATCH v7 04/40] builtin/apply: make find_header() return -1 instead of die()ing

2016-06-13 Thread Christian Couder
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(-) diff --git a/b

[PATCH v7 08/40] builtin/apply: make parse_ignorewhitespace_option() return -1 instead of die()ing

2016-06-13 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_ignorewhitespace_option() should return -1 instead of calling die(). Signed-off-by: Christ

[PATCH v7 03/40] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-06-13 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 returning -1 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 v7 02/40] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-13 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 v7 10/40] apply: make init_apply_state() return -1 instead of exit()ing

2016-06-13 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 instead of calling exit(). Signed-off-by: Christian Coud

[PATCH v7 16/40] builtin/apply: make gitdiff_*() return -1 on error

2016-06-13 Thread Christian Couder
m> 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 1142514..b506369 100644 --- a/builtin/apply.c +++ b/builtin/appl

[PATCH v7 40/40] apply: use error_errno() where possible

2016-06-13 Thread Christian Couder
To avoid possible mistakes and to uniformly show the errno related messages, let's use error_errno() where possible. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app

[PATCH v7 32/40] write_or_die: use warning() instead of fprintf(stderr, ...)

2016-06-13 Thread Christian Couder
-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_whine_pipe(int fd,

[PATCH v7 00/40] libify apply and use lib in am, part 2

2016-06-13 Thread Christian Couder
round mid April I tested 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 t

Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C

2016-05-30 Thread Christian Couder
On Mon, May 30, 2016 at 8:21 PM, Pranit Bauva wrote: > --- > This patch contains a bug. I have tried to identify the bug and I suppose it > exists in do_for_each_entry_in_dir(). I have reproduced the debugging session > at this link[1]. I have seen that some patches in

Re: Git reset --hard with staged changes

2016-05-31 Thread Christian Couder
On Tue, May 31, 2016 at 8:02 AM, Junio C Hamano wrote: > > diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt > index 25432d9..c4cc035 100644 > --- a/Documentation/git-reset.txt > +++ b/Documentation/git-reset.txt > @@ -65,8 +65,14 @@ If `-N` is specified,

Re: [PATCH] t6030: explicitly test for bisection cleanup

2016-05-27 Thread Christian Couder
On Fri, May 27, 2016 at 7:57 PM, Pranit Bauva wrote: > > Anyone any comments? Maybe you could add this patch to, or squash it into, the patch that convert bisect_clean_state to C. Thanks, Christian. -- To unsubscribe from this list: send the line "unsubscribe git" in the

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

2016-05-31 Thread Christian Couder
On Tue, May 31, 2016 at 2:43 PM, Duy Nguyen <pclo...@gmail.com> wrote: > On Fri, May 20, 2016 at 7:39 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> I am responding to this 2+ month old email because I am investigating >> adding an alternate object st

Re: [PATCH v2 6/6] bisect--helper: `bisect_write` shell function in C

2016-06-16 Thread Christian Couder
On Thu, Jun 16, 2016 at 9:01 PM, Pranit Bauva wrote: > Hey Eric, > > On Fri, Jun 17, 2016 at 12:25 AM, Eric Sunshine > wrote: >> On Wed, Jun 15, 2016 at 10:00 AM, Pranit Bauva >> wrote: >>> >>> Note: bisect_write() uses

Re: [PATCH v2 5/6] bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C

2016-06-16 Thread Christian Couder
On Thu, Jun 16, 2016 at 9:25 PM, Pranit Bauva wrote: > Hey Eric, > > On Fri, Jun 17, 2016 at 12:46 AM, Eric Sunshine > wrote: >> On Thu, Jun 16, 2016 at 3:05 PM, Pranit Bauva wrote: >>> On Thu, Jun 16, 2016 at 2:44 AM,

Re: [PATCH v12 16/20] index-helper: don't run if already running

2016-06-17 Thread Christian Couder
On Thu, May 19, 2016 at 11:45 PM, David Turner wrote: > > diff --git a/index-helper.c b/index-helper.c > index 4a171e6..ddc641a 100644 > --- a/index-helper.c > +++ b/index-helper.c > @@ -438,6 +438,13 @@ int main(int argc, char **argv) > return 0; >

Re: [PATCH v12 10/20] watchman: support watchman to reduce index refresh cost

2016-06-17 Thread Christian Couder
On Thu, May 19, 2016 at 11:45 PM, David Turner wrote: > From: Nguyễn Thái Ngọc Duy > > The previous patch has the logic to clear bits in 'WAMA' bitmap. This > patch has logic to set bits as told by watchman. The missing bit, > _using_ these bits, are

Re: [PATCH v12 04/20] index-helper: new daemon for caching index and related stuff

2016-06-17 Thread Christian Couder
On Thu, May 19, 2016 at 11:45 PM, David Turner wrote: > From: Nguyễn Thái Ngọc Duy > > +static void loop(int fd, int idle_in_seconds) > +{ > + assert(idle_in_seconds < INT_MAX / 1000); This assert may not be very nice to users setting the value

Re: [PATCH v8 00/41] libify apply and use lib in am, part 2

2016-06-27 Thread Christian Couder
On Mon, Jun 27, 2016 at 8:23 PM, Christian Couder <christian.cou...@gmail.com> wrote: > > I will send a diff between this version and the previous one, as a > reply to this email. Here is the diff: diff --git a/apply.c b/apply.c index 98a..2ac22d3 100644 --- a/apply.

[PATCH v8 12/41] builtin/apply: make check_apply_state() return -1 instead of die()ing

2016-06-27 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v8 16/41] builtin/apply: make gitdiff_*() return 1 at end of header

2016-06-27 Thread Christian Couder
ase of a real error. This will be done in a following patch. Helped-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/builtin/ap

[PATCH v8 28/41] builtin/apply: rename option parsing functions

2016-06-27 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 v8 14/41] builtin/apply: make apply_all_patches() return 128 or 1 on error

2016-06-27 Thread Christian Couder
to init_apply_state() many times to be reused by series of calls to the apply lib functions. Helped-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> Helped-by: Johannes Schindelin <johannes.schinde...@gmx.de> Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <ch

[PATCH v8 01/41] apply: make some names more specific

2016-06-27 Thread Christian Couder
To prepare for some structs and constants being moved from builtin/apply.c to apply.h, we should give them some more specific names to avoid possible name collisions in th global namespace. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 20 ++---

[PATCH v8 19/41] builtin/apply: make build_fake_ancestor() return -1 on error

2016-06-27 Thread Christian Couder
ine <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 d3a9da2..bb1dffa 100644 --- a/builtin

[PATCH v8 22/41] builtin/apply: make add_index_file() return -1 on error

2016-06-27 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v8 02/41] apply: move 'struct apply_state' to apply.h

2016-06-27 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 v8 06/41] builtin/apply: make parse_chunk() return a negative integer on error

2016-06-27 Thread Christian Couder
() is called only by apply_patch() which already returns either -1 or -128 when an error happened, let's make it also return -1 or -128. This makes it compatible with what find_header() and parse_binary() already return. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Chr

[PATCH v8 03/41] builtin/apply: make apply_patch() return -1 or -128 instead of die()ing

2016-06-27 Thread Christian Couder
-128 and it will exit(1) when it returns -1. We exit() with code 128 because that was what die() was doing and we want to keep the distinction between exiting with code 1 and exiting with code 128. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder &

[PATCH v8 00/41] libify apply and use lib in am, part 2

2016-06-27 Thread Christian Couder
d by the rebase 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 (41): apply: make some names more specific apply: move 'struct apply_state' to apply.h

[PATCH v8 07/41] builtin/apply: make parse_single_patch() return -1 on error

2016-06-27 Thread Christian Couder
() and let's 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/a

[PATCH v8 17/41] builtin/apply: make gitdiff_*() return -1 on error

2016-06-27 Thread Christian Couder
m> 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 0bed352..b48b526 100644 --- a/builtin/apply.c +++ b/builtin/appl

[PATCH v8 10/41] builtin/apply: move init_apply_state() to apply.c

2016-06-27 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 v8 18/41] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-06-27 Thread Christian Couder
that let's change its name to check_unsafe_path(). Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index b48b526..d3a9da2 1006

[PATCH v8 05/41] builtin/apply: make find_header() return -128 instead of die()ing

2016-06-27 Thread Christian Couder
find_header() already returns -1 when no header is found. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 40 t/t4254-am-corrupt.sh | 2 +- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/builtin/app

[PATCH v8 25/41] builtin/apply: make write_out_results() return -1 on error

2016-06-27 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 6ec87e6..f54b8c5 100644 --- a/builtin/apply.c

[PATCH v8 20/41] builtin/apply: make remove_file() return -1 on error

2016-06-27 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v8 41/41] apply: use error_errno() where possible

2016-06-27 Thread Christian Couder
To avoid possible mistakes and to uniformly show the errno related messages, let's use error_errno() where possible. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apply.c b/a

[PATCH v8 08/41] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing

2016-06-27 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 instead of calling die(). Signed-off-by: Christian Couder <chr

[PATCH v8 15/41] builtin/apply: make parse_traditional_patch() return -1 on error

2016-06-27 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 instead of calling die(). Signed-off-by: Christian Coud

[PATCH v8 04/41] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-06-27 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 returning -1 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 v8 29/41] apply: rename and move opt constants to apply.h

2016-06-27 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 v8 31/41] apply: make some parsing functions static again

2016-06-27 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 v8 21/41] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-06-27 Thread Christian Couder
ine <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 cb3ef1c..b0fd5f7 100644 --- a/builtin/apply.c

[PATCH v8 11/41] apply: make init_apply_state() return -1 instead of exit()ing

2016-06-27 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 instead of calling exit(). Signed-off-by: Christian Coud

[PATCH v8 34/41] apply: add 'be_silent' variable to 'struct apply_state'

2016-06-27 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 v8 09/41] builtin/apply: make parse_ignorewhitespace_option() return -1 instead of die()ing

2016-06-27 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_ignorewhitespace_option() should return -1 instead of calling die(). Signed-off-by: Christ

[PATCH v8 39/41] apply: change error_routine when be_silent is set

2016-06-27 Thread Christian Couder
To avoid printing anything when applying with be_silent set, let's save the existing warn and error routines before applying and replace them with a routine that does nothing. Then after applying, let's restore the saved routines. Signed-off-by: Christian Couder <chrisc...@tuxfamily.

[PATCH v8 38/41] usage: add get_error_routine() and get_warn_routine()

2016-06-27 Thread Christian Couder
Let's make it possible to get the current error_routine and warn_routine, so that we can store them before using set_error_routine() or set_warn_routine() to use new ones. This way we will be able put back the original routines, when we are done with using new ones. Signed-off-by: Christian

[PATCH v8 35/41] apply: make 'be_silent' incompatible with 'apply_verbosely'

2016-06-27 Thread Christian Couder
It should be an error to have both be_silent and apply_verbosely set, so let's check that in check_apply_state(). And by the way let's not automatically set apply_verbosely when be_silent is set. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 9 +++-- 1 file c

[PATCH v8 37/41] usage: add set_warn_routine()

2016-06-27 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 v8 13/41] builtin/apply: move check_apply_state() to apply.c

2016-06-27 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 | 32 apply

[PATCH v8 36/41] apply: don't print on stdout when be_silent is set

2016-06-27 Thread Christian Couder
This variable should prevent anything to be printed on both stderr and stdout. 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 1435f85..e2acc18 100644 --- a/apply.c

[PATCH v8 24/41] builtin/apply: make write_out_one_result() return -1 on error

2016-06-27 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 bce3988..6ec87e6 100644 --- a/builtin/apply

<    6   7   8   9   10   11   12   13   14   15   >