Re: Git 2.8.1 fails test 32 of t7300-clean.sh, breaks profile build

2016-05-03 Thread erik elfström
Thanks for fixing the missing SANITY prerequisite Stefan. As for the error handling logic in setup.c: is_nonbare_repository_dir (was clean.c: is_git_repository) my reasoning is as follows: READ_GITFILE_ERR_STAT_FAILED READ_GITFILE_ERR_NOT_A_FILE: When checking random paths for .git files these a

Re: [PATCH] t7300: fix broken && chains

2015-08-31 Thread erik elfström
On Mon, Aug 31, 2015 at 6:58 PM, Junio C Hamano wrote: > > Many of the constructs we see here shows clearly that this is an > ancient part of the codebase ;-), as we would be using the one > parameter form of "git init" and more test_* helpers if we were > writing this script in today's Git codeba

Re: [PATCH] t7300: fix broken && chains

2015-08-31 Thread erik elfström
On Mon, Aug 31, 2015 at 8:54 PM, Jeff King wrote: > On Sun, Aug 30, 2015 at 11:18:09AM +0200, Erik Elfström wrote: > > Unfortunately CHAIN_LINT cannot reach inside a nested subshell. I cannot > think of a way to make it do so, and besides, that is also the way to > overri

[PATCH] t7300: fix broken && chains

2015-08-30 Thread Erik Elfström
While we are here, remove some boilerplate by using test_commit. Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 27557d6..86ceb38 100755 --- a/t/t7300-clean.sh +++ b

Re: [PATCH v8 1/5] setup: add gentle version of read_gitfile

2015-06-26 Thread erik elfström
On Fri, Jun 26, 2015 at 11:03 AM, Jeff King wrote: > I happened to be playing with clang's static analyzer today, and it > noticed that there is a subtle use-after-free here. Doh, sorry about that. Thanks for fixing my bug. /Erik -- To unsubscribe from this list: send the line "unsubscribe git"

[PATCH v8 5/5] clean: improve performance when removing lots of directories

2015-06-15 Thread Erik Elfström
1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 30 ++ t/t7300-clean.sh | 10 -- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 6dcb72e..df53def 100644

[PATCH v8 0/5] Improving performance of git clean

2015-06-15 Thread Erik Elfström
This is v8 of this series. v7 can be found here: http://thread.gmane.org/gmane.comp.version-control.git/271220 Changes in v8: * change name and type of file size limit variable in read_git_file_gently Erik Elfström (5): setup: add gentle version of read_gitfile setup: sanity check file

[PATCH v8 4/5] p7300: add performance tests for clean

2015-06-15 Thread Erik Elfström
The tests are run in dry-run mode to avoid having to restore the test directories for each timed iteration. Using dry-run is an acceptable compromise since we are mostly interested in the initial computation of what to clean and not so much in the cleaning it self. Signed-off-by: Erik Elfström

[PATCH v8 3/5] t7300: add tests to document behavior of clean and nested git

2015-06-15 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 142 +++ 1 file changed, 142 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..fbfdf2d 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,148

[PATCH v8 1/5] setup: add gentle version of read_gitfile

2015-06-15 Thread Erik Elfström
Helped-by: Jeff King Signed-off-by: Erik Elfström --- cache.h | 11 - setup.c | 84 ++--- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/cache.h b/cache.h index 571c98f..25578cb 100644 --- a/cache.h +++ b/cache.h

[PATCH v8 2/5] setup: sanity check file size in read_gitfile_gently

2015-06-15 Thread Erik Elfström
fficiently unreasonable size that should never be exceeded by a genuine .git file. Signed-off-by: Erik Elfström --- cache.h | 1 + setup.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/cache.h b/cache.h index 25578cb..858d9b3 100644 --- a/cache.h +++ b/cache.h @@ -454,6 +454,7 @@ ex

Re: [PATCH v7 2/5] setup: sanity check file size in read_gitfile_gently

2015-06-14 Thread erik elfström
On Sun, Jun 14, 2015 at 5:42 AM, Eric Sunshine wrote: > > This variable name doesn't convey much about its purpose, and > introduces a bit of maintenance burden if the limit is some day > changed. Perhaps "sane_size_limit" or something even more descriptive > (and/or terse) would be better. > Wou

[PATCH v7 5/5] clean: improve performance when removing lots of directories

2015-06-09 Thread Erik Elfström
1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 30 ++ t/t7300-clean.sh | 10 -- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 6dcb72e..df53def 100644

[PATCH v7 0/5] Improving performance of git clean

2015-06-09 Thread Erik Elfström
. Erik Elfström (5): setup: add gentle version of read_gitfile setup: sanity check file size in read_gitfile_gently t7300: add tests to document behavior of clean and nested git p7300: add performance tests for clean clean: improve performance when removing lots of directories builtin

[PATCH v7 3/5] t7300: add tests to document behavior of clean and nested git

2015-06-09 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 142 +++ 1 file changed, 142 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..fbfdf2d 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,148

[PATCH v7 2/5] setup: sanity check file size in read_gitfile_gently

2015-06-09 Thread Erik Elfström
fficiently unreasonable size that should never be exceeded by a genuine .git file. Signed-off-by: Erik Elfström --- cache.h | 1 + setup.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/cache.h b/cache.h index 25578cb..858d9b3 100644 --- a/cache.h +++ b/cache.h @@ -454,6 +454,7 @@ ex

[PATCH v7 4/5] p7300: add performance tests for clean

2015-06-09 Thread Erik Elfström
The tests are run in dry-run mode to avoid having to restore the test directories for each timed iteration. Using dry-run is an acceptable compromise since we are mostly interested in the initial computation of what to clean and not so much in the cleaning it self. Signed-off-by: Erik Elfström

[PATCH v7 1/5] setup: add gentle version of read_gitfile

2015-06-09 Thread Erik Elfström
Helped-by: Jeff King Signed-off-by: Erik Elfström --- cache.h | 11 - setup.c | 84 ++--- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/cache.h b/cache.h index 571c98f..25578cb 100644 --- a/cache.h +++ b/cache.h

[PATCH v6 6/7] clean: improve performance when removing lots of directories

2015-05-10 Thread Erik Elfström
1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 31 +++ t/t7300-clean.sh | 10 -- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 98c103f..d739dcf

Re: [PATCH v5 5/5] clean: improve performance when removing lots of directories

2015-04-28 Thread erik elfström
On Tue, Apr 28, 2015 at 8:24 AM, Jeff King wrote: > > This iteration looks reasonable overall to me. > > Should this is_git_repository() helper be available to other files? I > think there are other calls to resolve_gitlink_ref() that would want the > same treatment (e.g., I think "git status" may

Re: [PATCH v5 1/5] setup: add gentle version of read_gitfile

2015-04-28 Thread erik elfström
On Tue, Apr 28, 2015 at 8:17 AM, Jeff King wrote: > > There was a discussion not too long ago on strategies for returning > errors, and one of the suggestions was to return an "error strbuf" > rather than a code[1]. That's less flexible, as the caller can't react > differently based on the type of

Re: [PATCH v5 4/5] p7300: add performance tests for clean

2015-04-28 Thread erik elfström
On Tue, Apr 28, 2015 at 8:33 AM, Jeff King wrote: > > Do we actually need a large repo here? The real cost is coming from the > directories we create. We could actually start with a totally empty > repository if we wanted (though I don't think the t/perf system handles > that right now). But if th

Re: [PATCH v5 2/5] setup: sanity check file size in read_gitfile_gently

2015-04-28 Thread erik elfström
On Tue, Apr 28, 2015 at 8:02 AM, Jeff King wrote: > > My understanding is that PATH_MAX is set absurdly low on Windows > systems (and doesn't actually represent the real limit of a path!). > Since the value is picked arbitrarily anyway, could use something more > independent (like 100K or somethin

[PATCH v5 5/5] clean: improve performance when removing lots of directories

2015-04-25 Thread Erik Elfström
tracked directory containing 10 sub directories went from 61s to 1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 26 ++ t/t7300-clean.sh | 8 +++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/buil

[PATCH v5 4/5] p7300: add performance tests for clean

2015-04-25 Thread Erik Elfström
The tests are run in dry-run mode to avoid having to restore the test directories for each timed iteration. Using dry-run is an acceptable compromise since we are mostly interested in the initial computation of what to clean and not so much in the cleaning it self. Signed-off-by: Erik Elfström

[PATCH v5 3/5] t7300: add tests to document behavior of clean and nested git

2015-04-25 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 128 +++ 1 file changed, 128 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..11f3a6d 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,134

[PATCH v5 2/5] setup: sanity check file size in read_gitfile_gently

2015-04-25 Thread Erik Elfström
fficiently unreasonable size that should never be exceeded by a genuine .git file. Signed-off-by: Erik Elfström --- cache.h | 1 + setup.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/cache.h b/cache.h index 868e4d3..c9f1f8e 100644 --- a/cache.h +++ b/cache.h @@ -439,6 +439,7 @@ ex

[PATCH v5 0/5] Improving performance of git clean

2015-04-25 Thread Erik Elfström
Changes in v5: * Added defines for read_gitfile_gently error codes. This was a silly mistake, sorry about that. Erik Elfström (5): setup: add gentle version of read_gitfile setup: sanity check file size in read_gitfile_gently t7300: add tests to document behavior of clean and nested git

[PATCH v5 1/5] setup: add gentle version of read_gitfile

2015-04-25 Thread Erik Elfström
Helped-by: Jeff King Signed-off-by: Erik Elfström --- cache.h | 11 - setup.c | 82 +++-- 2 files changed, 75 insertions(+), 18 deletions(-) diff --git a/cache.h b/cache.h index 3d3244b..868e4d3 100644 --- a/cache.h +++ b/cache.h

Re: [PATCH v4 2/5] setup: sanity check file size in read_gitfile_gently

2015-04-25 Thread Erik Elfström
On Sat, Apr 25, 2015 at 6:47 PM, Junio C Hamano wrote: > I do not think it is wrong per-se, but the changes in this patch > shows why hardcoded values assigned to error_code without #define is > not a good idea, as these values are now exposed to the callers of > the new function. After we gain a

[PATCH v4 3/5] t7300: add tests to document behavior of clean and nested git

2015-04-25 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 128 +++ 1 file changed, 128 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..11f3a6d 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,134

[PATCH v4 1/5] setup: add gentle version of read_gitfile

2015-04-25 Thread Erik Elfström
Helped-by: Jeff King Signed-off-by: Erik Elfström --- cache.h | 3 ++- setup.c | 82 +++-- 2 files changed, 67 insertions(+), 18 deletions(-) diff --git a/cache.h b/cache.h index 3d3244b..6e29068 100644 --- a/cache.h +++ b/cache.h

[PATCH v4 5/5] clean: improve performance when removing lots of directories

2015-04-25 Thread Erik Elfström
tracked directory containing 10 sub directories went from 61s to 1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 26 ++ t/t7300-clean.sh | 8 +++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/buil

[PATCH v4 4/5] p7300: add performance tests for clean

2015-04-25 Thread Erik Elfström
The tests are run in dry-run mode to avoid having to restore the test directories for each timed iteration. Using dry-run is an acceptable compromise since we are mostly interested in the initial computation of what to clean and not so much in the cleaning it self. Signed-off-by: Erik Elfström

[PATCH v4 2/5] setup: sanity check file size in read_gitfile_gently

2015-04-25 Thread Erik Elfström
fficiently unreasonable size that should never be exceeded by a genuine .git file. Signed-off-by: Erik Elfström --- I'm not sure about this one but it felt like the safe thing to do. This patch can be dropped if it is not desired. I considered testing it using "mkdir foo &&am

[PATCH v4 0/5] Improving performance of git clean

2015-04-25 Thread Erik Elfström
message in [5/5] to more clearly motivate remaining behavioral changes of git clean. Thanks to Junio C Hamano and Jeff King for comments and help on v3. Erik Elfström (5): setup: add gentle version of read_gitfile setup: sanity check file size in read_gitfile_gently t7300: add tests to

Re: [PATCH/RFC v3 0/4] Improving performance of git clean

2015-04-22 Thread erik elfström
On Wed, Apr 22, 2015 at 9:46 PM, Jeff King wrote: > On Wed, Apr 22, 2015 at 09:30:20PM +0200, erik elfström wrote: >> >> Yes, that is the problem. A dry run will spot this particular performance >> issue but maybe we lose some value as a general performance test if >>

Re: [PATCH/RFC v3 0/4] Improving performance of git clean

2015-04-22 Thread erik elfström
On Tue, Apr 21, 2015 at 11:24 PM, Jeff King wrote: > > If I understand correctly, the reason that you need per-run setup is > that your "git clean" command actually cleans things, and you need to > restore the original state for each time-trial. Can you instead use "git > clean -n" to do a dry-run

Re: [PATCH/RFC v3 0/4] Improving performance of git clean

2015-04-21 Thread erik elfström
tests, either directly in this series or as a follow up if that is preferred. /Erik On Tue, Apr 21, 2015 at 12:14 AM, Thomas Gummerer wrote: > On 04/18, Erik Elfström wrote: >> * Still have issues in the performance tests, see comments >> from Thomas Gummerer on v2 > &g

Re: [PATCH/RFC v3 0/4] Improving performance of git clean

2015-04-21 Thread erik elfström
On Sun, Apr 19, 2015 at 3:14 AM, Junio C Hamano wrote: > Erik Elfström writes: > >> Known Problems: >> * Unsure about the setup.c:read_gitfile refactor, feels a bit >> messy? > > The interface indeed feels somewhat messy. I suspect that a better

[PATCH/RFC v3 4/4] clean: improve performance when removing lots of directories

2015-04-18 Thread Erik Elfström
00 sub directories went from 61s to 1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 25 + t/t7300-clean.sh | 8 +++- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c

[PATCH/RFC v3 2/4] t7300: add tests to document behavior of clean and nested git

2015-04-18 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 127 +++ 1 file changed, 127 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..4b9a72a 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,133

[PATCH/RFC v3 3/4] p7300: add performance tests for clean

2015-04-18 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/perf/p7300-clean.sh | 37 + 1 file changed, 37 insertions(+) create mode 100755 t/perf/p7300-clean.sh diff --git a/t/perf/p7300-clean.sh b/t/perf/p7300-clean.sh new file mode 100755 index 000..af50d5d --- /dev/null

[PATCH/RFC v3 0/4] Improving performance of git clean

2015-04-18 Thread Erik Elfström
we won't clean either. How serious is this? Is there an easy fix (preferebly to clean all bare repositories)? * Still have issues in the performance tests, see comments from Thomas Gummerer on v2 Thanks to Junio C Hamano and Jeff King for spotting fundamental problems in v2 and suggesti

[PATCH/RFC v3 1/4] setup: add gentle version of read_gitfile

2015-04-18 Thread Erik Elfström
Helped-by: Jeff King Signed-off-by: Erik Elfström --- If this is going to be used for speculative probing should there be a sanity check before: buf = xmalloc(st.st_size + 1); len = read_in_full(fd, buf, st.st_size); Something like: if (st.st_size > PATH_MA

Re: [PATCH v2 3/3] clean: improve performance when removing lots of directories

2015-04-17 Thread erik elfström
On Wed, Apr 15, 2015 at 7:56 PM, Junio C Hamano wrote: > Erik Elfström writes: > >> Before this change, clean used resolve_gitlink_ref to check for the >> presence of nested git repositories. This had the drawback of creating >> a ref_cache entry for every directory th

Re: [PATCH v2 2/3] p7300: add performance tests for clean

2015-04-12 Thread erik elfström
On Sat, Apr 11, 2015 at 7:59 PM, Thomas Gummerer wrote: > On 04/11, Erik Elfström wrote: >> Signed-off-by: Erik Elfström >> --- >> t/perf/p7300-clean.sh | 37 + >> 1 file changed, 37 insertions(+) >> create mode 100755 t/per

[PATCH v2 3/3] clean: improve performance when removing lots of directories

2015-04-11 Thread Erik Elfström
1.7s after this change. Helped-by: Jeff King Signed-off-by: Erik Elfström --- builtin/clean.c | 24 t/t7300-clean.sh | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 98c103f..b679913 100644 --- a/builtin/cl

[PATCH v2 2/3] p7300: add performance tests for clean

2015-04-11 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/perf/p7300-clean.sh | 37 + 1 file changed, 37 insertions(+) create mode 100755 t/perf/p7300-clean.sh diff --git a/t/perf/p7300-clean.sh b/t/perf/p7300-clean.sh new file mode 100755 index 000..af50d5d --- /dev/null

[PATCH v2 1/3] t7300: add tests to document behavior of clean and nested git

2015-04-11 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/t7300-clean.sh | 72 1 file changed, 72 insertions(+) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 99be5d9..58e6b4a 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -455,6 +455,78

[PATCH v2 0/3] Improving performance of git clean

2015-04-11 Thread Erik Elfström
ray index * use size_t instead of int for strbuf->len fixes held back for cleanup patches: * fixed existing broken && chains * added assert in existing code to guard gainst negative array index Thanks to Eric Sunshine and Torsten Bögershausen for the very helpful review! Erik Elfströ

[PATCH v2 0/3] Improving performance of git clean

2015-04-11 Thread Erik Elfström
ray index * use size_t instead of int for strbuf->len fixes held back for cleanup patches: * fixed existing broken && chains * added assert in existing code to guard against negative array index Thanks to Eric Sunshine and Torsten Bögershausen for the very helpful review! Erik Elf

Re: [PATCH 3/3] clean: improve performance when removing lots of directories

2015-04-07 Thread erik elfström
On Tue, Apr 7, 2015 at 12:10 AM, Eric Sunshine wrote: > On Mon, Apr 6, 2015 at 7:48 AM, Erik Elfström wrote: >> Before this change, clean used resolve_gitlink_ref to check for the >> presence of nested git repositories. This had the drawback of creating >> a ref_cache entr

Re: [PATCH 2/3] p7300: added performance tests for clean

2015-04-07 Thread erik elfström
p" option to be called be before each iteration. On Tue, Apr 7, 2015 at 12:09 AM, Eric Sunshine wrote: > On Mon, Apr 6, 2015 at 4:40 PM, Torsten Bögershausen wrote: >> On 2015-04-06 13.48, Erik Elfström wrote: >>> Signed-off-by: Erik Elfström >>> --- >&g

Re: [PATCH 1/3] t7300: add tests to document behavior of clean and nested git

2015-04-07 Thread erik elfström
will fix! On Tue, Apr 7, 2015 at 12:06 AM, Eric Sunshine wrote: > On Mon, Apr 6, 2015 at 7:48 AM, Erik Elfström wrote: >> Signed-off-by: Erik Elfström >> --- >> diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh >> index 99be5d9..cfdf6d4 100755 >> --- a/t/t7300-c

[PATCH 1/3] t7300: add tests to document behavior of clean and nested git

2015-04-06 Thread Erik Elfström
Signed-off-by: Erik Elfström --- These tests were added so that I could understand the corner case behaviors of clean and nested repositories and document the changes in behavior that this series will cause. The ones marked as expect failure will be changed to expect success later in the series

[PATCH 2/3] p7300: added performance tests for clean

2015-04-06 Thread Erik Elfström
Signed-off-by: Erik Elfström --- t/perf/p7300-clean.sh | 37 + 1 file changed, 37 insertions(+) create mode 100755 t/perf/p7300-clean.sh diff --git a/t/perf/p7300-clean.sh b/t/perf/p7300-clean.sh new file mode 100755 index 000..3f56fb2 --- /dev/null

[PATCH 3/3] clean: improve performance when removing lots of directories

2015-04-06 Thread Erik Elfström
1.7s after this change. Signed-off-by: Erik Elfström Helped-by: Jeff King --- builtin/clean.c | 23 +++ t/t7300-clean.sh | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 98c103f..e951bd9 100644 --- a/builtin/cl

[PATCH 0/3] Improving performance of git clean

2015-04-06 Thread Erik Elfström
when reviewing. Jeff King also expressed concerns that we may have similar performance issues in other commands and that it could be good to unify these "is this a repo?"-checks. This series only attempts to solve the git-clean case. Erik Elfström (3): t7300: add tests to document behavi

Re: git clean performance issues

2015-04-04 Thread erik elfström
/Erik On Sat, Apr 4, 2015 at 9:55 PM, Jeff King wrote: > On Sat, Apr 04, 2015 at 08:32:45PM +0200, erik elfström wrote: > >> In my scenario get_ref_cache will be called 1+ times, each time >> with a new path. The final few calls will need to search through and >> compa

git clean performance issues

2015-04-04 Thread erik elfström
Hi, I'm having a performance issue with "git clean -qxfd" (note, not using "-ff"). The performance issue shows up when trying to clean untracked directories that themselves contain many sub directories. The performance is highly non linear with the number of sub directories. Some test numbers: D