[PATCH 2/4] diff test: Add tests for combine-diff with orderfile

2014-01-20 Thread Kirill Smelkov
In the next patch combine-diff will have special code-path for taking orderfile into account. Prepare for making changes by introducing coverage tests for that case. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- t/t4056-diff-order.sh | 21 + 1 file changed, 21 insertions

[PATCH 3/4] combine-diff: Optimize combine_diff_path sets intersection

2014-01-20 Thread Kirill Smelkov
ratio here. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 93 +- 1 file changed, 72 insertions(+), 21 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index 3b92c448..98c2562 100644 --- a/combine-diff.c +++ b

[PATCH 1/4] diffcore-order: Export generic ordering interface

2014-01-20 Thread Kirill Smelkov
they have path accessors. The new interface is: - `struct obj_order`for describing objects to ordering routine, and - order_objects() for actually doing the ordering work. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- diffcore-order.c | 53

[PATCH 0/4] `log -c` speedup

2014-01-20 Thread Kirill Smelkov
apply. Thanks beforehand, Kirill Kirill Smelkov (4): diffcore-order: Export generic ordering interface diff test: Add tests for combine-diff with orderfile combine-diff: Optimize combine_diff_path sets intersection combine-diff: combine_diff_path.len is not needed anymore combine-diff.c

[PATCH 4/4] combine-diff: combine_diff_path.len is not needed anymore

2014-01-20 Thread Kirill Smelkov
Brefore previous patch, -len was used to speedup name compares and also to mark removed paths via len=0. Now we do significantly less strcmp and also just remove paths from list and free right after we know a path will not be needed, so -len is not needed anymore. Signed-off-by: Kirill Smelkov k

Re: [PATCH 3/4] combine-diff: Optimize combine_diff_path sets intersection

2014-01-28 Thread Kirill Smelkov
On Mon, Jan 20, 2014 at 08:20:40PM +0400, Kirill Smelkov wrote: [...] @@ -1343,6 +1374,26 @@ void diff_tree_combined(const unsigned char *sha1, if (p-len) num_paths++; } + + /* order paths according to diffcore_order */ + if (opt-orderfile

Re: [PATCH 3/4] combine-diff: Optimize combine_diff_path sets intersection

2014-01-29 Thread Kirill Smelkov
On Tue, Jan 28, 2014 at 01:55:09PM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: diff --git a/combine-diff.c b/combine-diff.c index 3b92c448..98c2562 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -15,8 +15,8 @@ ... + while (1

[PATCH 0/8] `log -c` speedup (part 2)

2014-02-03 Thread Kirill Smelkov
Kirill Smelkov (8): fixup! combine_diff: simplify intersect_paths() further tests: add checking that combine-diff emits only correct paths tree-diff: no need to manually verify that there is no mode change for a path tree-diff: no need to pass match to skip_uninteresting() combine-diff

[PATCH 1/8] fixup! combine_diff: simplify intersect_paths() further

2014-02-03 Thread Kirill Smelkov
the bug - when generating combine-diff, for merges with should-be empty `log -c` output, every second path was present in the diff. That, by the way, means we need to extend combine-diff tests somewhat. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 3 +-- 1 file changed, 1

[PATCH 6/8] combine-diff: Move changed-paths scanning logic into its own function

2014-02-03 Thread Kirill Smelkov
, but faster, paths scanning implementation in the next patch. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 79 ++ 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index 272931f

[PATCH 3/8] tree-diff: no need to manually verify that there is no mode change for a path

2014-02-03 Thread Kirill Smelkov
-tree recursion), which pre-dates base_name_compare() introduction in 958ba6c9 (Introduce base_name_compare() helper function) by a month. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tree-diff.c b

[PATCH 8/8] combine-diff: bail out early, if num_paths=0

2014-02-03 Thread Kirill Smelkov
That simplifies the code - instead of repeated checking for num_paths !=0, let's verify it once, and return if it is, and free following code from repeated ifs. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 52 +++- 1 file

[PATCH 4/8] tree-diff: no need to pass match to skip_uninteresting()

2014-02-03 Thread Kirill Smelkov
It is neither used there as input, nor the output written through it, is used outside. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index c2c67fd..f7b3ade 100644

[PATCH 5/8] combine-diff: move show_log_first logic/action out of paths scanning

2014-02-03 Thread Kirill Smelkov
care to explicitly not show anything if parents array is empty, as in fact there are some clients in Git code, which calls diff_tree_combined() in such a way. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 24 ++-- 1 file changed, 14 insertions

[PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-03 Thread Kirill Smelkov
stayed the same. (*) that 15.5/1.1 = ~14.1 ratio, is the most appropriate estimate for combine-diff speedup. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 85 +++- diff.c | 1 + diff.h | 6 + tree-diff.c| 411

[PATCH 2/8] tests: add checking that combine-diff emits only correct paths

2014-02-03 Thread Kirill Smelkov
to rework code for finding paths different to all parents, lets write at least basic tests. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- t/t4057-diff-combined-paths.sh | 106 + 1 file changed, 106 insertions(+) create mode 100755 t/t4057-diff-combined

Re: [PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-04 Thread Kirill Smelkov
On Mon, Feb 03, 2014 at 03:39:02PM -0800, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: Kirill Smelkov k...@mns.spb.ru writes: As was recently shown (c839f1bd combine-diff: optimize combine_diff_path sets intersection), combine-diff runs very slowly. In that commit we

Re: [PATCH 2/8] tests: add checking that combine-diff emits only correct paths

2014-02-05 Thread Kirill Smelkov
On Mon, Feb 03, 2014 at 03:10:08PM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: where correct paths stands for paths that are different to all parents. Up until now, we were testing combined diff only on one file, or on several files which were all different

Re: [PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-05 Thread Kirill Smelkov
On Tue, Feb 04, 2014 at 10:37:24AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: if we did not want to reinvent the whole tree walking thing, which would add risks for new bugs and burden to maintain this and the usual two-tree diff tree walking in sync. Junio, I

[PATCH 0/4] Teach diff_tree_sha1() to accept NULL sha1 for empty trees

2014-02-05 Thread Kirill Smelkov
Some preparatory patches for my reworked nparent tree-walker. Please apply. Thanks beforehand, Kirill Kirill Smelkov (4): tree-diff: allow diff_tree_sha1 to accept NULL sha1 tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL line-log: convert to using

[PATCH 1/4] tree-diff: allow diff_tree_sha1 to accept NULL sha1

2014-02-05 Thread Kirill Smelkov
reuse fill_tree_descriptor() which returns just empty tree_desc in that case. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index f7b3ade..f438478 100644 --- a/tree-diff.c

[PATCH 4/4] revision: convert to using diff_tree_sha1()

2014-02-05 Thread Kirill Smelkov
it is better to just say the tree is invalid here, which is what diff_tree_sha1() does for such case. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- revision.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/revision.c b/revision.c index 082dae6..bd027bc 100644

[PATCH 2/4] tree-diff: convert diff_root_tree_sha1() to just call diff_tree_sha1 with old=NULL

2014-02-05 Thread Kirill Smelkov
Now since diff_tree_sha1 understands NULL for both old and new, we could indicate an empty tree for root commit by providing just NULL for old sha1. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git

[PATCH 3/4] line-log: convert to using diff_tree_sha1()

2014-02-05 Thread Kirill Smelkov
Since diff_tree_sha1() can now accept empty trees via NULL sha1, we could just call it without manually reading trees into tree_desc and duplicating code. Cc: Thomas Rast t...@thomasrast.ch Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- line-log.c | 26 ++ 1 file

Re: [PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-05 Thread Kirill Smelkov
On Wed, Feb 05, 2014 at 09:36:55AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Only, before I clean things up, I'd like to ask - would the following patch be accepted 8 --- diff --git a/tree-walk.c b/tree-walk.c index 79dba1d..4dc86c7 100644 --- a/tree

Re: [PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-05 Thread Kirill Smelkov
On Wed, Feb 05, 2014 at 11:42:41AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: I agree object data should be immutable for good. The only thing I'm talking about here is mode, which is parsed from a tree buffer and is stored in separate field: Ah, I do

Re: [PATCH 7/8] combine-diff: Fast changed-to-all-parents paths scanning

2014-02-06 Thread Kirill Smelkov
On Wed, Feb 05, 2014 at 02:58:36PM -0800, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: On Wed, Feb 05, 2014 at 11:42:41AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: I agree object data should be immutable for good. The only thing I'm

[PATCH 00/11] More preparatory work for multiparent tree-walker

2014-02-07 Thread Kirill Smelkov
Kirill Smelkov (11): tree-diff: show_tree() is not needed tree-diff: consolidate code for emitting diffs and recursion in one place tree-diff: don't assume compare_tree_entry() returns -1,0,1 tree-diff: move all action-taking code out of compare_tree_entry() tree-diff: rename

[PATCH 03/11] tree-diff: don't assume compare_tree_entry() returns -1,0,1

2014-02-07 Thread Kirill Smelkov
for multiparent walker and will stay that way. =0 case goes first, because it happens more often in real diffs - i.e. paths are the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tree

[PATCH 10/11] tree-diff: no need to call full diff_tree_sha1 from show_path()

2014-02-07 Thread Kirill Smelkov
, as we have added a path and '/' before recursing. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index dd6c760..e385ed4 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -116,8 +116,8

[PATCH 09/11] tree-diff: rework diff_tree interface to be sha1 based

2014-02-07 Thread Kirill Smelkov
be renamed once more later, when its semantic will change to just generate paths for a diff, instead of producing it. So the current name is appropriate, but probably temporary. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- diff.h | 4 ++-- tree-diff.c | 60

[PATCH 11/11] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-02-07 Thread Kirill Smelkov
--raw --no-abbrev --no-renames` navy.gitlinux.git v3.10..v3.11 before 0.547s 1.791s after 0.541s 1.777s speedup 1.1%0.8% Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- diff.h | 2 +- tree-diff.c | 36

[PATCH 08/11] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-02-07 Thread Kirill Smelkov
iterated simultaneously, and some pair of them would run to the end. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 330ca07..7688402 100644 --- a/tree-diff.c

[PATCH 07/11] tree-diff: simplify tree_entry_pathcmp

2014-02-07 Thread Kirill Smelkov
-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 604dc57..330ca07 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -15,18 +15,13 @@ */ static int tree_entry_pathcmp(struct tree_desc

[PATCH 05/11] tree-diff: rename compare_tree_entry - tree_entry_pathcmp

2014-02-07 Thread Kirill Smelkov
to it. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 54a3d23..df90bbe 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -9,7 +9,14 @@ static void show_path(struct strbuf *base

[PATCH 01/11] tree-diff: show_tree() is not needed

2014-02-07 Thread Kirill Smelkov
. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index a8c2aec..2ad7788 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -55,25 +55,7 @@ static int

[PATCH 04/11] tree-diff: move all action-taking code out of compare_tree_entry()

2014-02-07 Thread Kirill Smelkov
it to was-already-there same switch/if, so the result is maybe a little bit faster. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index c3fbfba..54a3d23 100644 --- a/tree

[PATCH 02/11] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-07 Thread Kirill Smelkov
the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- tree-diff.c | 117 1 file changed, 86 insertions(+), 31 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 2ad7788..0c8e3fc 100644 --- a/tree-diff.c +++ b/tree-diff.c

Re: [PATCH 00/11] More preparatory work for multiparent tree-walker

2014-02-11 Thread Kirill Smelkov
On Mon, Feb 10, 2014 at 04:28:33PM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Here I'm preparing tree-diff.c to be ready for the new tree-walker, so that the final change is tractable and looks good and non noisy. Some small speedups are gained along the way

Re: [PATCH 00/11] More preparatory work for multiparent tree-walker

2014-02-12 Thread Kirill Smelkov
On Tue, Feb 11, 2014 at 11:59:02AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Sorry for the confusion. Could you please do the following: Patches should be applied over to ks/tree-diff-walk (74aa4a18). Before applying the patches, please cherry-pick

Re: [PATCH 11/11] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-02-13 Thread Kirill Smelkov
On Fri, Feb 07, 2014 at 09:48:52PM +0400, Kirill Smelkov wrote: instead of allocating it all the time for every subtree in __diff_tree_sha1, let's allocate it once in diff_tree_sha1, and then all callee just use it in stacking style, without memory allocations. This should be faster

[PATCH 0/2] Multiparent diff tree-walker + combine-diff speedup

2014-02-13 Thread Kirill Smelkov
, which for linux.git results in ~14 times speedup. I understand v1.9.0 is going to be released first, but wanted to finally send the patches, so that people could start reviewing them. Please apply on top of ks/tree-diff-more and thanks beforehand, Kirill Kirill Smelkov (2): tree-diff: rework

[PATCH 2/2] combine-diff: speed it up, by using multiparent diff tree-walker directly

2014-02-13 Thread Kirill Smelkov
The result stayed the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- combine-diff.c | 85 ++ diff.c | 1 + 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index 1732dfd..ddf7495

[PATCH 1/2] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-02-13 Thread Kirill Smelkov
motivation for combined diffs speedup. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- diff.c | 1 + diff.h | 10 ++ tree-diff.c | 501 3 files changed, 448 insertions(+), 64 deletions(-) diff --git a/diff.c b/diff.c index

Re: [PATCH 00/11] More preparatory work for multiparent tree-walker

2014-02-13 Thread Kirill Smelkov
On Wed, Feb 12, 2014 at 09:25:51AM -0800, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: Kirill Smelkov k...@mns.spb.ru writes: Sorry for the confusion. Could you please do the following: Patches should be applied over to ks/tree-diff-walk (74aa4a18). Before applying

Re: [PATCH 02/11] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-13 Thread Kirill Smelkov
On Thu, Feb 13, 2014 at 09:43:27AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: +static void show_path(struct strbuf *base, struct diff_options *opt, + struct tree_desc *t1, struct tree_desc *t2) { unsigned mode; const char *path

Re: [PATCH 2/2] combine-diff: speed it up, by using multiparent diff tree-walker directly

2014-02-14 Thread Kirill Smelkov
On Thu, Feb 13, 2014 at 11:55:08AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: + if (need_generic_pathscan) { + /* NOTE generic case also handles --stat, as it computes +* diff(sha1,parent_i) for all i to do the job, specifically

Re: [PATCH 1/2] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-02-14 Thread Kirill Smelkov
On Thu, Feb 13, 2014 at 11:51:19AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: + /* until we go to it next round, .next holds how many bytes we +* allocated (for faster realloc - we don't need copying old data

Re: [PATCH 1/2] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-02-16 Thread Kirill Smelkov
On Fri, Feb 14, 2014 at 09:37:00AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Previously diff_tree(), which is now named __diff_tree_sha1(), was That name with two leading underscores is a rather unfortunate, especially for a function that is not a file scope

[PATCH 02/19] combine-diff: move changed-paths scanning logic into its own function

2014-02-24 Thread Kirill Smelkov
, but faster, paths scanning implementation in the next patch. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) combine-diff.c | 80 ++ 1 file changed, 53 insertions

[PATCH v2 00/19] Multiparent diff tree-walker + combine-diff speedup

2014-02-24 Thread Kirill Smelkov
. Signoffs were left intact, if a patch was already applied to pu with one, and had not changed. Please apply and thanks, Kirill P.S. Sorry for the delay - I was very busy. Kirill Smelkov (19): combine-diff: move show_log_first logic/action out of paths scanning combine-diff: move changed

[PATCH 01/19] combine-diff: move show_log_first logic/action out of paths scanning

2014-02-24 Thread Kirill Smelkov
care to explicitly not show anything if parents array is empty, as in fact there are some clients in Git code, which calls diff_tree_combined() in such a way. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change

[PATCH 13/19] tree-diff: diff_tree() should now be static

2014-02-24 Thread Kirill Smelkov
We reworked all its users to use the functionality through diff_tree_sha1 variant in recent patches (see tree-diff: allow diff_tree_sha1 to accept NULL sha1 and what comes next). diff_tree() is now not used outside tree-diff.c - make it static. Signed-off-by: Kirill Smelkov k...@mns.spb.ru

[PATCH 09/19] tree-diff: rename compare_tree_entry - tree_entry_pathcmp

2014-02-24 Thread Kirill Smelkov
to it. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 6207372..3345534 100644 --- a/tree-diff.c

[PATCH 11/19] tree-diff: simplify tree_entry_pathcmp

2014-02-24 Thread Kirill Smelkov
-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index 20a4fda..cf96ad7 100644 --- a/tree-diff.c +++ b

[PATCH 06/19] tree-diff: consolidate code for emitting diffs and recursion in one place

2014-02-24 Thread Kirill Smelkov
the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 115 1 file changed, 84 insertions(+), 31 deletions(-) diff --git a/tree-diff.c b

[PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-02-24 Thread Kirill Smelkov
iterated simultaneously, and some pair of them would run to the end. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git

[PATCH 04/19] tree-diff: no need to pass match to skip_uninteresting()

2014-02-24 Thread Kirill Smelkov
It is neither used there as input, nor the output written through it, is used outside. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 17 - 1 file changed, 8 insertions(+), 9

[PATCH 19/19] combine-diff: speed it up, by using multiparent diff tree-walker directly

2014-02-24 Thread Kirill Smelkov
stayed the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) combine-diff.c | 88 ++ diff.c | 1 + 2 files changed, 84 insertions(+), 5 deletions

[PATCH 15/19] tree-diff: no need to call full diff_tree_sha1 from show_path()

2014-02-24 Thread Kirill Smelkov
, as we have added a path and '/' before recursing. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index

[PATCH 17/19] Portable alloca for Git

2014-02-24 Thread Kirill Smelkov
Cc: Petr Salinger petr.salin...@seznam.cz Cc: Jonathan Nieder jrnie...@gmail.com Cc: Thomas Schwinge tschwi...@gnu.org Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- ( new patch ) Makefile | 6 ++ config.mak.uname | 10 -- configure.ac | 8 git-compat

[PATCH 03/19] tree-diff: no need to manually verify that there is no mode change for a path

2014-02-24 Thread Kirill Smelkov
-tree recursion), which pre-dates base_name_compare() introduction in 958ba6c9 (Introduce base_name_compare() helper function) by a month. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 15

[PATCH 05/19] tree-diff: show_tree() is not needed

2014-02-24 Thread Kirill Smelkov
. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- ( re-posting without change ) tree-diff.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/tree-diff.c b/tree-diff.c index a8c2aec..2ad7788 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -55,25

[PATCH v2 18/19] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-02-24 Thread Kirill Smelkov
separate changes to a file), or an evil one, the map will not be full, i.e. some valid sha1 would be absent from it. That case was my initial motivation for combined diffs speedup. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- Changes since v1: - fixed last-minute thinko/bug last time

[PATCH 10/19] tree-diff: show_path prototype is not needed anymore

2014-02-24 Thread Kirill Smelkov
We moved all action-taking code below show_path() in recent HEAD~~ (tree-diff: move all action-taking code out of compare_tree_entry). Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 3 --- 1 file

[PATCH 08/19] tree-diff: move all action-taking code out of compare_tree_entry()

2014-02-24 Thread Kirill Smelkov
it to was-already-there same switch/if, so the result is maybe a little bit faster. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 28 1 file changed, 12 insertions(+), 16 deletions

[PATCH 07/19] tree-diff: don't assume compare_tree_entry() returns -1,0,1

2014-02-24 Thread Kirill Smelkov
for multiparent walker and will stay that way. =0 case goes first, because it happens more often in real diffs - i.e. paths are the same. Signed-off-by: Kirill Smelkov k...@mns.spb.ru Signed-off-by: Junio C Hamano gits...@pobox.com --- ( re-posting without change ) tree-diff.c | 22

[PATCH v2 16/19] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-02-24 Thread Kirill Smelkov
--raw --no-abbrev --no-renames --format='%H' navy.gitlinux.git v3.10..v3.11 before 0.618s 1.903s after 0.611s 1.889s speedup 1.1%0.7% Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- Changes since v1: - don't need to touch

Re: [PATCH v2 00/19] Multiparent diff tree-walker + combine-diff speedup

2014-02-25 Thread Kirill Smelkov
On Tue, Feb 25, 2014 at 06:43:24AM +0700, Duy Nguyen wrote: On Mon, Feb 24, 2014 at 11:21 PM, Kirill Smelkov k...@mns.spb.ru wrote: Hello up there. Here go combine-diff speedup patches in form of first reworking diff tree-walker to work in general case - when a commit have several parents

Re: [PATCH 17/19] Portable alloca for Git

2014-02-28 Thread Kirill Smelkov
On Fri, Feb 28, 2014 at 02:50:04PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 2:44 PM, Erik Faye-Lund kusmab...@gmail.com wrote: On Mon, Feb 24, 2014 at 5:21 PM, Kirill Smelkov k...@mns.spb.ru wrote: diff --git a/Makefile b/Makefile index dddaf4f..0334806 100644 --- a/Makefile

Re: [PATCH 17/19] Portable alloca for Git

2014-03-05 Thread Kirill Smelkov
On Fri, Feb 28, 2014 at 06:19:58PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 6:00 PM, Kirill Smelkov k...@mns.spb.ru wrote: On Fri, Feb 28, 2014 at 02:50:04PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 2:44 PM, Erik Faye-Lund kusmab...@gmail.com wrote: On Mon, Feb

Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-25 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:18:10PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: via teaching tree_entry_pathcmp() how to compare empty tree descriptors: Drop this line, as you explain the pretend empty compares bigger than anything else idea later anyway

Re: [PATCH v2 14/19] tree-diff: rework diff_tree interface to be sha1 based

2014-03-25 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:36:22PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: The downside is that try_to_follow_renames(), if active, we cause re-reading of 2 initial trees, which was negligible based on my timings, That would depend on how often the codepath

Re: [PATCH 11/19] tree-diff: simplify tree_entry_pathcmp

2014-03-25 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:25:04PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Since an earlier Finally switch over tree descriptors to contain a pre-parsed entry, we can safely access all tree_desc-entry fields directly instead of first extracting them through

Re: [PATCH v2 16/19] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-03-25 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:43:36PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: instead of allocating it all the time for every subtree in __diff_tree_sha1, let's allocate it once in diff_tree_sha1, and then all callee just use it in stacking style, without memory

Re: [PATCH v2 14/19] tree-diff: rework diff_tree interface to be sha1 based

2014-03-26 Thread Kirill Smelkov
On Tue, Mar 25, 2014 at 10:46:32AM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: What are the downsides of __ prefix by the way? Aren't these names reserved for compiler/runtime implementations? Yes, but there are precedents when people don't obey it widely

Re: [PATCH 17/19] Portable alloca for Git

2014-03-27 Thread Kirill Smelkov
On Mon, Mar 24, 2014 at 02:47:24PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: On Fri, Feb 28, 2014 at 06:19:58PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 6:00 PM, Kirill Smelkov k...@mns.spb.ru wrote: ... In fact that would be maybe preferred

Re: [PATCH v2 18/19] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-03-27 Thread Kirill Smelkov
On Mon, Feb 24, 2014 at 08:21:50PM +0400, Kirill Smelkov wrote: [...] not changed: - low-level helpers are still named with __ prefix as, imho, that is the best convention to name such helpers, without sacrificing signal/noise ratio. All of them are now static though. Please find

Re: [PATCH v2 16/19] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-03-27 Thread Kirill Smelkov
On Tue, Mar 25, 2014 at 01:23:20PM +0400, Kirill Smelkov wrote: On Mon, Mar 24, 2014 at 02:43:36PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: instead of allocating it all the time for every subtree in __diff_tree_sha1, let's allocate it once in diff_tree_sha1

Re: [PATCH 15/19] tree-diff: no need to call full diff_tree_sha1 from show_path()

2014-03-27 Thread Kirill Smelkov
On Mon, Feb 24, 2014 at 08:21:47PM +0400, Kirill Smelkov wrote: As described in previous commit, when recursing into sub-trees, we can use lower-level tree walker, since its interface is now sha1 based. The change is ok, because diff_tree_sha1() only invokes __diff_tree_sha1(), and also

Re: [PATCH v2 14/19] tree-diff: rework diff_tree interface to be sha1 based

2014-03-27 Thread Kirill Smelkov
On Wed, Mar 26, 2014 at 02:34:24PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: On Tue, Mar 25, 2014 at 10:46:32AM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: What are the downsides of __ prefix by the way? Aren't these names

Re: [PATCH v2 14/19] tree-diff: rework diff_tree interface to be sha1 based

2014-03-27 Thread Kirill Smelkov
+stefanbeller On Thu, Mar 27, 2014 at 11:48:11AM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: (please keep author email) 8 From: Kirill Smelkov k...@mns.spb.ru Date: Mon, 24 Feb 2014 20:21:46 +0400 Subject: [PATCH v3a] tree-diff: rework diff_tree

Re: [PATCH v2 18/19] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-04-06 Thread Kirill Smelkov
Junio, First of all thanks a lot for reviewing this patch. I'll reply inline with corrected version attached in the end. On Fri, Apr 04, 2014 at 11:42:39AM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: +extern +struct combine_diff_path *diff_tree_paths

Re: [PATCH v2 18/19] tree-diff: rework diff_tree() to generate diffs for multiparent cases as well

2014-04-07 Thread Kirill Smelkov
On Mon, Apr 07, 2014 at 10:29:46AM -0700, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: The following ... maybe looks a bit simpler, but calls tree_entry_pathcmp twice more times. Besides for important nparent=1 case we were not calling tree_entry_pathcmp at all

Re: [PATCH 17/19] Portable alloca for Git

2014-04-09 Thread Kirill Smelkov
On Thu, Mar 27, 2014 at 06:22:50PM +0400, Kirill Smelkov wrote: On Mon, Mar 24, 2014 at 02:47:24PM -0700, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: On Fri, Feb 28, 2014 at 06:19:58PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 6:00 PM, Kirill Smelkov k

[PATCH] Fix `make install` when configured with autoconf

2013-03-05 Thread Kirill Smelkov
there I get an error on install: install -d -m 755 '/bin' install -d -m 755 '/libexec/git-core' install: cannot create directory `/libexec': Permission denied Makefile:2292: recipe for target `install' failed Fix it. Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- config.mak.in

[PATCH] format-patch: RFC 2047 says multi-octet character may not be split

2013-03-06 Thread Kirill Smelkov
(). Not sure whether mbs_chrlen() is a good name, but otherwise my understanding is that the patch is ok to go in. Thanks. Cc: Jan H. Schönherr schn...@cs.tu-berlin.de Signed-off-by: Kirill Smelkov k...@mns.spb.ru --- pretty.c| 27 +++ t/t4014-format-patch.sh

Re: [PATCH] format-patch: RFC 2047 says multi-octet character may not be split

2013-03-07 Thread Kirill Smelkov
Junio, On Wed, Mar 06, 2013 at 09:47:53AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@mns.spb.ru writes: Intro - Drop this. We know the beginning part is intro already ;-) :) Subject: föö bar encoding Subject: =?UTF-8?q?=20f=C3=B6=C3=B6

Re: [PATCH] format-patch: RFC 2047 says multi-octet character may not be split

2013-03-09 Thread Kirill Smelkov
On Sat, Mar 09, 2013 at 07:27:23PM +0400, Kirill Smelkov wrote: 8 From: Kirill Smelkov k...@mns.spb.ru split Sorry for the confusion... 8 From: Kirill Smelkov k...@mns.spb.ru Even though an earlier attempt (bafc478..41dd00bad) cleaned up RFC 2047 encoding, pretty.c

Re: [PATCH] format-patch: RFC 2047 says multi-octet character may not be split

2013-03-09 Thread Kirill Smelkov
On Sat, Mar 09, 2013 at 11:07:19AM -0800, Junio C Hamano wrote: Kirill Smelkov k...@navytux.spb.ru writes: P.S. sorry for the delay - I harmed my arm yesterday. Ouch. Take care and be well soon. Thanks, and thanks fr accepting the patch. -- To unsubscribe from this list: send the line

[ANNOUNCE] Git-backup - Backup set of Git repositories & just files; efficiently

2016-01-27 Thread Kirill Smelkov
https://lab.nexedi.com/kirr/git-backup.git This program backups files and set of bare Git repositories into one Git repository. Files are copied to blobs and then added to tree under certain place, and for Git repositories, all reachable objects are pulled in with maintaining index which

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-27 Thread Kirill Smelkov
On Mon, Jul 25, 2016 at 02:40:25PM -0400, Jeff King wrote: > On Wed, Jul 13, 2016 at 01:52:17PM +0300, Kirill Smelkov wrote: > > > > So I think if you were to repeatedly "git repack -adb" over time, you > > > would get worse and worse ordering as objects

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-28 Thread Kirill Smelkov
Junio, first of all thanks for feedback, On Wed, Jul 27, 2016 at 01:40:36PM -0700, Junio C Hamano wrote: > Kirill Smelkov <k...@nexedi.com> writes: > > > > From: Kirill Smelkov <k...@nexedi.com> > > Subject: [PATCH 1/2] pack-objects: Make sure use_bitm

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-29 Thread Kirill Smelkov
On Thu, Jul 28, 2016 at 02:18:29PM -0700, Junio C Hamano wrote: > Kirill Smelkov <k...@nexedi.com> writes: > > > I'm waiting so long for main patch to be at least queued to pu, that I'm > > now a bit frustrated and ready to do something not related to main goal :) >

[PATCH v4 2/2] pack-objects: Teach it to use reachability bitmap index when generating non-stdout pack too

2016-07-29 Thread Kirill Smelkov
ion-control.git/299107 http://article.gmane.org/gmane.comp.version-control.git/299420 http://article.gmane.org/gmane.comp.version-control.git/300217 Cc: Vicent Marti <tan...@gmail.com> Helped-by: Jeff King <p...@peff.net> Signed-off-by: Kirill Smelkov <k...@nexedi.com> --- Docum

[PATCH 1/2] pack-objects: Teach --use-bitmap-index codepath to respect --local, --honor-pack-keep and --incremental

2016-07-29 Thread Kirill Smelkov
Since 6b8fda2d (pack-objects: use bitmaps when packing objects) there are two codepaths in pack-objects: with & without using bitmap reachability index. However add_object_entry_from_bitmap(), despite its non-bitmapped counterpart add_object_entry(), in no way does check for whether --local or

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-17 Thread Kirill Smelkov
On Wed, Jul 13, 2016 at 01:52:16PM +0300, Kirill Smelkov wrote: > On Wed, Jul 13, 2016 at 04:26:53AM -0400, Jeff King wrote: > > On Fri, Jul 08, 2016 at 01:38:55PM +0300, Kirill Smelkov wrote: > > > > > > - we will not compute the same write order (which is based on

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-19 Thread Kirill Smelkov
On Tue, Jul 19, 2016 at 05:29:07AM -0600, Jeff King wrote: > On Sun, Jul 17, 2016 at 08:06:49PM +0300, Kirill Smelkov wrote: > > > > Anyway, please find below updated patch according to your suggestion. > > > Hope it is ok now. > > > > Ping. Is the patch

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-12 Thread Kirill Smelkov
On Fri, Jul 08, 2016 at 01:38:55PM +0300, Kirill Smelkov wrote: > Peff first of all thanks for feedback, > > On Thu, Jul 07, 2016 at 04:52:23PM -0400, Jeff King wrote: > > On Thu, Jul 07, 2016 at 10:09:17PM +0300, Kirill Smelkov wrote: > > > > > Starting from 6b8fd

Re: [PATCH] pack-objects: Use reachability bitmap index when generating non-stdout pack too

2016-07-13 Thread Kirill Smelkov
On Wed, Jul 13, 2016 at 04:26:53AM -0400, Jeff King wrote: > On Fri, Jul 08, 2016 at 01:38:55PM +0300, Kirill Smelkov wrote: > > > > - we will not compute the same write order (which is based on > > > traversal order), leading to packs that h

  1   2   >