[PATCH v7 12/22] commit-graph: verify root tree OIDs

2018-06-27 Thread Derrick Stolee
the object database. Add checks for the root tree OID. Signed-off-by: Derrick Stolee --- commit-graph.c | 17 - t/t5318-commit-graph.sh | 7 +++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/commit-graph.c b/commit-graph.c index 00e89b71e9

[PATCH v7 14/22] commit-graph: verify generation number

2018-06-27 Thread Derrick Stolee
have a mix of zero and non-zero generation numbers. Create a test that sets one commit to generation zero and all following commits report a failure as they have non-zero generation in a file that contains generation number zero. Signed-off-by: Derrick Stolee --- commit-graph.c | 34

[PATCH v7 13/22] commit-graph: verify parent list

2018-06-27 Thread Derrick Stolee
from the object database. Test these checks for corrupt parents, too many parents, and wrong parents. Add a boundary check to insert_parent_or_die() for when the parent position value is out of range. The octopus merge will be tested in a later commit. Signed-off-by: Derrick Stolee --- commit

[PATCH v7 16/22] commit-graph: test for corrupted octopus edge

2018-06-27 Thread Derrick Stolee
The commit-graph file has an extra chunk to store the parent int-ids for parents beyond the first parent for octopus merges. Our test repo has a single octopus merge that we can manipulate to demonstrate the 'verify' subcommand detects incorrect values in that chunk. Signed-off-by: Derrick Stolee

[PATCH v7 04/22] commit-graph: parse commit from chosen graph

2018-06-27 Thread Derrick Stolee
Before verifying 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 --- commit-graph.c | 18 +++--- 1 file changed, 15

[PATCH v7 07/22] commit-graph: add 'verify' subcommand

2018-06-27 Thread Derrick Stolee
state. Do not report any errors. Helped-by: Ramsay Jones Signed-off-by: Derrick Stolee --- Documentation/git-commit-graph.txt | 6 + builtin/commit-graph.c | 39 ++ commit-graph.c | 23 ++ commit-graph.h

[PATCH v7 00/22] Integrate commit-graph into 'fsck' and 'gc'

2018-06-27 Thread Derrick Stolee
From: Derrick Stolee This v7 has very little material difference from the previous version. The only changes are: * Rename 'gc.commitGraph' to 'gc.writeCommitGraph' * Add 't5318-commit-graph.sh: use core.commitGraph' patch that was dropped. * Rebase onto latest master, which appears to fix

[PATCH v7 05/22] commit: force commit to parse from object database

2018-06-27 Thread Derrick Stolee
is explicit in avoiding commits from the commit-graph file. Signed-off-by: Derrick Stolee --- commit.c | 10 -- commit.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 0c3b75aeff..598cf21cee 100644 --- a/commit.c +++ b/commit.c @@ -418,7

[PATCH v7 08/22] commit-graph: verify catches corrupt signature

2018-06-27 Thread Derrick Stolee
that is intended for a typical user. Helped-by: Szeder Gábor Signed-off-by: Derrick Stolee --- t/t5318-commit-graph.sh | 43 + 1 file changed, 43 insertions(+) diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 0830ef9fdd..c0c1ff09b9

[PATCH v7 01/22] t5318-commit-graph.sh: use core.commitGraph

2018-06-27 Thread Derrick Stolee
The commit-graph tests should be checking that normal Git operations succeed and have matching output with and without the commit-graph feature enabled. However, the test was toggling 'core.graph' instead of the correct 'core.commitGraph' variable. Signed-off-by: Derrick Stolee --- Junio, I

[PATCH v7 06/22] commit-graph: load a root tree from specific graph

2018-06-27 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 --- commit-graph.c | 12 +--- 1 file

[PATCH v7 02/22] commit-graph: UNLEAK before die()

2018-06-27 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- builtin/commit-graph.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 37420ae0fd..f0875b8bf3 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -51,8 +51,11 @@ static

[PATCH v7 03/22] commit-graph: fix GRAPH_MIN_SIZE

2018-06-27 Thread Derrick Stolee
the magic constants. Signed-off-by: Derrick Stolee --- commit-graph.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index b63a1fc85e..f83f6d2373 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -35,10 +35,11 @@ #define GRAPH_LAST_EDGE

Re: [PATCH v6 20/21] gc: automatically write commit-graph files

2018-06-25 Thread Derrick Stolee
On 6/8/2018 6:24 PM, SZEDER Gábor wrote: The commit-graph file is a very helpful feature for speeding up git operations. In order to make it more useful, make it possible to write the commit-graph file during standard garbage collection operations. Add a 'gc.commitGraph' config setting that

[PATCH v2 07/24] multi-pack-index: expand test data

2018-06-25 Thread Derrick Stolee
write the same file with no "real" data. This will be expanded in future commits, along with the test expectations. Signed-off-by: Derrick Stolee --- t/t5319-multi-pack-index.sh | 99 + 1 file changed, 99 insertions(+) diff --git a/t/t5319-multi-pack-

[PATCH v2 21/24] midx: use midx in approximate_object_count

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- packfile.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packfile.c b/packfile.c index 20b743da91..e72e8a685d 100644 --- a/packfile.c +++ b/packfile.c @@ -863,11 +863,14 @@ unsigned long approximate_object_count(void

[PATCH v2 22/24] midx: prevent duplicate packfile loads

2018-06-25 Thread Derrick Stolee
to the packed_git linked list or the MRU list. We still need to load the packfiles that are not tracked by the multi-pack-index. Signed-off-by: Derrick Stolee --- packfile.c | 9 + 1 file changed, 9 insertions(+) diff --git a/packfile.c b/packfile.c index e72e8a685d..f2b8d6f8a7 100644

[PATCH v2 20/24] midx: use existing midx when writing new one

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 107 ++--- midx.h | 1 + 2 files changed, 96 insertions(+), 12 deletions(-) diff --git a/midx.c b/midx.c index c258e3ebdf..02cbfc5bd5 100644 --- a/midx.c +++ b/midx.c @@ -47,7 +47,6 @@ struct

[PATCH v2 24/24] midx: clear midx on repack

2018-06-25 Thread Derrick Stolee
If a 'git repack' command replaces existing packfiles, then we must clear the existing multi-pack-index before moving the packfiles it references. Signed-off-by: Derrick Stolee --- builtin/repack.c | 8 midx.c | 8 midx.h | 1 + 3 files changed, 17

[PATCH v2 23/24] packfile: skip loading index if in multi-pack-index

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- packfile.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packfile.c b/packfile.c index f2b8d6f8a7..acd02430a8 100644 --- a/packfile.c +++ b/packfile.c @@ -469,8 +469,19 @@ static int open_packed_git_1(struct packed_git

[PATCH v2 17/24] midx: prepare midxed_git struct

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 22 ++ midx.h | 3 +++ object-store.h | 9 + packfile.c | 6 +- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/midx.c b/midx.c index 71ca493107..3dd5027dc6 100644 --- a/midx.c +++ b

[PATCH v2 10/24] multi-pack-index: write pack names in chunk

2018-06-25 Thread Derrick Stolee
-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 6 + midx.c | 190 ++-- object-store.h | 2 + t/helper/test-read-midx.c | 7 + t/t5319-multi-pack-index.sh | 3 +- 5 files

[PATCH v2 19/24] midx: use midx in abbreviation calculations

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 11 ++ midx.h | 3 ++ packfile.c | 6 packfile.h | 1 + sha1-name.c | 70 + t/t5319-multi-pack-index.sh | 3

[PATCH v2 18/24] midx: read objects from multi-pack-index

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 93 -- midx.h | 2 ++ object-store.h | 1 + packfile.c | 8 - 4 files changed, 101 insertions(+), 3 deletions(-) diff --git a/midx.c b/midx.c index 3dd5027dc6..14514d6828 100644

[PATCH v2 15/24] midx: write object offsets

2018-06-25 Thread Derrick Stolee
does not match the actual packfile offsets. The multi-pack-index offset does match the (corrupted) pack-index offset, so a future feature will compare these offsets during a 'verify' step. Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 15 +++- midx.c

[PATCH v2 16/24] config: create core.multiPackIndex setting

2018-06-25 Thread Derrick Stolee
on and off. This currently includes 'git rev-list' and 'git log' commands to trigger several object database reads. Signed-off-by: Derrick Stolee --- Documentation/config.txt| 4 +++ cache.h | 1 + config.c| 5 environment.c | 1

[PATCH v2 02/24] multi-pack-index: add format details

2018-06-25 Thread Derrick Stolee
hat writes that information. Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 49 + 1 file changed, 49 insertions(+) diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt index 70a99fd142..e060e69

[PATCH v2 13/24] midx: write object ids in a chunk

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 4 ++ midx.c | 51 ++--- object-store.h | 1 + t/helper/test-read-midx.c | 2 + t/t5319-multi-pack-index.sh | 4

[PATCH v2 14/24] midx: write object id fanout chunk

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 5 +++ midx.c | 53 +++-- object-store.h | 1 + t/helper/test-read-midx.c | 4 +- t/t5319-multi-pack-index.sh

[PATCH v2 12/24] midx: sort and deduplicate objects from packfiles

2018-06-25 Thread Derrick Stolee
the data, copy to a local array, then sort. Copy only the de-duplicated entries. Select the duplicate based on the most-recent modified time of a packfile containing the object. Signed-off-by: Derrick Stolee --- midx.c | 127 + packfile.c

[PATCH v2 09/24] multi-pack-index: read packfile list

2018-06-25 Thread Derrick Stolee
When constructing a multi-pack-index file for a given object directory, read the files within the enclosed pack directory and find matches that end with ".idx" and find the correct paired packfile using add_packed_git(). Signed-off-by: Derrick Stolee --- midx.c

[PATCH v2 06/24] multi-pack-index: load into memory

2018-06-25 Thread Derrick Stolee
Create a new multi_pack_index struct for loading multi-pack-indexes into memory. Create a test-tool builtin for reading basic information about that multi-pack-index to verify the correct data is written. Signed-off-by: Derrick Stolee --- Makefile| 1 + midx.c

[PATCH v2 11/24] midx: read pack names into array

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- midx.c | 31 +++ object-store.h | 1 + t/helper/test-read-midx.c | 5 + t/t5319-multi-pack-index.sh | 7 ++- 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/midx.c b/midx.c

[PATCH v2 05/24] midx: write header information to lockfile

2018-06-25 Thread Derrick Stolee
the return value in a later commit. Signed-off-by: Derrick Stolee --- midx.c | 49 + t/t5319-multi-pack-index.sh | 3 ++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/midx.c b/midx.c index 32468db1a2..393d526881 100644

[PATCH v2 08/24] packfile: generalize pack directory list

2018-06-25 Thread Derrick Stolee
In anticipation of sharing the pack directory listing with the multi-pack-index, generalize prepare_packed_git_one() into for_each_file_in_pack_dir(). Signed-off-by: Derrick Stolee --- packfile.c | 103 + packfile.h | 6 2 files changed

[PATCH v2 03/24] multi-pack-index: add builtin

2018-06-25 Thread Derrick Stolee
This new 'git multi-pack-index' builtin will be the plumbing access for writing, reading, and checking multi-pack-index files. The initial implementation is a no-op. Signed-off-by: Derrick Stolee --- .gitignore | 3 +- Documentation/git-multi-pack-index.txt | 36

[PATCH v2 01/24] multi-pack-index: add design document

2018-06-25 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- Documentation/technical/multi-pack-index.txt | 109 +++ 1 file changed, 109 insertions(+) create mode 100644 Documentation/technical/multi-pack-index.txt diff --git a/Documentation/technical/multi-pack-index.txt b/Documentation/technical/multi

[PATCH v2 00/24] Multi-pack-index (MIDX)

2018-06-25 Thread Derrick Stolee
From: Derrick Stolee This v2 patch has several significant changes from v1. Thanks for all the feedback that informed these changes: * The 'midx' builtin is renamed to 'multi-pack-index' * The 'core.midx' config setting is renamed to 'core.multiPackIndex' * Many die() or error() statements

[PATCH v2 04/24] multi-pack-index: add 'write' verb

2018-06-25 Thread Derrick Stolee
In anticipation of writing multi-pack-indexes, add a 'git multi-pack-index write' subcommand and send the options to a write_midx_file() method. Also create a basic test file that tests the 'write' subcommand. Signed-off-by: Derrick Stolee --- Documentation/git-multi-pack-index.txt | 22

Re: [PATCH 23/23] midx: clear midx on repack

2018-06-22 Thread Derrick Stolee
On 6/9/2018 2:13 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:07 PM Derrick Stolee wrote: If a 'git repack' command replaces existing packfiles, then we must clear the existing multi-pack-index before moving the packfiles it references. I think there are other places where we add or remove

Re: [PATCH 20/23] midx: use midx in approximate_object_count

2018-06-22 Thread Derrick Stolee
On 6/9/2018 2:03 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:06 PM Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- packfile.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packfile.c b/packfile.c index 638e113972..059b2aa097 100644 --- a/packfile.c

Re: [PATCH 18/23] midx: use midx in abbreviation calculations

2018-06-22 Thread Derrick Stolee
On 6/9/2018 2:01 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:06 PM Derrick Stolee wrote: @@ -565,8 +632,11 @@ static void find_abbrev_len_for_pack(struct packed_git *p, static void find_abbrev_len_packed(struct min_abbrev_data *mad) { + struct midxed_git *m; struct

Re: [PATCH 09/23] midx: write pack names in chunk

2018-06-22 Thread Derrick Stolee
On 6/22/2018 2:31 PM, Junio C Hamano wrote: Derrick Stolee writes: The index extension documentation doesn't appear to be clear about which extensions are optional or required, but it seems the split-index is the only "required" one and uses lowercase for its extension id. re

Re: [PATCH 09/23] midx: write pack names in chunk

2018-06-22 Thread Derrick Stolee
On 6/21/2018 1:38 PM, Junio C Hamano wrote: Derrick Stolee writes: On 6/7/2018 2:26 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: @@ -74,6 +80,31 @@ struct midxed_git *load_midxed_git(const char *object_dir) m->num_chunks = *(m->da

Re: [PATCH 5/5] commit-graph: add repo arg to graph readers

2018-06-21 Thread Derrick Stolee
On 6/21/2018 8:33 PM, Derrick Stolee wrote: On 6/21/2018 7:06 PM, Jonathan Tan wrote: diff --git a/commit.c b/commit.c index 0030e79940..38c12b002f 100644 --- a/commit.c +++ b/commit.c @@ -317,7 +317,7 @@ struct tree *get_commit_tree(const struct commit *commit) if (commit->graph_

Re: The state of the object store series

2018-06-21 Thread Derrick Stolee
[My email client says I sent this two days ago, but it doesn't appear on public-inbox.org, so somehow it didn't land on-list (Stefan pointed out that the message was in HTML). Repeating the message now so I can reference it in another discussion. -Stolee] On 6/19/2018 6:07 PM, Stefan Beller

Re: [PATCH 5/5] commit-graph: add repo arg to graph readers

2018-06-21 Thread Derrick Stolee
On 6/21/2018 7:06 PM, Jonathan Tan wrote: diff --git a/commit.c b/commit.c index 0030e79940..38c12b002f 100644 --- a/commit.c +++ b/commit.c @@ -317,7 +317,7 @@ struct tree *get_commit_tree(const struct commit *commit) if (commit->graph_pos == COMMIT_NOT_FROM_GRAPH)

Re: [PATCH 2/5] commit-graph: add missing forward declaration

2018-06-21 Thread Derrick Stolee
On 6/21/2018 6:39 PM, Jonathan Tan wrote: Both this and the previous patch look good to me; you seem to have better (stricter) checking for missing includes/forward declarations, am I missing a compile option? (I have DEVELOPER=1 in config.mak) Thanks. No I don't - I discovered that these were

Re: [PATCH 17/23] midx: read objects from multi-pack-index

2018-06-21 Thread Derrick Stolee
On 6/9/2018 1:56 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 6:55 PM Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- midx.c | 96 -- midx.h | 2 ++ object-store.h | 1 + packfile.c | 8 - 4 files changed

Re: [PATCH 13/23] midx: write object id fanout chunk

2018-06-21 Thread Derrick Stolee
On 6/9/2018 1:28 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:06 PM Derrick Stolee wrote: @@ -117,9 +123,13 @@ struct midxed_git *load_midxed_git(const char *object_dir) die("MIDX missing required pack lookup chunk"); if (!m->chunk_pack_names)

Re: [PATCH 11/23] midx: sort and deduplicate objects from packfiles

2018-06-21 Thread Derrick Stolee
On 6/9/2018 1:07 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:06 PM Derrick Stolee wrote: Before writing a list of objects and their offsets to a multi-pack-index (MIDX), we need to collect the list of objects contained in the packfiles. There may be multiple copies of some objects, so

Re: [PATCH 10/23] midx: write a lookup into the pack names chunk

2018-06-21 Thread Derrick Stolee
On 6/9/2018 12:43 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 7:01 PM Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- Documentation/technical/pack-format.txt | 5 +++ builtin/midx.c | 7 midx.c | 56

Re: [PATCH 09/23] midx: write pack names in chunk

2018-06-21 Thread Derrick Stolee
On 6/7/2018 2:26 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: @@ -74,6 +80,31 @@ struct midxed_git *load_midxed_git(const char *object_dir) m->num_chunks = *(m->data + 6); m->num_packs = get_be32(m->data + 8); + for (

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/20/2018 11:07 AM, Duy Nguyen wrote: On Wed, Jun 20, 2018 at 3:33 PM Derrick Stolee wrote: On 6/7/2018 2:31 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt index dcaeb1a91b..919283fdd8

[PATCH] packfile: generalize pack directory list

2018-06-20 Thread Derrick Stolee
In anticipation of sharing the pack directory listing with the multi-pack-index, generalize prepare_packed_git_one() into for_each_file_in_pack_dir(). Signed-off-by: Derrick Stolee --- Duy, I think this is what you mean by sharing code between packfile.c and midx.c for reading the packfiles

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/7/2018 2:31 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt index dcaeb1a91b..919283fdd8 100644 --- a/Documentation/git-midx.txt +++ b/Documentation/git-midx.txt @@ -23,6 +23,11 @@ OPTIONS

Re: [PATCH 06/23] midx: struct midxed_git and 'read' subcommand

2018-06-20 Thread Derrick Stolee
On 6/7/2018 1:54 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: As we build the multi-pack-index feature by adding chunks at a time, we want to test that the data is being written correctly. Create struct midxed_git to store an in-memory representation

Re: [PATCH] ewah: delete unused 'rlwit_discharge_empty()'

2018-06-19 Thread Derrick Stolee
On 6/19/2018 5:51 PM, Ramsay Jones wrote: From: Junio C Hamano Complete the removal of unused 'ewah bitmap' code by removing the now unused 'rlwit_discharge_empty()' function. Also, the 'ewah_clear()' function can now be made a file-scope static symbol. Signed-off-by: Ramsay Jones --- Hi

Re: [PATCH 05/23] midx: write header information to lockfile

2018-06-19 Thread Derrick Stolee
On 6/19/2018 10:59 AM, Duy Nguyen wrote: On Tue, Jun 19, 2018 at 2:54 PM Derrick Stolee wrote: On 6/12/2018 11:00 AM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 7:01 PM Derrick Stolee wrote: diff --git a/midx.c b/midx.c index 616af66b13..3e55422a21 100644 --- a/midx.c +++ b/midx.c @@ -1,9

Re: [PATCH 01/15] contrib: add cocci script to replace index compat macros

2018-06-19 Thread Derrick Stolee
On 6/19/2018 10:51 AM, Duy Nguyen wrote: On Tue, Jun 19, 2018 at 1:41 PM Derrick Stolee wrote: Duy, Here is the patch that was generated by `make coccicheck`. Thanks, -Stolee -->8-- --- builtin/add.c Ah right. This is on purpose. I think I mentioned in the commit message that buil

Re: [PATCH 05/23] midx: write header information to lockfile

2018-06-19 Thread Derrick Stolee
On 6/12/2018 11:00 AM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 7:01 PM Derrick Stolee wrote: diff --git a/midx.c b/midx.c index 616af66b13..3e55422a21 100644 --- a/midx.c +++ b/midx.c @@ -1,9 +1,62 @@ #include "git-compat-util.h" #include "cache.h" #include &qu

Re: [PATCH 00/15] Kill the_index part 1, expose it

2018-06-19 Thread Derrick Stolee
On 6/16/2018 1:41 AM, Nguyễn Thái Ngọc Duy wrote: This is the beginning of the end of the_index. The problem with the_index is it lets library code anywhere access it freely. This is not good because from high level you may not realize that the_index is being used while you don't want to touch

Re: [PATCH 01/15] contrib: add cocci script to replace index compat macros

2018-06-19 Thread Derrick Stolee
Duy, Here is the patch that was generated by `make coccicheck`. Thanks, -Stolee -->8-- --- builtin/add.c +++ /tmp/cocci-output-206193-4c91ec-add.c @@ -38,13 +38,13 @@ static void chmod_pathspec(struct pathsp { int i; - for (i = 0; i < active_nr; i++) { - struct

Re: [PATCH 01/15] contrib: add cocci script to replace index compat macros

2018-06-19 Thread Derrick Stolee
On 6/16/2018 1:41 AM, Nguyễn Thái Ngọc Duy wrote: Index compat macros are going to be removed to expose the_index and then reorganized to use the right index instead of simply the_index because sometimes we want to use a different index. This cocci script can help with the first step. It can be

Re: [PATCH 03/23] midx: add midx builtin

2018-06-18 Thread Derrick Stolee
On 6/18/2018 3:55 PM, Stefan Beller wrote: But as this is plumbing and users should not need to worry about it this is optional, I would think. The design document is also in 'Documentation/technical' instead of just 'Documentation/'. Do we have a pattern of linking to the technical documents?

Re: [PATCH 03/23] midx: add midx builtin

2018-06-18 Thread Derrick Stolee
On 6/11/2018 5:02 PM, Stefan Beller wrote: Hi Derrick, On Thu, Jun 7, 2018 at 7:03 AM Derrick Stolee wrote: This new 'git midx' builtin will be the plumbing access for writing, reading, and checking multi-pack-index (MIDX) files. The initial implementation is a no-op. Let's talk about

Re: [PATCH 03/23] midx: add midx builtin

2018-06-18 Thread Derrick Stolee
On 6/7/2018 1:20 PM, Duy Nguyen wrote: On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee wrote: diff --git a/Documentation/git-midx.txt b/Documentation/git-midx.txt new file mode 100644 index 00..2bd886f1a2 --- /dev/null +++ b/Documentation/git-midx.txt @@ -0,0 +1,29 @@ +git-midx(1

Re: [PATCH 02/23] midx: add midx format details to pack-format.txt

2018-06-18 Thread Derrick Stolee
On 6/11/2018 3:19 PM, Stefan Beller wrote: Hi Derrick, On Thu, Jun 7, 2018 at 7:03 AM Derrick Stolee wrote: The multi-pack-index (MIDX) feature generalizes the existing pack- index (IDX) feature by indexing objects across multiple pack-files. Describe the basic file format, using a 12-byte

Re: [PATCH 01/23] midx: add design document

2018-06-18 Thread Derrick Stolee
On 6/11/2018 3:04 PM, Stefan Beller wrote: On Thu, Jun 7, 2018 at 7:03 AM Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- Documentation/technical/midx.txt | 109 +++ 1 file changed, 109 insertions(+) create mode 100644 Documentation/technical/midx.txt

Re: [PATCH v2 0/7] Delete unused methods in EWAH bitmap

2018-06-15 Thread Derrick Stolee
On 6/15/2018 2:51 PM, Junio C Hamano wrote: Derrick Stolee writes: The EWAH bitmap code includes several logical operations that are important for a general-purpose bitmap library. However, Git only uses the XOR operation for storing deltas between reachability bitmaps. This means that we can

[PATCH v2 1/7] ewah/bitmap.c: delete unused 'bitmap_clear()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/bitmap.c | 8 ewah/ewok.h | 1 - 2 files changed, 9 deletions(-) diff --git a/ewah/bitmap.c b/ewah/bitmap.c index 756bdd050e..d61dc6114a 100644 --- a/ewah/bitmap.c +++ b/ewah/bitmap.c @@ -45,14 +45,6 @@ void bitmap_set

[PATCH v2 4/7] ewah_bitmap: delete unused 'ewah_and_not()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 73 -- ewah/ewok.h| 5 2 files changed, 78 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 5a4d3a6eb6..559adde37c 100644 --- a/ewah

[PATCH v2 6/7] ewah_bitmap: delete unused 'ewah_or()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 69 -- ewah/ewok.h| 5 2 files changed, 74 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 3fa3edf2a3..017c677f98 100644 --- a/ewah

[PATCH v2 7/7] ewah_io: delete unused 'ewah_serialize()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_io.c | 10 -- ewah/ewok.h| 1 - 2 files changed, 11 deletions(-) diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c index bed1994551..86d3f1d02e 100644 --- a/ewah/ewah_io.c +++ b/ewah/ewah_io.c @@ -100,16 +100,6

[PATCH v2 2/7] ewah/bitmap.c: delete unused 'bitmap_each_bit()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/bitmap.c | 24 ewah/ewok.h | 1 - 2 files changed, 25 deletions(-) diff --git a/ewah/bitmap.c b/ewah/bitmap.c index d61dc6114a..52f1178db4 100644 --- a/ewah/bitmap.c +++ b/ewah/bitmap.c @@ -129,30

[PATCH v2 0/7] Delete unused methods in EWAH bitmap

2018-06-15 Thread Derrick Stolee
() * ewah_not() * ewah_or() * ewah_serialize() We can also delete the unused methods bitmap_clear() and bitmap_each_bit(). Derrick Stolee (7): ewah/bitmap.c: delete unused 'bitmap_clear()' ewah/bitmap.c: delete unused 'bitmap_each_bit()' ewah_bitmap: delete unused 'ewah_and()' ewah_bitmap

[PATCH v2 3/7] ewah_bitmap: delete unused 'ewah_and()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 68 -- ewah/ewok.h| 5 2 files changed, 73 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index b9fdda1d3d..5a4d3a6eb6 100644 --- a/ewah

[PATCH v2 5/7] ewah_bitmap: delete unused 'ewah_not()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 19 --- ewah/ewok.h| 7 --- 2 files changed, 26 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 559adde37c..3fa3edf2a3 100644 --- a/ewah/ewah_bitmap.c +++ b

Re: [PATCH 4/3] ewah: adjust callers of ewah_read_mmap()

2018-06-15 Thread Derrick Stolee
On 6/15/2018 1:31 PM, Jeff King wrote: On Fri, Jun 15, 2018 at 09:41:46AM -0700, Junio C Hamano wrote: Derrick Stolee writes: On 6/14/2018 11:44 PM, Jeff King wrote: The return value of ewah_read_mmap() is now an ssize_t, since we could (in theory) process up to 32GB of data. This would

Re: [PATCH 1/8] ewah/bitmap.c: delete unused 'bitmap_clear()'

2018-06-15 Thread Derrick Stolee
On 6/15/2018 10:46 AM, Ramsay Jones wrote: On 15/06/18 15:30, Derrick Stolee wrote: Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/bitmap.c | 8 1 file changed, 8 deletions(-) diff --git a/ewah/bitmap.c b/ewah/bitmap.c index 756bdd050e..d61dc6114a 100644

Re: [PATCH 8/8] ewah_io: delete unused 'ewah_serialize_native()'

2018-06-15 Thread Derrick Stolee
On 6/15/2018 11:01 AM, Ramsay Jones wrote: On 15/06/18 15:30, Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- ewah/ewah_io.c | 26 -- ewah/ewok.h| 1 - 2 files changed, 27 deletions(-) This duplicates Jeff's patch #3. Thanks. I got a bit hasty as I

Re: [PATCH 0/8] Delete unused methods in EWAH bitmap

2018-06-15 Thread Derrick Stolee
On 6/15/2018 10:30 AM, Derrick Stolee wrote: The EWAH bitmap code includes several logical operations that are important for a general-purpose bitmap library. However, Git only uses the XOR operation for storing deltas between reachability bitmaps. This means that we can delete the following

[PATCH 3/8] ewah_bitmap: delete unused 'ewah_and()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 68 -- ewah/ewok.h| 5 2 files changed, 73 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index b9fdda1d3d..5a4d3a6eb6 100644 --- a/ewah

[PATCH 7/8] ewah_io: delete unused 'ewah_serialize()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_io.c | 10 -- ewah/ewok.h| 1 - 2 files changed, 11 deletions(-) diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c index bed1994551..86d3f1d02e 100644 --- a/ewah/ewah_io.c +++ b/ewah/ewah_io.c @@ -100,16 +100,6

[PATCH 5/8] ewah_bitmap: delete unused 'ewah_not()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 19 --- ewah/ewok.h| 7 --- 2 files changed, 26 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 559adde37c..3fa3edf2a3 100644 --- a/ewah/ewah_bitmap.c +++ b

[PATCH 6/8] ewah_bitmap: delete unused 'ewah_or()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 69 -- ewah/ewok.h| 5 2 files changed, 74 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 3fa3edf2a3..017c677f98 100644 --- a/ewah

[PATCH 8/8] ewah_io: delete unused 'ewah_serialize_native()'

2018-06-15 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- ewah/ewah_io.c | 26 -- ewah/ewok.h| 1 - 2 files changed, 27 deletions(-) diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c index 86d3f1d02e..dde736bcd9 100644 --- a/ewah/ewah_io.c +++ b/ewah/ewah_io.c @@ -20,32 +20,6 @@ #include

[PATCH 2/8] ewah/bitmap.c: delete unused 'bitmap_each_bit()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/bitmap.c | 24 1 file changed, 24 deletions(-) diff --git a/ewah/bitmap.c b/ewah/bitmap.c index d61dc6114a..52f1178db4 100644 --- a/ewah/bitmap.c +++ b/ewah/bitmap.c @@ -129,30 +129,6 @@ void

[PATCH 1/8] ewah/bitmap.c: delete unused 'bitmap_clear()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/bitmap.c | 8 1 file changed, 8 deletions(-) diff --git a/ewah/bitmap.c b/ewah/bitmap.c index 756bdd050e..d61dc6114a 100644 --- a/ewah/bitmap.c +++ b/ewah/bitmap.c @@ -45,14 +45,6 @@ void bitmap_set(struct bitmap *self

[PATCH 0/8] Delete unused methods in EWAH bitmap

2018-06-15 Thread Derrick Stolee
() * ewah_not() * ewah_or() * ewah_serialize() * ewah_serialize_native() We can also delete the unused methods bitmap_clear() and bitmap_each_bit(). Derrick Stolee (8): ewah/bitmap.c: delete unused 'bitmap_clear()' ewah/bitmap.c: delete unused 'bitmap_each_bit()' ewah_bitmap: delete unused

[PATCH 4/8] ewah_bitmap: delete unused 'ewah_and_not()'

2018-06-15 Thread Derrick Stolee
Reported-by: Ramsay Jones Signed-off-by: Derrick Stolee --- ewah/ewah_bitmap.c | 73 -- ewah/ewok.h| 5 2 files changed, 78 deletions(-) diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c index 5a4d3a6eb6..559adde37c 100644 --- a/ewah

Re: [PATCH 3/3] ewah: drop ewah_serialize_native function

2018-06-15 Thread Derrick Stolee
On 6/15/2018 9:56 AM, Ramsay Jones wrote: On 15/06/18 04:32, Jeff King wrote: We don't call this function, and never have. The on-disk bitmap format uses network-byte-order integers, meaning that we cannot use the native-byte-order format written here. Let's drop it in the name of simplicity.

Re: [PATCH 4/3] ewah: adjust callers of ewah_read_mmap()

2018-06-15 Thread Derrick Stolee
On 6/14/2018 11:44 PM, Jeff King wrote: The return value of ewah_read_mmap() is now an ssize_t, since we could (in theory) process up to 32GB of data. This would never happen in practice, but a corrupt or malicious .bitmap or index file could convince us to do so. Aside: Why a 32GB limit?

Re: [PATCH v2 05/31] tree: add repository argument to lookup_tree

2018-06-14 Thread Derrick Stolee
On 6/14/2018 1:55 PM, Derrick Stolee wrote: On 6/13/2018 7:04 PM, Stefan Beller wrote: diff --git a/commit-graph.c b/commit-graph.c index 71125d7cbb6..88a4b0d2a47 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -261,7 +261,7 @@ static int fill_commit_in_graph(struct commit *item, struct

Re: [PATCH v2 05/31] tree: add repository argument to lookup_tree

2018-06-14 Thread Derrick Stolee
On 6/13/2018 7:04 PM, Stefan Beller wrote: diff --git a/commit-graph.c b/commit-graph.c index 71125d7cbb6..88a4b0d2a47 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -261,7 +261,7 @@ static int fill_commit_in_graph(struct commit *item, struct commit_graph *g, uin item->graph_pos =

Re: [PATCH v2 00/31] object-store: lookup_commit

2018-06-13 Thread Derrick Stolee
On 6/13/2018 9:23 PM, Derrick Stolee wrote: On 6/13/2018 7:04 PM, Stefan Beller wrote * Once this is in good shape we can talk about converting parts of the revision    walking code, This is another reason why I'll be waiting for this series of series. I plan to rework the revision

Re: [PATCH v2 00/31] object-store: lookup_commit

2018-06-13 Thread Derrick Stolee
On 6/13/2018 7:04 PM, Stefan Beller wrote * Once this is in good shape we can talk about converting parts of the revision walking code, This is another reason why I'll be waiting for this series of series. I plan to rework the revision walking code around sort_in_topological_order(), but

Re: [PATCH 03/35] object: add repository argument to lookup_unknown_object

2018-06-13 Thread Derrick Stolee
On 6/13/2018 3:30 PM, Stefan Beller wrote: On Wed, Jun 6, 2018 at 12:38 PM Duy Nguyen wrote: On Wed, May 30, 2018 at 2:47 AM, Stefan Beller wrote: diff --git a/object.c b/object.c index 4de4fa58d59..def3c71cac2 100644 --- a/object.c +++ b/object.c @@ -177,7 +177,7 @@ void

Re: is there a canonical doc about how to deal with whitespace issues?

2018-06-08 Thread Derrick Stolee
On 6/8/2018 9:18 AM, Robert P. J. Day wrote: for one of my courses, i wanted to write a section about the various techniques for dealing with whitespace issues in git, so i started making a list, things like: - running "git diff --check" - "git commit --cleanup=" possibilities -

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

2018-06-08 Thread Derrick Stolee
On 6/8/2018 11:05 AM, Jakub Narębski wrote: On Fri, 8 Jun 2018 at 15:56, Derrick Stolee wrote: [..], the following diff occurs from the previous patch: [...] diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index b24e8b6689..9a0661983c 100755 --- a/t/t5318-commit-graph.sh

<    2   3   4   5   6   7   8   9   10   11   >