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

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Mon, Jun 04 2018, Derrick Stolee wrote: > diff --git a/Documentation/config.txt b/Documentation/config.txt > index 11f027194e..d2eb3c8e9b 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -900,7 +900,8 @@ the `GIT_NOTES_REF` environment variable. See >

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Ramsay Jones
On 06/06/18 08:39, Nguyễn Thái Ngọc Duy wrote: > Make the attr API take an index_state instead of assuming the_index in > attr code. All call sites are converted blindly to keep the patch > simple and retain current behavior. Individual call sites may receive > further updates to use the right

[PATCH v3 1/3] parse-options: option to let --git-completion-helper show negative form

2018-06-06 Thread Nguyễn Thái Ngọc Duy
When 7fb6aefd2a (Merge branch 'nd/parseopt-completion' - 2018-03-14) is merged, the completion for negative form is left out because the series is alread long and it could be done in a follow up series. This is it. --git-completion-helper now provides --no-xxx so that git-completion.bash can drop

[PATCH v3 3/3] completion: collapse extra --no-.. options

2018-06-06 Thread Nguyễn Thái Ngọc Duy
The commands that make use of --git-completion-helper feature could now produce a lot of --no-xxx options that a command can take. This in many case could nearly double the amount of completable options, using more screen estate and also harder to search for the wanted option. This patch attempts

Re: [RFC PATCH 00/18] Multi-pack index (MIDX)

2018-06-06 Thread Derrick Stolee
On 6/6/2018 4:13 AM, Ævar Arnfjörð Bjarmason wrote: On Mon, Jan 08 2018, Derrick Stolee wrote: On 1/7/2018 5:42 PM, Ævar Arnfjörð Bjarmason wrote: On Sun, Jan 07 2018, Derrick Stolee jotted: git log --oneline --raw --parents Num Packs | Before MIDX | After MIDX | Rel % | 1 pack %

[PATCH v5 12/21] commit-graph: verify parent list

2018-06-06 Thread Derrick Stolee
The commit-graph file stores parents in a two-column portion of the commit data chunk. If there is only one parent, then the second column stores 0x to indicate no second parent. The 'verify' subcommand checks the parent list for the commit loaded from the commit-graph and the one parsed

[PATCH v5 11/21] commit-graph: verify root tree OIDs

2018-06-06 Thread Derrick Stolee
The 'verify' subcommand must compare the commit content parsed from the commit-graph against the content in the object database. Use lookup_commit() and parse_commit_in_graph_one() to parse the commits from the graph and compare against a commit that is loaded separately and parsed directly from

[PATCH v5 02/21] commit-graph: fix GRAPH_MIN_SIZE

2018-06-06 Thread Derrick Stolee
The GRAPH_MIN_SIZE macro should be the smallest size of a parsable commit-graph file. However, the minimum number of chunks was wrong. It is possible to write a commit-graph file with zero commits, and that violates this macro's value. Rewrite the macro, and use extra macros to better explain the

[PATCH v5 08/21] commit-graph: verify required chunks are present

2018-06-06 Thread Derrick Stolee
The commit-graph file requires the following three chunks: * OID Fanout * OID Lookup * Commit Data If any of these are missing, then the 'verify' subcommand should report a failure. This includes the chunk IDs malformed or the chunk count is truncated. Signed-off-by: Derrick Stolee ---

[PATCH v5 01/21] commit-graph: UNLEAK before die()

2018-06-06 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 v5 06/21] commit-graph: add 'verify' subcommand

2018-06-06 Thread Derrick Stolee
If the commit-graph file becomes corrupt, we need a way to verify that its contents match the object database. In the manner of 'git fsck' we will implement a 'git commit-graph verify' subcommand to report all issues with the file. Add the 'verify' subcommand to the 'commit-graph' builtin and its

[PATCH v5 04/21] commit: force commit to parse from object database

2018-06-06 Thread Derrick Stolee
In anticipation of verifying commit-graph file contents against the object database, create parse_commit_internal() to allow side-stepping the commit-graph file and parse directly from the object database. Due to the use of generation numbers, this method should not be called unless the intention

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Derrick Stolee wrote: > Signed-off-by: Derrick Stolee > --- > builtin/commit-graph.c | 39 +-- > commit-graph.c | 15 +++ > commit-graph.h | 7 +++ > 3 files changed, 23 insertions(+), 38 deletions(-) >

[PATCH v3 2/3] completion: suppress some -no- options

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Most --no- options do have some use, even if rarely to negate some option that's specified in an alias. These options --no-ours and --no-theirs however have no clear semantics. If I specify "--ours --no-theirs", the second will reset writeout stage and is equivalent of "--no-ours --no-theirs"

[PATCH v3 0/3] ompletion: complete all possible -no-

2018-06-06 Thread Nguyễn Thái Ngọc Duy
v3 fixes an annoying bug in 3/3. If you do "git commit --fi" then the "fi" part is eaten up by bash and you got back to "git commit --" on the command line. This is because we give COMPREPLY with two options "--fixup" and "--no-...". The second one forces the common prefix "--" for both of them,

[RFC PATCH 0/2] unconditional O(1) SHA-1 abbreviation

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Ævar Arnfjörð Bjarmason wrote: > On Mon, Jan 08 2018, Derrick Stolee wrote: > >> On 1/7/2018 5:42 PM, Ævar Arnfjörð Bjarmason wrote: >>> >>> On Sun, Jan 07 2018, Derrick Stolee jotted: >>> git log --oneline --raw --parents Num Packs | Before MIDX | After

[RFC PATCH 2/2] sha1-name: add core.validateAbbrev & relative core.abbrev

2018-06-06 Thread Ævar Arnfjörð Bjarmason
Since Linus added auto-sizing for abbreviations in e6c587c733 ("abbrev: auto size the default abbreviation", 2016-09-30) we've been less likely to produce a short SHA-1 today that'll collide on the same repository tomorrow, since before we'd always pick the bare minimum we could get away with.

Re: [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh

2018-06-06 Thread Rick van Hattem
On 6 June 2018 at 13:41, SZEDER Gábor wrote: > >> On 4 June 2018 at 05:40, Junio C Hamano wrote: >> Rick van Hattem writes: >> >> > > The `git-completion.zsh` unsets the `$ZSH_VERSION` which makes this >> > > check moot. The result (at least for me) is that zsh segfaults because >> > > of

Re: [PATCH v4 17/21] fsck: verify commit-graph

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Mon, Jun 04 2018, Derrick Stolee wrote: > + prepare_alt_odb(); > + for (alt = alt_odb_list; alt; alt = alt->next) { > + verify_argv[2] = "--object-dir"; > + verify_argv[3] = alt->path; > + if

Re: [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh

2018-06-06 Thread SZEDER Gábor
> On 4 June 2018 at 05:40, Junio C Hamano wrote: > Rick van Hattem writes: > > > > The `git-completion.zsh` unsets the `$ZSH_VERSION` which makes this check > > > moot. The result (at least for me) is that zsh segfaults because of all > > > the variables it's unsetting. > > > --- > > > >

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Derrick Stolee
On 6/6/2018 8:11 AM, Ævar Arnfjörð Bjarmason wrote: On Wed, Jun 06 2018, Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- builtin/commit-graph.c | 39 +-- commit-graph.c | 15 +++ commit-graph.h | 7 +++ 3 files

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Derrick Stolee wrote: > On 6/6/2018 8:11 AM, Ævar Arnfjörð Bjarmason wrote: >> On Wed, Jun 06 2018, Derrick Stolee wrote: >> >>> Signed-off-by: Derrick Stolee >>> --- >>> builtin/commit-graph.c | 39 +-- >>> commit-graph.c |

Re: [PATCH v4 17/21] fsck: verify commit-graph

2018-06-06 Thread Derrick Stolee
On 6/6/2018 7:08 AM, Ævar Arnfjörð Bjarmason wrote: On Mon, Jun 04 2018, Derrick Stolee wrote: + prepare_alt_odb(); + for (alt = alt_odb_list; alt; alt = alt->next) { + verify_argv[2] = "--object-dir"; + verify_argv[3] =

Re: [PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Derrick Stolee
On 6/6/2018 8:26 AM, Ævar Arnfjörð Bjarmason wrote: On Wed, Jun 06 2018, Derrick Stolee wrote: On 6/6/2018 8:11 AM, Ævar Arnfjörð Bjarmason wrote: On Wed, Jun 06 2018, Derrick Stolee wrote: Signed-off-by: Derrick Stolee --- builtin/commit-graph.c | 39

Dear Beloved

2018-06-06 Thread Susan Patrick
-- I am Susan Patrick. I have a lucrative/confidential proposal that may interest you worth (35,000,000.00 GBP), I find it pleasurable to offer you my partnership contact me for more information: susanpatr...@consultant.com

[RFC PATCH 1/2] config.c: use braces on multiple conditional arms

2018-06-06 Thread Ævar Arnfjörð Bjarmason
Adjust this code that'll be modified in a subsequent change per the CodingGuidelines. Signed-off-by: Ævar Arnfjörð Bjarmason --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index fbbf0f8e9f..12f762ad92 100644 --- a/config.c +++ b/config.c

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

2018-06-06 Thread Derrick Stolee
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 triggers writing a commit-graph file after any

[PATCH v5 13/21] commit-graph: verify generation number

2018-06-06 Thread Derrick Stolee
While iterating through the commit parents, perform the generation number calculation and compare against the value stored in the commit-graph. The tests demonstrate that having a different set of parents affects the generation number calculation, and this value propagates to descendants. Hence,

[PATCH v5 03/21] commit-graph: parse commit from chosen graph

2018-06-06 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 v5 10/21] commit-graph: verify objects exist

2018-06-06 Thread Derrick Stolee
In the 'verify' subcommand, load commits directly from the object database to ensure they exist. Parse by skipping the commit-graph. Signed-off-by: Derrick Stolee --- commit-graph.c | 17 + t/t5318-commit-graph.sh | 7 +++ 2 files changed, 24 insertions(+) diff

[PATCH v5 19/21] commit-graph: add '--reachable' option

2018-06-06 Thread Derrick Stolee
When writing commit-graph files, it can be convenient to ask for all reachable commits (starting at the ref set) in the resulting file. This is particularly helpful when writing to stdin is complicated, such as a future integration with 'git gc'. Signed-off-by: Derrick Stolee ---

[PATCH v5 18/21] commit-graph: use string-list API for input

2018-06-06 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- builtin/commit-graph.c | 39 +-- commit-graph.c | 15 +++ commit-graph.h | 7 +++ 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/builtin/commit-graph.c

[PATCH v5 14/21] commit-graph: verify commit date

2018-06-06 Thread Derrick Stolee
Signed-off-by: Derrick Stolee --- commit-graph.c | 6 ++ t/t5318-commit-graph.sh | 6 ++ 2 files changed, 12 insertions(+) diff --git a/commit-graph.c b/commit-graph.c index b97fa05ec9..d83f0ce5d5 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -985,6 +985,12 @@ int

[PATCH v5 16/21] commit-graph: verify contents match checksum

2018-06-06 Thread Derrick Stolee
The commit-graph file ends with a SHA1 hash of the previous contents. If a commit-graph file has errors but the checksum hash is correct, then we know that the problem is a bug in Git and not simply file corruption after-the-fact. Compute the checksum right away so it is the first error that

[PATCH v5 07/21] commit-graph: verify catches corrupt signature

2018-06-06 Thread Derrick Stolee
This is the first of several commits that add a test to check that 'git commit-graph verify' catches corruption in the commit-graph file. The first test checks that the command catches an error in the file signature. This is a check that exists in the existing commit-graph reading code. Add a

[PATCH v5 09/21] commit-graph: verify corrupt OID fanout and lookup

2018-06-06 Thread Derrick Stolee
In the commit-graph file, the OID fanout chunk provides an index into the OID lookup. The 'verify' subcommand should find incorrect values in the fanout. Similarly, the 'verify' subcommand should find out-of-order values in the OID lookup. Signed-off-by: Derrick Stolee --- commit-graph.c

[PATCH v5 00/21] Integrate commit-graph into 'fsck' and 'gc'

2018-06-06 Thread Derrick Stolee
Thanks, Ævar, for pointing out that I forgot to rebase onto 'next'. There were a few collisions with the object-store refactoring. Junio even pointed them out, so I'm sorry to forget that. I also did a test merge with 'pu' and it seems the only conflicts are with the earlier version of this

[PATCH v5 05/21] commit-graph: load a root tree from specific graph

2018-06-06 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 v5 15/21] commit-graph: test for corrupted octopus edge

2018-06-06 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 v5 21/21] commit-graph: update design document

2018-06-06 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. Also remove the section on lazy-loading trees, as that was completed in an earlier patch series. Signed-off-by: Derrick Stolee ---

[PATCH v5 17/21] fsck: verify commit-graph

2018-06-06 Thread Derrick Stolee
If core.commitGraph is true, verify the contents of the commit-graph during 'git fsck' using the 'git commit-graph verify' subcommand. Run this check on all alternates, as well. We use a new process for two reasons: 1. The subcommand decouples the details of loading and verifying a

Re: [RFC PATCH 2/2] sha1-name: add core.validateAbbrev & relative core.abbrev

2018-06-06 Thread Christian Couder
On Wed, Jun 6, 2018 at 12:27 PM, Ævar Arnfjörð Bjarmason wrote: > +This setting changes that to `O(1)`, but with the trade-off that > +depending on the value of `core.abbrev` way may be printing s/way may be printing/we may be printing/ > +abbreviated hashes that collide. Too see how likely

Re: [PATCH v5 08/21] commit-graph: verify required chunks are present

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Jun 06 2018, Derrick Stolee wrote: > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index c0c1ff09b9..846396665e 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh > @@ -249,6 +249,15 @@ test_expect_success 'git commit-graph verify' ' > >

[PATCH v3 02/20] unpack-trees: add a note about path invalidation

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/unpack-trees.c b/unpack-trees.c index 3a85a02a77..5d06aa9c98 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1545,6 +1545,17 @@ static int verify_uptodate_sparse(const

[PATCH v3 01/20] unpack-trees: remove 'extern' on function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpack-trees.h b/unpack-trees.h index c2b434c606..534358fcc5 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -82,8 +82,8 @@ struct unpack_trees_options {

[PATCH v3 14/20] entry.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
checkout-index.c needs update because if checkout->istate is NULL, ie_match_stat() will crash. Previously this is ie_match_stat(_index, ..) so it will not crash, but it is not technically correct either. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout-index.c | 1 + entry.c

[PATCH v3 15/20] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Since attr checking API now take the index, there's no need to set an index in advance with this call. Most call sites are straightforward because they either pass the_index or NULL (which defaults back to the_index previously). There's only one suspicious call site in unpack-trees.c where it sets

[PATCH v3 06/20] attr.h: drop extern from function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/attr.h b/attr.h index 442d464db6..46340010bb 100644 --- a/attr.h +++ b/attr.h @@ -42,31 +42,31 @@ struct attr_check { struct attr_stack *stack;

[PATCH v3 19/20] grep: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 2eae397e92..a8cef2b159 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -497,7 +497,7 @@ static int grep_cache(struct grep_opt

[PATCH v3 16/20] preload-index.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- preload-index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/preload-index.c b/preload-index.c index d61d7662d5..cc2b579791 100644 --- a/preload-index.c +++ b/preload-index.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2008 Linus

[PATCH v3 09/20] convert.c: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the convert API take an index_state instead of assuming the_index in convert.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by:

[PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the attr API take an index_state instead of assuming the_index in attr code. All call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. There is one ugly temporary

[PATCH v3 10/20] dir.c: remove an implicit dependency on the_index in pathspec code

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make the match_patchspec API and friends take an index_state instead of assuming the_index in dir.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index.

[PATCH v3 00/20] Fix incorrect use of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
On Wed, Jun 6, 2018 at 7:02 AM, Nguyễn Thái Ngọc Duy wrote: > v2 fixes an incorrect patch splitting (I should have built one more > time :P) between 3/5 and 4/5. v1's 6/6 is dropped. Brandon suggested a > better way of doing it which may happen later. I started looking into Brandon's suggestion,

[PATCH v3 04/20] unpack-tress: convert clear_ce_flags* to avoid the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Prior to fba92be8f7, this code implicitly (and incorrectly) assumes the_index when running the exclude machinery. fba92be8f7 helps show this problem clearer because unpack-trees operation is supposed to work on whatever index the caller specifies... not specifically the_index. Update the code to

[PATCH v3 13/20] submodule.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- submodule.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/submodule.c b/submodule.c index 955560bdbb..3aed76e3ee 100644 --- a/submodule.c +++ b/submodule.c @@ -93,7 +93,7 @@ int update_path_in_gitmodules(const char *oldpath,

[PATCH v3 18/20] resolve-undo.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- resolve-undo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resolve-undo.c b/resolve-undo.c index 9c45fe5d1d..a4918546c3 100644 --- a/resolve-undo.c +++ b/resolve-undo.c @@ -1,3 +1,4 @@ +#define NO_THE_INDEX_COMPATIBILITY_MACROS

[PATCH v3 12/20] pathspec.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- pathspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pathspec.c b/pathspec.c index 897cb9cbbe..6f005996fd 100644 --- a/pathspec.c +++ b/pathspec.c @@ -37,7 +37,7 @@ void add_pathspec_matches_against_index(const struct pathspec

[PATCH v3 08/20] convert.h: drop 'extern' from function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- convert.h | 56 --- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/convert.h b/convert.h index 01385d9288..0a0fa15b58 100644 --- a/convert.h +++ b/convert.h @@ -57,35 +57,36 @@ struct

[PATCH v3 20/20] cache.h: make the_index part of "compatibility macros"

2018-06-06 Thread Nguyễn Thái Ngọc Duy
While the_index is not actually a macro, its use throughout the code base is dangerous because developers sometimes may not see that some function is using the_index (instead of some other index that the devs are interested in). By keeping the_index part of this NO_ macro, we try to reduce its

[PATCH v3 17/20] cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make some index API take an index_state instead of assuming the_index in read-cache.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by:

[PATCH v3 03/20] unpack-trees: don't shadow global var the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
This function mark_new_skip_worktree() has an argument named the_index which is also the name of a global variable. While they have different types (the global the_index is not a pointer) mistakes can easily happen and it's also confusing for readers. Rename the function argument to something

[PATCH v3 05/20] unpack-trees: avoid the_index in verify_absent()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Both functions that are updated in this commit are called by verify_absent(), which is part of the "unpack-trees" operation that is supposed to work on any index file specified by the caller. Thanks to Brandon [1] [2], an implicit dependency on the_index is exposed. This commit fixes it. In both

[PATCH v3 11/20] ls-files: correct index argument to get_convert_attr_ascii()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
write_eolinfo() does take an istate as function argument and it should be used instead of the_index. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/ls-files.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builtin/ls-files.c b/builtin/ls-files.c index

Re: [PATCH 04/10] t0027: use $ZERO_OID

2018-06-06 Thread Torsten Bögershausen
On Mon, Jun 04, 2018 at 11:52:23PM +, brian m. carlson wrote: > Use the ZERO_OID variable to express the all-zeros object ID so that it > works with hash algorithms of all sizes. > > Signed-off-by: brian m. carlson > --- > t/t0027-auto-crlf.sh | 14 +++--- > 1 file changed, 7

Re: [PATCH 01/10] t: add tool to translate hash-related values

2018-06-06 Thread Torsten Bögershausen
Some style nite inline On Mon, Jun 04, 2018 at 11:52:20PM +, brian m. carlson wrote: > Add a test function helper, test_translate, that will produce its first > argument if the hash in use is SHA-1 and the second if its argument is > NewHash. Implement a mode that can read entries from a

Re: [RFC PATCH 00/18] Multi-pack index (MIDX)

2018-06-06 Thread Ævar Arnfjörð Bjarmason
On Mon, Jan 08 2018, Derrick Stolee wrote: > On 1/7/2018 5:42 PM, Ævar Arnfjörð Bjarmason wrote: >> >> On Sun, Jan 07 2018, Derrick Stolee jotted: >> >>> git log --oneline --raw --parents >>> >>> Num Packs | Before MIDX | After MIDX | Rel % | 1 pack % >>>

RFC: rebase inconsistency in 2.18 -- course of action?

2018-06-06 Thread Elijah Newren
Hi everyone, We've got a small rebase problem; I'm curious for thoughts about the best course of action. I'll provide several options below. In short, while interactive-based and merge-based rebases handle directory rename detection fine, am-based rebases do not. This inconsistency may

[PATCH] t5407: fix test to cover intended arguments

2018-06-06 Thread Elijah Newren
Test 8 in t5407 appears to be an accidental exact duplicate of of test 5; the testcode is identical and has identical repo state, but the test description is different and suggests that rebase -m followed by rebase --skip was what was actually supposed to be tested. Modify the test to include the

[PATCH] apply: fix grammar error in comment

2018-06-06 Thread Elijah Newren
Signed-off-by: Elijah Newren --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply.c b/apply.c index d79e61591b..85f2c92740 100644 --- a/apply.c +++ b/apply.c @@ -4053,7 +4053,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)

[PATCH] t3401: add directory rename testcases for rebase and am

2018-06-06 Thread Elijah Newren
Add a simple directory rename testcase, in conjunction with each of the types of rebases: git-rebase--interactive git-rebase--am git-rebase--merge and also use the same testcase for git am --3way This demonstrates an inconsistency between the different rebase backends and which can detect

Hi

2018-06-06 Thread Robert Lee
Am a United State Army here in Afghanistan, am seeking your help to evacuate the sum of $ 7,000,000 to you as long as I am assured it will be safe That in your care Until I complete my service here in Afghanistan. This is not stolen money and there are no dangers involved. I count on your

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Thu, Jun 07, 2018 at 01:16:14AM +0100, Ramsay Jones wrote: > > Probably. We may want to go the same route as we did for perl in > > a0e0ec9f7d (t: provide a perl() function which uses $PERL_PATH, > > 2013-10-28) so that test writers don't have to remember this. > > > > That said, I wonder if

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 09:49:09PM -0400, Todd Zullinger wrote: > Ramsay Jones wrote: > [...] > > I don't run the p4 or svn tests, so ... :-D > > Heh, lucky you. :) > > I try to run them all as part of the fedora builds since > they cover much more than I'd ever use. That's the main > reason I

Re: [PATCH 01/10] t: add tool to translate hash-related values

2018-06-06 Thread Jeff King
On Thu, Jun 07, 2018 at 12:57:04AM +, brian m. carlson wrote: > > > Unless I'm wrong, we don't use the "local" keyword ? > > > > We've got a test balloon out; see 01d3a526ad (t: check whether the > > shell supports the "local" keyword, 2017-10-26). I think it's reasonable > > to consider

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Jeff King
On Wed, Jun 06, 2018 at 10:23:53PM -0400, Jeff King wrote: > Though maybe I am wrong that the remote-svn stuff requires python. I > thought it did, but poking around, it looks like it's all C, and just > the "svnrdump_sim" helper is python. I think I was getting this mixed up with the

Re: [PATCH 04/10] t0027: use $ZERO_OID

2018-06-06 Thread brian m. carlson
On Wed, Jun 06, 2018 at 09:02:23AM +0200, Torsten Bögershausen wrote: > Nothing wrong with the patch. > There is, however, a trick in t0027 to transform the different IDs back to a > bunch of '0'. > The content of the file use only uppercase letters, and all lowercase ad > digits > are converted

Re: GDPR compliance best practices?

2018-06-06 Thread David Lang
I'm going to take the risk of inserting actual real-world data into the mix rather than just speculation :-) Here is an example of that the Rsyslog project is doing (main developers based in Germany). I'll say as someone who's day job has been very involved with GDPR stuff recently, this

Re: [PATCH v7 2/2] json-writer: t0019: add Python unit test

2018-06-06 Thread Todd Zullinger
Ramsay Jones wrote: [...] > I don't run the p4 or svn tests, so ... :-D Heh, lucky you. :) I try to run them all as part of the fedora builds since they cover much more than I'd ever use. That's the main reason I noticed the bare python. That would trip me up when it came time to build on a

Re: [PATCH] t3200-branch.sh: use "--set-upstream-to" in test

2018-06-06 Thread Kaartic Sivaraam
On Tuesday 05 June 2018 04:54 PM, SZEDER Gábor wrote: > > Though arguably the test name could be more descriptive and tell why > it should fail. > That's arguable, indeed. I was about to send a patch that gives a better description for the test. I didn't do it as I started wondering, Is it even

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Duy Nguyen
On Wed, Jun 6, 2018 at 6:50 PM, Brandon Williams wrote: > On 06/06, Nguyễn Thái Ngọc Duy wrote: >> Make the attr API take an index_state instead of assuming the_index in >> attr code. All call sites are converted blindly to keep the patch >> simple and retain current behavior. Individual call

Re: [PATCH v3 17/20] cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Make some index API take an index_state instead of assuming the_index > in read-cache.c. All external call sites are converted blindly to keep > the patch simple and retain current behavior. Individual call sites > may receive further updates to use the

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine wrote: > On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: >> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && > > Simpler: printf "%s\n" I am all CRLF | append_cr >allcrlf && Or even simpler: printf "%s\r\n" I am all

Re: [PATCH v3 07/20] attr: remove an implicit dependency on the_index

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Make the attr API take an index_state instead of assuming the_index in > attr code. All call sites are converted blindly to keep the patch > simple and retain current behavior. Individual call sites may receive > further updates to use the right index

[PATCH v4 02/23] unpack-trees: add a note about path invalidation

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/unpack-trees.c b/unpack-trees.c index 3a85a02a77..5d06aa9c98 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1545,6 +1545,17 @@ static int verify_uptodate_sparse(const

[PATCH v4 04/23] unpack-tress: convert clear_ce_flags* to avoid the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Prior to fba92be8f7, this code implicitly (and incorrectly) assumes the_index when running the exclude machinery. fba92be8f7 helps show this problem clearer because unpack-trees operation is supposed to work on whatever index the caller specifies... not specifically the_index. Update the code to

[PATCH v4 00/23] Fix incorrect use of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
v4 fixes some commit messages and killed a couple more the_index references after I tried to merge this with 'pu' diff --git a/apply.c b/apply.c index 811ff2ad5e..82f681972f 100644 --- a/apply.c +++ b/apply.c @@ -4090,9 +4090,9 @@ static int build_fake_ancestor(struct apply_state *state, struct

[PATCH v4 01/23] unpack-trees: remove 'extern' on function declaration

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpack-trees.h b/unpack-trees.h index c2b434c606..534358fcc5 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -82,8 +82,8 @@ struct unpack_trees_options {

[PATCH v4 03/23] unpack-trees: don't shadow global var the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
This function mark_new_skip_worktree() has an argument named the_index which is also the name of a global variable. While they have different types (the global the_index is not a pointer) mistakes can easily happen and it's also confusing for readers. Rename the function argument to something

[PATCH v4 05/23] unpack-trees: avoid the_index in verify_absent()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Both functions that are updated in this commit are called by verify_absent(), which is part of the "unpack-trees" operation that is supposed to work on any index file specified by the caller. Thanks to Brandon [1] [2], an implicit dependency on the_index is exposed. This commit fixes it. In both

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Anthony Sottile
On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine wrote: > On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine wrote: >> On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: >>> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && >> >> Simpler: printf "%s\n" I am all CRLF |

Re: [PATCH v3 15/20] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Brandon Williams
On 06/06, Nguyễn Thái Ngọc Duy wrote: > Since attr checking API now take the index, there's no need to set an > index in advance with this call. Most call sites are straightforward > because they either pass the_index or NULL (which defaults back to > the_index previously). There's only one

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: > A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused > autocrlf rewrites to produce a warning message despite setting safecrlf=false. > > Signed-off-by: Anthony Sottile > --- > diff --git a/t/t0020-crlf.sh

Re: [PATCH] config.c: fix regression for core.safecrlf false

2018-06-06 Thread Eric Sunshine
On Wed, Jun 6, 2018 at 1:18 PM, Anthony Sottile wrote: > On Wed, Jun 6, 2018 at 10:17 AM, Eric Sunshine > wrote: >> On Wed, Jun 6, 2018 at 1:15 PM, Eric Sunshine >> wrote: >>> On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile wrote: + for w in I am all CRLF; do echo $w; done |

Re: BUG: submodule code prints '(null)'

2018-06-06 Thread Kaartic Sivaraam
On Tuesday 05 June 2018 09:01 PM, Duy Nguyen wrote: > I'll leave it to submodule people to fix this :) > I'm Ccing the only one I know to gain attention. -- Sivaraam QUOTE: “The three principal virtues of a programmer are Laziness, Impatience, and Hubris.” - Camel book Sivaraam?

[PATCH v4 17/23] read-cache.c: remove an implicit dependency on the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Make some index API take an index_state instead of assuming the_index in read-cache.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by:

[PATCH v4 18/23] apply.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply.c b/apply.c index fc42a0eadf..82f681972f 100644 --- a/apply.c +++ b/apply.c @@ -4090,7 +4090,7 @@ static int build_fake_ancestor(struct apply_state *state, struct patch

[PATCH v4 21/23] resolve-undo.c: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- resolve-undo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resolve-undo.c b/resolve-undo.c index 383231b011..2377995d6d 100644 --- a/resolve-undo.c +++ b/resolve-undo.c @@ -1,3 +1,4 @@ +#define NO_THE_INDEX_COMPATIBILITY_MACROS

[PATCH v4 15/23] attr: remove index from git_attr_set_direction()

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Since attr checking API now take the index, there's no need to set an index in advance with this call. Most call sites are straightforward because they either pass the_index or NULL (which defaults back to the_index previously). There's only one suspicious call site in unpack-trees.c where it sets

[PATCH v4 22/23] grep: use the right index instead of the_index

2018-06-06 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 2eae397e92..a8cef2b159 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -497,7 +497,7 @@ static int grep_cache(struct grep_opt

  1   2   >