[PATCH 00/12] Integrate commit-graph into fsck, gc, and fetch

2018-05-10 Thread Derrick Stolee
ent in my skills in this world, but the feature is worthless if it does not improve the user experience. Thanks, -Stolee Derrick Stolee (12): Commits 01-07 focus on the 'git commit-graph verify' subcommand. These are ready for full, rigorous review. commit-graph: add 'verify' subcommand co

Re: [PATCH 2/2] replace-object.c: remove the_repository from prepare_replace_object

2018-05-10 Thread Derrick Stolee
On 5/10/2018 7:56 AM, Jeff King wrote: On Thu, May 10, 2018 at 07:23:13PM +0900, Junio C Hamano wrote: This one was doing ptr = xmalloc(sizeof(*another_ptr)) and it was OK because ptr and another_ptr happened to be of the same type. I wonder if we are making it safer, or making it

Re: [PATCH 0/1] Fix UX issue with commit-graph.lock

2018-05-10 Thread Derrick Stolee
On 5/10/2018 3:00 AM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: We use the lockfile API to avoid multiple Git processes from writing to the commit-graph file in the .git/objects/info directory. In some cases, this directory may not exist, so we check f

Re: [PATCH 1/1] commit-graph: fix UX issue when .lock file exists

2018-05-09 Thread Derrick Stolee
On 5/9/2018 10:42 AM, Jeff King wrote: On Wed, May 09, 2018 at 02:15:38PM +, Derrick Stolee wrote: The commit-graph file lives in the .git/objects/info directory. Previously, a failure to acquire the commit-graph.lock file was assumed to be due to the lack of the info directory, so a mkdir

Re: Implementing reftable in Git

2018-05-09 Thread Derrick Stolee
On 5/9/2018 10:33 AM, Christian Couder wrote: Hi, I might start working on implementing reftable in Git soon. During the last Git Merge conference last March Stefan talked about reftable. In Alex Vandiver's notes [1] it is asked that people announce it on the list when they start working on

[PATCH 1/1] commit-graph: fix UX issue when .lock file exists

2018-05-09 Thread Derrick Stolee
fatal: cannot mkdir .git/objects/info: File exists" Rearrange the expectations of this directory existing to avoid this error, and instead show the typical message when a lockfile already exists. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 24 ---

[PATCH 0/1] Fix UX issue with commit-graph.lock

2018-05-09 Thread Derrick Stolee
e manually to continue. This patch is based on ds/generation-numbers Derrick Stolee (1): commit-graph: fix UX issue when .lock file exists commit-graph.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) base-commit: 7547b95b4fbb8591726b1d9381c176cc27fc6aea --

Re: What's cooking in git.git (May 2018, #01; Mon, 7)

2018-05-07 Thread Derrick Stolee
On 5/7/2018 10:58 AM, Junio C Hamano wrote: * ds/generation-numbers (2018-05-02) 11 commits - commit-graph.txt: update design document - merge: check config before loading commits - commit: use generation number in remove_redundant() - commit: add short-circuit to paint_down_to_common()

Re: [RFC] Other chunks for commit-graph, part 1 - Bloom filters, topo order, etc.

2018-05-07 Thread Derrick Stolee
//public-inbox.org/git/alpine.DEB.2.20.1803091557510.23109@alexmv-linux/ I think it was what Derrick Stolee was talking about at the end of his part of "Making Git for Windows" presentation at Git Merge 2018: https://youtu.be/oOMzi983Qmw?t=1835 This was also mentioned in subthread of &quo

Re: [PATCH v3 00/12] get_short_oid UI improvements

2018-05-02 Thread Derrick Stolee
On 5/2/2018 8:42 AM, Derrick Stolee wrote: On 5/1/2018 2:40 PM, Ævar Arnfjörð Bjarmason wrote: The biggest change in v3 is the no change at all to the code, but a lengthy explanation of why I didn't go for Derrick's simpler implementation. Maybe I'm wrong about that, but I felt uneasy

Re: [PATCH v4 08/10] commit: add short-circuit to paint_down_to_common()

2018-05-02 Thread Derrick Stolee
On 5/2/2018 9:05 AM, Jakub Narebski wrote: Derrick Stolee <sto...@gmail.com> writes:     For a copy of the Linux repository, we measured the following     performance improvements:     git merge-base v3.3 v4.5     Before: 234 ms After: 208 ms Rel %: -11%     git merg

Re: [PATCH v3 00/12] get_short_oid UI improvements

2018-05-02 Thread Derrick Stolee
On 5/1/2018 2:40 PM, Ævar Arnfjörð Bjarmason wrote: The biggest change in v3 is the no change at all to the code, but a lengthy explanation of why I didn't go for Derrick's simpler implementation. Maybe I'm wrong about that, but I felt uneasy offloading undocumented (or if I documented it, it

Re: [PATCH v5 09/11] commit: use generation number in remove_redundant()

2018-05-01 Thread Derrick Stolee
On 5/1/2018 8:47 AM, Derrick Stolee wrote: The static remove_redundant() method is used to filter a list of commits by removing those that are reachable from another commit in the list. This is used to remove all possible merge- bases except a maximal, mutually independent set. To determine

Re: [PATCH v2 06/11] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
On 5/1/2018 10:10 AM, Ævar Arnfjörð Bjarmason wrote: Actually I'm having second thoughts about that and thinking I might keep my original approach (with a better explanation). A few more lines of code seems worthwhile in order to not break the assumptions a documented API is making, no matter

Re: [PATCH v2 06/11] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
On 5/1/2018 9:39 AM, Ævar Arnfjörð Bjarmason wrote: On Tue, May 01 2018, Derrick Stolee wrote: From: Ævar Arnfjörð Bjarmason <ava...@gmail.com> Here is what I mean by sorting during for_each_abbrev(). This seems to work for me, so I don't know what the issue is with this one-pass ap

Re: [PATCH 4/9] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
On 5/1/2018 8:36 AM, Ævar Arnfjörð Bjarmason wrote: On Tue, May 01 2018, Derrick Stolee wrote: How would sorting in our custom order before de-duplicating fail the de-duplication? We will still pair identical OIDs as consecutive elements and oid_array_for_each_unique only cares about

[PATCH v2 06/11] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
¶rð Bjarmason <ava...@gmail.com> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- sha1-name.c | 31 + t/t1512-rev-parse-disambiguation.sh | 21 +++ 2 files changed, 52 insertions(+) diff --git a/sha1-name.c

[PATCH v5 07/11] commit: use generation numbers for in_merge_bases()

2018-05-01 Thread Derrick Stolee
--contains' was tested: Before: 60.0s After: 0.4s Rel %: -99.3% Reported-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 39a3749abd

[PATCH v5 01/11] ref-filter: fix outdated comment on in_commit_list

2018-05-01 Thread Derrick Stolee
The in_commit_list() method does not check the parents of the candidate for containment in the list. Fix the comment that incorrectly states that it does. Reported-by: Jakub Narebski <jna...@gmail.com> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- ref-filter.c | 2 +- 1

[PATCH v5 08/11] commit: add short-circuit to paint_down_to_common()

2018-05-01 Thread Derrick Stolee
After: 0.13s Rel %: -38% Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index 3ecdc13356..9875feec01 100644 --- a/commit.c +++ b/commit.c @@ -808,11 +8

[PATCH v5 03/11] commit-graph: compute generation numbers

2018-05-01 Thread Derrick Stolee
commits to the commit-graph file. If a computed generation number would exceed GENERATION_NUMBER_MAX, then use GENERATION_NUMBER_MAX instead. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 43 +++ 1 file changed, 43 inse

[PATCH v5 05/11] commit-graph: always load commit-graph information

2018-05-01 Thread Derrick Stolee
the given buffer. Only fill this information when specified by the 'check_graph' parameter. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 46 +++--- commit-graph.h | 8 commit.c | 7 +-- commit.h

[PATCH v5 11/11] commit-graph.txt: update design document

2018-05-01 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/technical/commit-graph.txt | 29 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Documentation/technical/commit-graph.txt b/Documentation/technical/commit-graph.txt index 0550c6d0dc..e1a883eb46

[PATCH v5 00/11] Compute and consume generation numbers

2018-05-01 Thread Derrick Stolee
ruct commit * for (i = 0; i < nr_reference; i++) { if (parse_commit(reference[i])) return ret; - if (min_generation > reference[i]->generation) + if (reference[i]->generation < min_generation)

[PATCH v5 06/11] ref-filter: use generation number for --contains

2018-05-01 Thread Derrick Stolee
is contained in v4.13 but no earlier tag, the command 'git tag --contains HEAD' had the following peformance improvement: Before: 0.81s After: 0.04s Rel %: -95% Helped-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- ref-filter.c | 24 +++

[PATCH v5 09/11] commit: use generation number in remove_redundant()

2018-05-01 Thread Derrick Stolee
in remove_redundant(). The relative change in performance differs as expected. Reported-by: Jakub Narebski <jna...@gmail.com> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 9875feec01

[PATCH v5 10/11] merge: check config before loading commits

2018-05-01 Thread Derrick Stolee
test to t5318-commit-graph.sh that exercises this code path to prevent a regression. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- builtin/merge.c | 7 --- t/t5318-commit-graph.sh | 9 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/builtin/merge.

[PATCH v5 02/11] commit: add generation number to struct commmit

2018-05-01 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- alloc.c| 1 + commit-graph.c | 2 ++ commit.h | 4 3 files changed, 7 insertions(+) diff --git a/alloc.c b/alloc.c index cf4f8b61e1..e8ab14f4a1 100644 --- a/alloc.c +++ b/alloc.c @@ -94,6 +94,7 @@ void *alloc_commit_nod

[PATCH v5 04/11] commit: use generations in paint_down_to_common()

2018-05-01 Thread Derrick Stolee
ers avoids this extra effort, even if it is somewhat rare. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 20 +++- commit.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 711f674c18..4d00b0a1d6 100644 --- a/commit.

Re: [PATCH 4/9] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
On 5/1/2018 7:27 AM, Ævar Arnfjörð Bjarmason wrote: On Tue, May 01 2018, Derrick Stolee wrote: On 4/30/2018 6:07 PM, Ævar Arnfjörð Bjarmason wrote: Since we show the commit data in the output that's nicely aligned once we sort by object type. The decision to show tags before commits is pretty

Re: [PATCH v4 05/10] commit-graph: always load commit-graph information

2018-05-01 Thread Derrick Stolee
On 4/29/2018 6:14 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: Most code paths load commits using lookup_commit() and then parse_commit(). And this automatically loads commit graph if needed, thanks to changes in parse_commit_gently(), which parse_commit(

Re: [PATCH v4 03/10] commit-graph: compute generation numbers

2018-05-01 Thread Derrick Stolee
On 4/29/2018 5:08 AM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: While preparing commits to be written into a commit-graph file, compute the generation numbers using a depth-first strategy. Sidenote: for generation numbers it does not matter if we use depth

Re: [PATCH v4 10/10] commit-graph.txt: update design document

2018-05-01 Thread Derrick Stolee
On 4/30/2018 7:32 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: We now calculate generation numbers in the commit-graph file and use them in paint_down_to_common(). Expand the section on generation numbers to discuss how the three special generation n

Re: [PATCH v4 09/10] merge: check config before loading commits

2018-05-01 Thread Derrick Stolee
On 4/30/2018 6:54 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: Now that we use generation numbers from the commit-graph, we must ensure that all commits that exist in the commit-graph are loaded from that file instead of from the object database. Since the

Re: [PATCH v4 08/10] commit: add short-circuit to paint_down_to_common()

2018-05-01 Thread Derrick Stolee
On 4/30/2018 6:19 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: When running 'git branch --contains', the in_merge_bases_many() method calls paint_down_to_common() to discover if a specific commit is reachable from a set of branches. Commits with lower gene

Re: [PATCH 0/9] get_short_oid UI improvements

2018-05-01 Thread Derrick Stolee
ons(-) This is a good series. Please take a look at my suggestion in Patch 4/9, but feel free to keep this series as written. Reviewed-by: Derrick Stolee <dsto...@microsoft.com>

Re: [PATCH 4/9] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Derrick Stolee
On 4/30/2018 6:07 PM, Ævar Arnfjörð Bjarmason wrote: Change the output emitted when an ambiguous object is encountered so that we show tags first, then commits, followed by trees, and finally blobs. Within each type we show objects in hashcmp(). Before this change the objects were only ordered

Re: branch --contains / tag --merged inconsistency

2018-04-30 Thread Derrick Stolee
On 4/27/2018 12:03 PM, SZEDER Gábor wrote: Szia Feri, I'm moving the IRC discussion here, because this might be a bug report in the end. So, kindly try these steps (103 MB free space required): $ git clone https://github.com/ClusterLabs/pacemaker.git && cd pacemaker [...] $ git branch

Re: [PATCH v4 02/10] commit: add generation number to struct commmit

2018-04-30 Thread Derrick Stolee
On 4/28/2018 6:35 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: The generation number of a commit is defined recursively as follows: * If a commit A has no parents, then the generation number of A is one. * If a commit A has parents, then the generation

Re: [PATCH] coccinelle: avoid wrong transformation suggestions from commit.cocci

2018-04-30 Thread Derrick Stolee
t. Signed-off-by: SZEDER Gábor <szeder@gmail.com> I applied this locally on 'next' and ran the check. I succeeded with no changes. Thanks! Reviewed-by: Derrick Stolee <dsto...@microsoft.com> --- contrib/coccinelle/commit.cocci | 10 -- 1 file changed, 4 inse

Re: [PATCH v4 03/10] commit-graph: compute generation numbers

2018-04-26 Thread Derrick Stolee
On 4/26/2018 8:58 AM, Derrick Stolee wrote: n 4/25/2018 10:35 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: @@ -439,6 +439,9 @@ static void write_graph_chunk_data(struct hashfile *f, int hash_len,   else   packedDate[

Re: [PATCH v4 03/10] commit-graph: compute generation numbers

2018-04-26 Thread Derrick Stolee
n 4/25/2018 10:35 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: @@ -439,6 +439,9 @@ static void write_graph_chunk_data(struct hashfile *f, int hash_len, else packedDate[0] = 0; + if ((*list)->g

Re: What's cooking in git.git (Apr 2018, #03; Wed, 25)

2018-04-26 Thread Derrick Stolee
On 4/25/2018 1:43 PM, Brandon Williams wrote: On 04/25, Ævar Arnfjörð Bjarmason wrote: * bw/protocol-v2 (2018-03-15) 35 commits (merged to 'next' on 2018-04-11 at 23ee234a2c) + remote-curl: don't request v2 when pushing + remote-curl: implement stateless-connect command + http:

Re: [PATCH v4 00/10] Compute and consume generation numbers

2018-04-25 Thread Derrick Stolee
As promised, here is the diff from v3. Thanks, -Stolee -- >8 -- diff --git a/builtin/merge.c b/builtin/merge.c index 7e1da6c6ea..b819756946 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1148,6 +1148,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)     branch =

[PATCH v4 09/10] merge: check config before loading commits

2018-04-25 Thread Derrick Stolee
test to t5318-commit-graph.sh that exercises this code path to prevent a regression. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- builtin/merge.c | 7 --- t/t5318-commit-graph.sh | 9 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/builtin/merge.

[PATCH v4 10/10] commit-graph.txt: update design document

2018-04-25 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/technical/commit-graph.txt | 30 +++- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/Documentation/technical/commit-graph.txt b/Documentation/technical/commit-graph.txt index 0550c6d0dc..d9f2713efa

[PATCH v4 04/10] commit: use generations in paint_down_to_common()

2018-04-25 Thread Derrick Stolee
ers avoids this extra effort, even if it is somewhat rare. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 20 +++- commit.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 711f674c18..4d00b0a1d6 100644 --- a/commit.

[PATCH v4 07/10] commit: use generation numbers for in_merge_bases()

2018-04-25 Thread Derrick Stolee
--contains' was tested: Before: 60.0s After: 0.4s Rel %: -99.3% Reported-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 39a3749abd

[PATCH v4 05/10] commit-graph: always load commit-graph information

2018-04-25 Thread Derrick Stolee
the given buffer. Only fill this information when specified by the 'check_graph' parameter. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 45 ++--- commit-graph.h | 8 commit.c | 7 +-- commit.h

[PATCH v4 08/10] commit: add short-circuit to paint_down_to_common()

2018-04-25 Thread Derrick Stolee
After: 0.13s Rel %: -38% Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index 7bb007f56a..e2e16ea1a7 100644 --- a/commit.c +++ b/commit.c @@ -808,11 +8

[PATCH v4 06/10] ref-filter: use generation number for --contains

2018-04-25 Thread Derrick Stolee
is containd in v4.13 but no earlier tag, the command 'git tag --contains HEAD' had the following peformance improvement: Before: 0.81s After: 0.04s Rel %: -95% Helped-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- ref-filter.c | 24 +++

[PATCH v4 02/10] commit: add generation number to struct commmit

2018-04-25 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- alloc.c| 1 + commit-graph.c | 2 ++ commit.h | 4 3 files changed, 7 insertions(+) diff --git a/alloc.c b/alloc.c index cf4f8b61e1..e8ab14f4a1 100644 --- a/alloc.c +++ b/alloc.c @@ -94,6 +94,7 @@ void *alloc_commit_nod

[PATCH v4 00/10] Compute and consume generation numbers

2018-04-25 Thread Derrick Stolee
for 'git tag --contains), providing a significant speedup (at least 95% for some cases). A more substantial refactoring of revision.c is required before making 'git log --graph' use generation numbers effectively. This patch series is built on ds/lazy-load-trees. Derrick Stolee (10): ref-filter:

[PATCH v4 03/10] commit-graph: compute generation numbers

2018-04-25 Thread Derrick Stolee
commits to the commit-graph file. If a computed generation number would exceed GENERATION_NUMBER_MAX, then use GENERATION_NUMBER_MAX instead. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 45 + 1 file changed, 45 inse

[PATCH v4 01/10] ref-filter: fix outdated comment on in_commit_list

2018-04-25 Thread Derrick Stolee
The in_commit_list() method does not check the parents of the candidate for containment in the list. Fix the comment that incorrectly states that it does. Reported-by: Jakub Narebski <jna...@gmail.com> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- ref-filter.c | 2 +- 1

Re: [PATCH v3 5/9] ref-filter: use generation number for --contains

2018-04-25 Thread Derrick Stolee
On 4/24/2018 2:56 PM, Jakub Narebski wrote: Derrick Stolee <sto...@gmail.com> writes: One way to fix this is to call 'prepare_commit_graph()' directly and then test that 'commit_graph' is non-null before performing any parses. I'm not thrilled with how that couples the commit

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-24 Thread Derrick Stolee
On 4/23/2018 5:38 PM, Jakub Narebski wrote: Derrick Stolee <sto...@gmail.com> writes: On 4/18/2018 7:19 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: [...] [...], and this saves time during 'git branch --contains' queries that would otherwise

Re: [PATCH v3 0/9] Compute and consume generation numbers

2018-04-23 Thread Derrick Stolee
On 4/18/2018 8:04 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: -- >8 -- This is the one of several "small" patches that follow the serialized Git commit graph patch (ds/commit-graph) and lazy-loading trees (ds/lazy-load-trees). As describ

Re: [PATCH v3 8/9] commit-graph: always load commit-graph information

2018-04-23 Thread Derrick Stolee
On 4/18/2018 8:02 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: Most code paths load commits using lookup_commit() and then parse_commit(). In some cases, including some branch lookups, the commit is parsed using parse_object_buffer() which side-steps parse_

Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-23 Thread Derrick Stolee
On 4/18/2018 7:19 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: [...] [...], and this saves time during 'git branch --contains' queries that would otherwise walk "around" the commit we are inspecting. If I understand the code properly, what happen

Re: [PATCH v3 6/9] commit: use generation numbers for in_merge_bases()

2018-04-23 Thread Derrick Stolee
On 4/18/2018 6:15 PM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: The containment algorithm for 'git branch --contains' is different from that for 'git tag --contains' in that it uses is_descendant_of() instead of contains_tag_algo(). The expensive p

Re: [PATCH v3 5/9] ref-filter: use generation number for --contains

2018-04-23 Thread Derrick Stolee
On 4/18/2018 5:02 PM, Jakub Narebski wrote: Here I can offer only the cursory examination, as I don't know this area of code in question. Derrick Stolee <dsto...@microsoft.com> writes: A commit A can reach a commit B only if the generation number of A is larger than the generation numbe

Re: [PATCH 0/6] Compute and consume generation numbers

2018-04-23 Thread Derrick Stolee
On 4/21/2018 4:44 PM, Jakub Narebski wrote: Jakub Narebski <jna...@gmail.com> writes: Derrick Stolee <sto...@gmail.com> writes: On 4/11/2018 3:32 PM, Jakub Narebski wrote: What would you suggest as a good test that could imply performance? The Google Colab notebook linked to ab

Re: [PATCH v10 00/36] Add directory rename detection to git

2018-04-19 Thread Derrick Stolee
On 4/19/2018 2:41 PM, Stefan Beller wrote: On Thu, Apr 19, 2018 at 11:35 AM, Elijah Newren wrote: On Thu, Apr 19, 2018 at 10:57 AM, Elijah Newren wrote: This series is a reboot of the directory rename detection series that was merged to master and then

Re: [PATCH v3 3/9] commit: use generations in paint_down_to_common()

2018-04-18 Thread Derrick Stolee
On 4/18/2018 10:31 AM, Jakub Narebski wrote: Derrick Stolee <dsto...@microsoft.com> writes: Define compare_commits_by_gen_then_commit_date(), which uses generation numbers as a primary comparison and commit date to break ties (or as a comparison when both commits do not have co

Re: What's cooking in git.git (Apr 2018, #02; Tue, 17)

2018-04-18 Thread Derrick Stolee
to say "this one is good" with good enough understanding of both the issue the series addresses and the solution in the series. I'm sorry that my second message was terse. My response to v1 [1] was > I looked through these patches and only found one set of whitespace > errors. Compi

Re: [RFC PATCH 00/12] Integrate commit-graph into 'fsck' and 'gc'

2018-04-17 Thread Derrick Stolee
On 4/17/2018 2:10 PM, Derrick Stolee wrote: The commit-graph feature is not useful to end users until the commit-graph file is maintained automatically by Git during normal upkeep operations. One natural place to trigger this write is during 'git gc'. Before automatically generating a commit

[RFC PATCH 05/12] commit-graph: check fanout and lookup table

2018-04-17 Thread Derrick Stolee
that file in advance. We perform this parse now to ensure the object cache contains only commits from this commit-graph file. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/commit-g

[RFC PATCH 00/12] Integrate commit-graph into 'fsck' and 'gc'

2018-04-17 Thread Derrick Stolee
This RFC is based on v3 of ds/generation-numbers, and the first commit is a fixup! based on a bug in that version that I caught while prepping this series. Thanks, -Stolee Derrick Stolee (12): fixup! commit-graph: always load commit-graph information commit-graph: add 'check' subcommand co

[RFC PATCH 03/12] commit-graph: check file header information

2018-04-17 Thread Derrick Stolee
During a run of 'git commit-graph check', list the issues with the header information in the commit-graph file. Some of this information is inferred from the loaded 'struct commit_graph'. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.

[RFC PATCH 11/12] gc: automatically write commit-graph files

2018-04-17 Thread Derrick Stolee
-trivial 'git gc' command. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/git-gc.txt | 4 builtin/gc.c | 8 2 files changed, 12 insertions(+) diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index 571b5a7e3c..17dd654a59

[RFC PATCH 02/12] commit-graph: add 'check' subcommand

2018-04-17 Thread Derrick Stolee
documentation. Add a simple test that ensures the command returns a zero error code. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/git-commit-graph.txt | 7 +- builtin/commit-graph.c | 38 ++ commit-graph.c

[RFC PATCH 08/12] commit-graph: verify commit contents against odb

2018-04-17 Thread Derrick Stolee
calculation is correct for all commits in the commit-graph file. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 82 ++ 1 file changed, 82 insertions(+) diff --git a/commit-graph.c b/commit-graph.c index 80a2

[RFC PATCH 09/12] fsck: check commit-graph

2018-04-17 Thread Derrick Stolee
If a commit-graph file exists, check its contents during 'git fsck'. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- builtin/fsck.c | 13 + 1 file changed, 13 insertions(+) diff --git a/builtin/fsck.c b/builtin/fsck.c index ef78c6c00c..9712f230ba 100644 --- a/b

[RFC PATCH 06/12] commit: force commit to parse from object database

2018-04-17 Thread Derrick Stolee
is explicit in avoiding commits from the commit-graph file. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 14 ++ commit.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index 9ef6f699bd..07752d8503

[RFC PATCH 01/12] fixup! commit-graph: always load commit-graph information

2018-04-17 Thread Derrick Stolee
--- commit-graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-graph.c b/commit-graph.c index 21e853c21a..3f0c142603 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -304,7 +304,7 @@ static int find_commit_in_graph(struct commit *item, struct commit_graph *g,

[RFC PATCH 10/12] commit-graph: add '--reachable' option

2018-04-17 Thread Derrick Stolee
' after performing cleanup of the object database. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/git-commit-graph.txt | 8 -- builtin/commit-graph.c | 41 +++--- t/t5318-commit-graph.sh| 10 3 files chang

[RFC PATCH 07/12] commit-graph: load a root tree from specific graph

2018-04-17 Thread Derrick Stolee
When lazy-loading a tree for a commit, it will be important to select the tree from a specific struct commit_graph. Create a new method that specifies the commit-graph file and use that in get_commit_tree_in_graph(). Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.

[RFC PATCH 12/12] commit-graph: update design document

2018-04-17 Thread Derrick Stolee
The commit-graph feature is now integrated with 'fsck' and 'gc', so remove those items from the "Future Work" section of the commit-graph design document. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/technical/commit-graph.txt | 9 - 1 file chan

[RFC PATCH 04/12] commit-graph: parse commit from chosen graph

2018-04-17 Thread Derrick Stolee
Before checking a commit-graph file against the object database, we need to parse all commits from the given commit-graph file. Create parse_commit_in_graph_one() to target a given struct commit_graph. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.

Re: [PATCH v3 8/9] commit-graph: always load commit-graph information

2018-04-17 Thread Derrick Stolee
On 4/17/2018 1:00 PM, Derrick Stolee wrote: Most code paths load commits using lookup_commit() and then parse_commit(). In some cases, including some branch lookups, the commit is parsed using parse_object_buffer() which side-steps parse_commit() in favor of parse_commit_buffer

[PATCH v3 9/9] merge: check config before loading commits

2018-04-17 Thread Derrick Stolee
test to t5318-commit-graph.sh that exercises this code path to prevent a regression. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- builtin/merge.c | 5 +++-- t/t5318-commit-graph.sh | 9 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/builtin/merge.

[PATCH v3 5/9] ref-filter: use generation number for --contains

2018-04-17 Thread Derrick Stolee
in v4.13 but no earlier tag, the command 'git tag --contains HEAD' had the following peformance improvement: Before: 0.81s After: 0.04s Rel %: -95% Helped-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- ref-filter.c | 23 +++

[PATCH v3 4/9] commit-graph.txt: update design document

2018-04-17 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- Documentation/technical/commit-graph.txt | 30 +++- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/Documentation/technical/commit-graph.txt b/Documentation/technical/commit-graph.txt index 0550c6d0dc..d9f2713efa

[PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

2018-04-17 Thread Derrick Stolee
After: 0.13s Rel %: -38% Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/commit.c b/commit.c index bceb79c419..a70f120878 100644 --- a/commit.c +++ b/commit.c @@ -805,11 +8

[PATCH v3 2/9] commit-graph: compute generation numbers

2018-04-17 Thread Derrick Stolee
commits to the commit-graph file. If a computed generation number would exceed GENERATION_NUMBER_MAX, then use GENERATION_NUMBER_MAX instead. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit-graph.c | 46 ++ 1 file changed, 46 inse

[PATCH v3 8/9] commit-graph: always load commit-graph information

2018-04-17 Thread Derrick Stolee
the given buffer. Only fill this information when specified by the 'check_graph' parameter. This avoids duplicate work when we already checked the graph in parse_commit_gently() or when simply checking the buffer contents in check_commit(). Signed-off-by: Derrick Stolee <dsto...@microsoft.

[PATCH v3 1/9] commit: add generation number to struct commmit

2018-04-17 Thread Derrick Stolee
-by: Derrick Stolee <dsto...@microsoft.com> --- alloc.c| 1 + commit-graph.c | 2 ++ commit.h | 4 3 files changed, 7 insertions(+) diff --git a/alloc.c b/alloc.c index cf4f8b61e1..e8ab14f4a1 100644 --- a/alloc.c +++ b/alloc.c @@ -94,6 +94,7 @@ void *alloc_commit_nod

[PATCH v3 6/9] commit: use generation numbers for in_merge_bases()

2018-04-17 Thread Derrick Stolee
--contains' was tested: Before: 60.0s After: 0.4s Rel %: -99.3% Reported-by: Jeff King <p...@peff.net> Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index a44899c733

[PATCH v3 0/9] Compute and consume generation numbers

2018-04-17 Thread Derrick Stolee
h series is build on ds/lazy-load-trees. Derrick Stolee (9): commit: add generation number to struct commmit commit-graph: compute generation numbers commit: use generations in paint_down_to_common() commit-graph.txt: update design document ref-filter: use generation number for --contains

[PATCH v3 3/9] commit: use generations in paint_down_to_common()

2018-04-17 Thread Derrick Stolee
ers avoids this extra effort, even if it is somewhat rare. Signed-off-by: Derrick Stolee <dsto...@microsoft.com> --- commit.c | 20 +++- commit.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/commit.c b/commit.c index 711f674c18..a44899c733 100644 --- a/commit.

Re: [PATCHv3 00/15] replace_object.c: rename to use dash in file name

2018-04-12 Thread Derrick Stolee
On 4/11/2018 8:21 PM, Stefan Beller wrote: v3: * interdiff below, the only changes are renaming the variable - struct ref_store *main_ref_store; + struct ref_store *refs; in struct repository. as well as dropping the file rename patch. * improved commit messages from

Re: [PATCH v2 07/10] commit-graph.txt: update future work

2018-04-12 Thread Derrick Stolee
On 4/12/2018 5:12 AM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: +Here is a diagram to visualize the shape of the full commit graph, and +how different generation numbers relate: + ++-+ +| GENERATION_NUMBER_IN

Re: [PATCH v8 03/14] commit-graph: add format document

2018-04-12 Thread Derrick Stolee
On 4/11/2018 4:58 PM, Jakub Narebski wrote: Derrick Stolee <sto...@gmail.com> writes: +CHUNK DATA: + + OID Fanout (ID: {'O', 'I', 'D', 'F'}) (256 * 4 bytes) + The ith entry, F[i], stores the number of OIDs with first + byte at most i. Thus F[255] stores the total +

Re: [PATCH resend] SubmittingPatches: mention the git contacts command

2018-04-11 Thread Derrick Stolee
On 4/11/2018 4:20 PM, Thomas Gummerer wrote: Instead of just mentioning 'git blame' and 'git shortlog', which make it quite hard for new contributors to pick out the appropriate list of people to cc on their patch series, mention the 'git contacts' utility, which makes it much easier to get a

Re: [PATCH 0/6] Compute and consume generation numbers

2018-04-11 Thread Derrick Stolee
On 4/11/2018 3:32 PM, Jakub Narebski wrote: What would you suggest as a good test that could imply performance? The Google Colab notebook linked to above includes a function to count number of commits (nodes / vertices in the commit graph) walked, currently in the worst case scenario. The two

Re: [PATCH v2 06/10] commit.c: use generation to halt paint walk

2018-04-11 Thread Derrick Stolee
On 4/10/2018 11:02 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: @@ -800,17 +810,26 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc return result; } prio_queue_put(, one); + i

Re: [PATCH v2 04/10] commit-graph: compute generation numbers

2018-04-11 Thread Derrick Stolee
On 4/10/2018 10:51 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: + if ((*list)->generation != GENERATION_NUMBER_INFINITY) { + if ((*list)->generation > GENERATION_NUMBER_MAX) + die(&qu

Re: [PATCH v2 03/10] commit: add generation number to struct commmit

2018-04-11 Thread Derrick Stolee
On 4/10/2018 10:31 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: The generation number of a commit is defined recursively as follows: * If a commit A has no parents, then the generation number of A is one. * If a commit A has parents, then the generation

Re: [PATCH v2 02/10] merge: check config before loading commits

2018-04-11 Thread Derrick Stolee
On 4/10/2018 10:12 PM, Junio C Hamano wrote: Derrick Stolee <dsto...@microsoft.com> writes: diff --git a/builtin/merge.c b/builtin/merge.c index ee050a47f3..20897f8223 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1183,13 +1183,14 @@ int cmd_merge(int argc, const char **argv,

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