[PATCH v3 05/11] update-index: move 'uc' var declaration

2015-12-23 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index c91e695..f667125 100644 --- a/builtin/update-index.c +++ b/builtin/update-i

[PATCH v3 10/11] config: add core.untrackedCache

2015-12-23 Thread Christian Couder
ore between `--untracked-cache` and `--force-untracked-cache`. All the changes to `--[no-|force-]untracked-cache` make it possible to deprecate those options in the future. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com> --- D

[PATCH v3 09/11] dir: simplify untracked cache "ident" field

2015-12-23 Thread Christian Couder
-by: Christian Couder <chrisc...@tuxfamily.org> --- dir.c | 49 ++--- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/dir.c b/dir.c index dba1ad0..7596a3f 100644 --- a/dir.c +++ b/dir.c @@ -1918,23 +1918,36 @@ static const char *get_ident_

[PATCH v3 06/11] dir: add add_untracked_cache()

2015-12-23 Thread Christian Couder
Factor out code into add_untracked_cache(), which will be used in a later commit. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 11 +-- dir.c | 14 ++ dir.h | 1 + 3 files changed, 16 inse

[PATCH v3 07/11] dir: add new_untracked_cache()

2015-12-23 Thread Christian Couder
Factor out code into new_untracked_cache(), which will be used multiple times in a later commit. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- dir.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dir.c b/dir.c index 0

[PATCH v3 08/11] dir: add remove_untracked_cache()

2015-12-23 Thread Christian Couder
Factor out code into remove_untracked_cache(), which will be used in a later commit. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 6 +- dir.c | 9 + dir.h | 1 + 3 files changed, 11 insertions(+), 5 del

[PATCH v3 11/11] t7063: add tests for core.untrackedCache

2015-12-23 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t7063-status-untracked-cache.sh | 48 +-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh index 2

[PATCH v3 04/11] update-index: add untracked cache notifications

2015-12-23 Thread Christian Couder
tory tests are performed. This makes it easy to spot any problem. Also in verbose mode, let's tell the user when the cache is enabled or disabled. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 16 +++- 1 file changed, 11 insertions(+), 5 de

Re: [PATCH v3 07/11] dir: add new_untracked_cache()

2015-12-23 Thread Christian Couder
On Wed, Dec 23, 2015 at 11:53 PM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Wed, Dec 23, 2015 at 4:03 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> Factor out code into new_untracked_cache(), which will be used >> multiple ti

[PATCH v4 01/10] dir: free untracked cache when removing it

2015-12-28 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/update-index.c b/builtin/update-index.c index 7431938..a6fff87 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1123,6 +

[PATCH v4 10/10] t7063: add tests for core.untrackedCache

2015-12-28 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- t/t7063-status-untracked-cache.sh | 75 --- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh index 2

[PATCH v4 09/10] config: add core.untrackedCache

2015-12-28 Thread Christian Couder
should be mentioned in the release notes. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com> --- Documentation/config.txt | 7 Documentation/git-update-index.txt | 65 ++

[PATCH v4 08/10] dir: simplify untracked cache "ident" field

2015-12-28 Thread Christian Couder
-by: Christian Couder <chrisc...@tuxfamily.org> --- dir.c | 49 ++--- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/dir.c b/dir.c index dba1ad0..1a8b5a2 100644 --- a/dir.c +++ b/dir.c @@ -1918,23 +1918,36 @@ static const char *get_ident_

[PATCH v4 00/10] Untracked cache improvements

2015-12-28 Thread Christian Couder
nd 10/10. The patch series is also available there: https://github.com/chriscool/git/tree/uc-notifs40 Thanks to the reviewers and helpers. Christian Couder (10): dir: free untracked cache when removing it update-index: use enum for untracked cache options update-index: add --test-untracked-cache

[PATCH v4 03/10] update-index: add --test-untracked-cache

2015-12-28 Thread Christian Couder
It is nice to just be able to test if untracked cache is supported without enabling it. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Documentation/git-update-index.txt | 12 +++- builtin/update-index.c | 5 + 2 files changed, 16 insertions(+), 1 de

[PATCH v4 07/10] dir: add remove_untracked_cache()

2015-12-28 Thread Christian Couder
Factor out code into remove_untracked_cache(), which will be used in a later commit. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 6 +- dir.c | 9 + dir.h | 1 + 3 files changed, 11 insertions(+), 5 del

[PATCH v4 02/10] update-index: use enum for untracked cache options

2015-12-28 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index a6fff87..1e546a3 100644 --- a/builtin/update-index.c +++ b/b

[PATCH v4 06/10] dir: add {new,add}_untracked_cache()

2015-12-28 Thread Christian Couder
Factor out code into new_untracked_cache() and add_untracked_cache(), which will be used in later commits. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 11 +-- dir.c | 18 ++ dir.h | 1 + 3

[PATCH v4 04/10] update-index: add untracked cache notifications

2015-12-28 Thread Christian Couder
tory tests are performed. This makes it easy to spot any problem. Also in verbose mode, let's tell the user when the cache is enabled or disabled. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 14 +- 1 file changed, 9 insertions(+), 5 de

[PATCH v4 05/10] update-index: move 'uc' var declaration

2015-12-28 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/update-index.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index 369c207..fe7aaa3 100644 --- a/builtin/update-index.c +++ b/builtin/update-i

[RFC/PATCH] config: add core.trustmtime

2015-11-24 Thread Christian Couder
-by: Christian Couder <chrisc...@tuxfamily.org> --- At Booking.com we know that mtime works everywhere and we don't want the untracked cache to stop working when a kernel is upgraded or when the repo is copied to a machine with a different kernel. I will add tests later if people

[PATCH v2] Documentation/git-update-index: add missing opts to synopsys

2015-11-24 Thread Christian Couder
Untracked cache and split index related options should appear in the 'SYNOPSIS' section. These options are already documented in the 'OPTIONS' section. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Soon after sending the first version I realized that the split index option

Re: [PATCH] Documentation/git-update-index: add missing opts to synopsys

2015-11-24 Thread Christian Couder
On Tue, Nov 24, 2015 at 9:46 PM, Jeff King <p...@peff.net> wrote: > On Tue, Nov 24, 2015 at 12:55:07PM +0100, Christian Couder wrote: > >> Untracked cache related options should appear in the synopsis. >> >> Signed-off-by: Christian Couder <chrisc...@tuxfamily.

Re: [PATCH v2] Documentation/git-update-index: add missing opts to synopsys

2015-11-25 Thread Christian Couder
On Wed, Nov 25, 2015 at 10:03 AM, Jeff King <p...@peff.net> wrote: > On Wed, Nov 25, 2015 at 07:53:12AM +0100, Christian Couder wrote: > >> Untracked cache and split index related options should appear >> in the 'SYNOPSIS' section. >> >> These options ar

Re: [RFC/PATCH] config: add core.trustmtime

2015-11-25 Thread Christian Couder
Hi Johannes, On Wed, Nov 25, 2015 at 11:25 AM, Johannes Schindelin <johannes.schinde...@gmx.de> wrote: > Hi Christian, > > On Wed, 25 Nov 2015, Christian Couder wrote: > >> diff --git a/config.c b/config.c >> index 248a21a..d720b1f 100644 >> --- a/config.c &g

[PATCH v4] Documentation/git-update-index: add missing opts to synopsis

2015-11-25 Thread Christian Couder
Split index related options should appear in the 'SYNOPSIS' section. These options are already documented in the 'OPTIONS' section. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- This v4 contains only the split-index options and applies on top of the new master that a

[PATCH v3] Documentation/git-update-index: add missing opts to synopsis

2015-11-24 Thread Christian Couder
Untracked cache and split index related options should appear in the 'SYNOPSIS' section. These options are already documented in the 'OPTIONS' section. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- The only change compared to v2 is s/synopsys/synopsis/ thanks t

Re: [RFC/PATCH] config: add core.trustmtime

2015-11-25 Thread Christian Couder
Hi Duy, On Wed, Nov 25, 2015 at 8:51 PM, Duy Nguyen <pclo...@gmail.com> wrote: > On Wed, Nov 25, 2015 at 10:00 AM, Ævar Arnfjörð Bjarmason > <ava...@gmail.com> wrote: >> On Wed, Nov 25, 2015 at 7:35 AM, Christian Couder >> <christian.cou...@gmail.com> wrote: &

Re: [PATCH 0/5] Use watchman to reduce index refresh time

2015-11-20 Thread Christian Couder
On Tue, Nov 10, 2015 at 10:04 PM, David Turner <dtur...@twopensource.com> wrote: > On Mon, 2015-11-09 at 21:06 +0100, Christian Couder wrote: >> Using David's series I get worse results than all of the above but I >> guess it's because his series is based on an ancient git v

[PATCH] Documentation/git-update-index: add missing opts to synopsys

2015-11-24 Thread Christian Couder
Untracked cache related options should appear in the synopsis. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- Documentation/git-update-index.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt

[PATCH v4 1/2] builtin/apply: add 'lock_file' pointer into 'struct apply_state'

2016-06-03 Thread Christian Couder
From: Christian Couder <christian.cou...@gmail.com> We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c keeps a linked list of all created lock_file structures. Also 'struct apply_state' users might later want the same 'struct lock_file' instance to be reused by dif

[PATCH v4 2/2] builtin/apply: move 'newfd' global into 'struct apply_state'

2016-06-03 Thread Christian Couder
From: Christian Couder <christian.cou...@gmail.com> 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> Signed-off-by: Junio C

Re: [PATCH v4 1/2] builtin/apply: add 'lock_file' pointer into 'struct apply_state'

2016-06-03 Thread Christian Couder
On Fri, Jun 3, 2016 at 6:58 PM, Christian Couder <christian.cou...@gmail.com> wrote: > From: Christian Couder <christian.cou...@gmail.com> Sorry for this spurious "From:" line. It looks like send-email added it, and I don't understand why it does it now. -- To unsubsc

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

2016-06-08 Thread Christian Couder
On Mon, May 16, 2016 at 5:44 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Wed, May 11, 2016 at 9:17 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> To finish libifying the apply functionality, apply_all_patches() should not >> die() or exit(

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

2016-06-08 Thread Christian Couder
On Mon, May 16, 2016 at 6:03 PM, Junio C Hamano <gits...@pobox.com> wrote: > Eric Sunshine <sunsh...@sunshineco.com> writes: > >> On Wed, May 11, 2016 at 9:17 AM, Christian Couder >> <christian.cou...@gmail.com> wrote: >>> To libify `git apply` f

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

2016-06-08 Thread Christian Couder
On Mon, May 16, 2016 at 5:04 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Wed, May 11, 2016 at 9:17 AM, Christian Couder > <christian.cou...@gmail.com> wrote: >> To libify `git apply` functionality we have to signal errors to the >> caller instead of die(

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

2016-06-07 Thread Christian Couder
On Wed, Jun 1, 2016 at 4:00 PM, Duy Nguyen <pclo...@gmail.com> wrote: > On Tue, May 31, 2016 at 8:18 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >>>> [3] >>>> http://thread.gmane.org/gmane.comp.version-control.git/202902/focus=203020 >&

Re: [PATCH v4 1/2] builtin/apply: add 'lock_file' pointer into 'struct apply_state'

2016-06-06 Thread Christian Couder
On Fri, Jun 3, 2016 at 8:03 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> This is to replace: >> >> "[PATCH v3 48/49] builtin/apply: move 'lock_file' global into 'struct >> apply_state'&

[PATCH v5 1/2] builtin/apply: add 'lock_file' pointer into 'struct apply_state'

2016-06-06 Thread Christian Couder
From: Christian Couder <christian.cou...@gmail.com> We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c keeps a linked list of all created lock_file structures. Also 'struct apply_state' users might later want the same 'struct lock_file' instance to be reused by dif

[PATCH v5 2/2] builtin/apply: move 'newfd' global into 'struct apply_state'

2016-06-06 Thread Christian Couder
From: Christian Couder <christian.cou...@gmail.com> 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> Signed-off-by: Junio C

Re: [PATCH 4/4] bisect--helper: `bisect_reset` shell function in C

2016-06-08 Thread Christian Couder
On Wed, Jun 8, 2016 at 9:59 AM, Eric Sunshine wrote: > On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva wrote: >> Reimplement `bisect_reset` shell function in C and add a `--bisect-reset` >> subcommand to `git bisect--helper` to call it from

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Christian Couder
On Wed, Jun 8, 2016 at 10:13 AM, Eric Sunshine wrote: > > I think this would be clearer if you instead added a function to > bisect--helper.c which operates at a semantically higher level than > what you have here (and drop this file_size() function). Specifically, > add

Re: [PATCH 4/4] bisect--helper: `bisect_reset` shell function in C

2016-06-08 Thread Christian Couder
On Wed, Jun 8, 2016 at 11:51 AM, Christian Couder <christian.cou...@gmail.com> wrote: > On Wed, Jun 8, 2016 at 9:59 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: >> On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva <pranit.ba...@gmail.com> wrote: >>> Reimplemen

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

2016-06-08 Thread Christian Couder
On Wed, Jun 8, 2016 at 10:02 AM, Eric Sunshine wrote: > On Wed, Jun 8, 2016 at 3:46 AM, Pranit Bauva wrote: >> On Wed, Jun 8, 2016 at 4:01 AM, Eric Sunshine >> wrote: >>> On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva

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

2016-06-07 Thread Christian Couder
On Wed, Jun 1, 2016 at 12:31 AM, Jeff King <p...@peff.net> wrote: > On Fri, May 20, 2016 at 02:39:06PM +0200, Christian Couder wrote: > >> I wonder if this mechanism could also be used or extended to clone and >> fetch an alternate object database. >> >> In

Re: [BUG?] trailer command with multiple keys

2016-06-06 Thread Christian Couder
On Mon, Jun 6, 2016 at 2:27 PM, Michael J Gruber wrote: > The command > > printf "body\n\ntest: foo\ntest: froz\n" | git -c > trailer.test.key=tested -c trailer.test.command="echo by \$ARG" > interpret-trailers > > gives: > > body > > tested: foo > tested: froz >

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

2016-06-07 Thread Christian Couder
On Wed, Jun 1, 2016 at 3:37 PM, Duy Nguyen <pclo...@gmail.com> wrote: > On Tue, May 31, 2016 at 8:18 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >>>> I wonder if this mechanism could also be used or extended to clone and >>>> fetch an alter

Re: [PATCH v6 41/44] am: use be_silent in 'struct apply_state' to shut up applying patches

2016-06-11 Thread Christian Couder
On Sat, Jun 11, 2016 at 12:07 AM, Junio C Hamano wrote: > The update in 33/44 to make am call into apply that is not ready to > be called (e.g. the caller needs the dup(2) dance with /dev/null to > be silent) gets finally corrected with this step, which makes the > progress of

Re: [PATCH v6 43/44] builtin/apply: add a cli option for be_silent

2016-06-11 Thread Christian Couder
On Fri, Jun 10, 2016 at 10:59 PM, René Scharfe <l@web.de> wrote: > Am 10.06.2016 um 22:11 schrieb Christian Couder: >> >> Let's make it possible to request a silent operation on the >> command line. >> >> Signed-off-by: Christian Couder <chrisc...@tuxf

Re: [PATCH v6 31/44] run-command: make dup_devnull() non static

2016-06-11 Thread Christian Couder
On Sat, Jun 11, 2016 at 10:17 AM, Johannes Sixt <j...@kdbg.org> wrote: > Am 10.06.2016 um 22:11 schrieb Christian Couder: >> >> --- a/run-command.c >> +++ b/run-command.c >> @@ -85,7 +85,7 @@ static inline void close_pair(int fd[2]) >> } >> >>

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

2016-06-10 Thread Christian Couder
On Fri, Jun 10, 2016 at 7:04 PM, Johannes Sixt wrote: > Am 10.06.2016 um 13:11 schrieb Johannes Schindelin: >> >> Not really. The reply (which I had not quite connected with my mail >> because they were over a week apart) says this: >> >>> I fixed this by moving the "close(fd)"

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

2016-06-10 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 v6 33/44] builtin/am: use apply api in run_apply()

2016-06-10 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 v6 37/44] apply: don't print on stdout when be_silent is set

2016-06-10 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index dd9b301..2529534 100644 --- a/apply.c +++ b/apply.c @@ -4679,13 +4679,13 @@ static int apply_patch(struct apply_state

[PATCH v6 34/44] write_or_die: use warning() instead of fprintf(stderr, ...)

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

[PATCH v6 38/44] usage: add set_warn_routine()

2016-06-10 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 v6 32/44] environment: add set_index_file()

2016-06-10 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 v6 43/44] builtin/apply: add a cli option for be_silent

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

[PATCH v6 19/44] builtin/apply: make remove_file() return -1 on error

2016-06-10 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 v6 44/44] apply: use error_errno() where possible

2016-06-10 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apply.c b/apply.c index ef49709..cd4cd01 100644 --- a/apply.c +++ b/apply.c @@ -3505,7 +3505,7 @@ static int load_current(

[PATCH v6 09/44] builtin/apply: move init_apply_state() to apply.c

2016-06-10 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 v6 13/44] builtin/apply: make apply_all_patches() return -1 on error

2016-06-10 Thread Christian Couder
n Thái Ngọc Duy <pclo...@gmail.com> Helped-by: Johannes Schindelin <johannes.schinde...@gmx.de> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/apply.c | 40 +++- 1 file changed, 27 insertions(+), 13 deletions(-) diff -

[PATCH v6 20/44] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-06-10 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

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

2016-06-10 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 v6 35/44] apply: add 'be_silent' variable to 'struct apply_state'

2016-06-10 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 v6 40/44] apply: change error_routine when be_silent is set

2016-06-10 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 23 +-- apply.h | 4 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apply.c b/apply.c index 2529534..ef49709 100644 --- a/apply.c +++ b/apply.c @@ -109,6 +109,11 @

[PATCH v6 36/44] apply: make 'be_silent' incompatible with 'apply_verbosely'

2016-06-10 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 v6 05/44] builtin/apply: make parse_chunk() return a negative integer on error

2016-06-10 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 v6 18/44] builtin/apply: make build_fake_ancestor() return -1 on error

2016-06-10 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 v6 03/44] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-06-10 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(). Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- bui

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

2016-06-10 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 v6 42/44] run-command: make dup_devnull() static again

2016-06-10 Thread Christian Couder
As there is no caller of dup_devnull() outside run-command.c any more, let's make dup_devnull() static again. Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- run-command.c | 2 +- run-command.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/run-com

[PATCH v6 39/44] usage: add get_error_routine() and get_warn_routine()

2016-06-10 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 v6 31/44] run-command: make dup_devnull() non static

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

[PATCH v6 14/44] builtin/apply: make parse_traditional_patch() return -1 on error

2016-06-10 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 v6 12/44] builtin/apply: move check_apply_state() to apply.c

2016-06-10 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 v6 41/44] am: use be_silent in 'struct apply_state' to shut up applying patches

2016-06-10 Thread Christian Couder
Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- builtin/am.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index a16b06c..43f7316 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1525,7 +

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

2016-06-10 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 v6 25/44] builtin/apply: make try_create_file() return -1 on error

2016-06-10 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 v6 30/44] apply: make some parsing functions static again

2016-06-10 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 v6 26/44] builtin/apply: make create_one_file() return -1 on error

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

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

2016-06-10 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 v6 28/44] apply: rename and move opt constants to apply.h

2016-06-10 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 v6 27/44] builtin/apply: rename option parsing functions

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

2016-06-10 Thread Christian Couder
ine <sunsh...@sunshineco.com> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org> --- apply.c | 11 ++- apply.h | 6 +++--- builtin/apply.c | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apply.c b/apply.c index 1f31bb4..c5a9ee2 100644 --- a

[PATCH v6 17/44] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-06-10 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 v6 23/44] builtin/apply: make write_out_one_result() return -1 on error

2016-06-10 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 v6 16/44] builtin/apply: make gitdiff_*() return -1 on error

2016-06-10 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 v6 21/44] builtin/apply: make add_index_file() return -1 on error

2016-06-10 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 v6 07/44] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing

2016-06-10 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 v6 04/44] builtin/apply: make find_header() return -1 instead of die()ing

2016-06-10 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 v6 01/44] apply: move 'struct apply_state' to apply.h

2016-06-10 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. Helped-by: Eric Sunshine <sunsh...@sunshineco.com> Signed-off-by: Christian Coude

[PATCH v6 02/44] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-10 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 v6 00/44] libify apply and use lib in am, part 2

2016-06-10 Thread Christian Couder
lit index: 0m15.678s Ævar used his Debian laptop with SSD. - Around 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 reba

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

2016-06-09 Thread Christian Couder
On Wed, Jun 8, 2016 at 7:44 PM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Wed, Jun 8, 2016 at 12:37 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> On Mon, May 16, 2016 at 5:44 AM, Eric Sunshine <sunsh...@sunshineco.com> >> wrote:

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

2016-06-10 Thread Christian Couder
On Thu, Jun 9, 2016 at 11:10 PM, Johannes Sixt <j...@kdbg.org> wrote: > Am 12.05.2016 um 20:02 schrieb Christian Couder: >> >>> I'll also use it in production for a while, although I am not a git-am >>> consumer nor do I use git-rebase without -i, hence, my test

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

2016-06-10 Thread Christian Couder
Hi Dscho, On Fri, Jun 10, 2016 at 9:01 AM, Johannes Schindelin wrote: > Hi Hannes, > > On Thu, 9 Jun 2016, Johannes Sixt wrote: > >> Meanwhile, I have retrained my muscle memory to stop before typing "-i" after >> "rebase" for an opportunity to consider whether bare

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

2016-06-03 Thread Christian Couder
On Wed, Jun 1, 2016 at 7:23 PM, Junio C Hamano <gits...@pobox.com> wrote: > Christian Couder <christian.cou...@gmail.com> writes: > >> We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c >> keeps a linked list of all created lock_

[RFC/PATCH 2/8] external odb foreach

2016-06-13 Thread Christian Couder
From: Jeff King --- external-odb.c | 14 ++ external-odb.h | 6 ++ odb-helper.c | 15 +++ odb-helper.h | 4 4 files changed, 39 insertions(+) diff --git a/external-odb.c b/external-odb.c index 1ccfa99..42978a3 100644 --- a/external-odb.c

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