Re: [PATCHv5 1/4] submodule.h: add extern keyword to functions

2016-12-26 Thread Junio C Hamano
Stefan Beller writes: > As the upcoming series will add a lot of functions to the submodule > header, let's first make the header consistent to the rest of the project > by adding the extern keyword to functions. This may be the right thing to do in the longer term but a

Re: [PATCHv5 4/4] rm: absorb a submodules git dir before deletion

2016-12-26 Thread Junio C Hamano
Stefan Beller writes: > @@ -342,6 +313,8 @@ int cmd_rm(int argc, const char **argv, const char > *prefix) > exit(0); > } > > + submodules_absorb_gitdir_if_needed(prefix); > + > /* >* If not forced, the file, the index and the

Re: [PATCHv5 3/4] submodule: rename and add flags to ok_to_remove_submodule

2016-12-26 Thread Junio C Hamano
Stefan Beller writes: > As only 0 is understood as false, rename the function to invert the > meaning, i.e. the return code of 0 signals the removal of the submodule > is fine, and other values can be used to return a more precise answer > what went wrong. Makes sense to

Re: git-apply: warn/fail on *changed* end of line (eol) *only*?

2016-12-26 Thread Igor Djordjevic BugA
Hi Junio, and thanks for sharing your thoughts. You understood it pretty well, except the context "scope". Example does show a single line change, and a single line old/new comparison, but that is for simplicity sake of the initial example. What I was discussing about was the whole patch "hunk"

Re: What's cooking in git.git (Dec 2016, #07; Thu, 22)

2016-12-26 Thread Stefan Beller
On Fri, Dec 23, 2016 at 3:55 PM, Lars Schneider wrote: > "next" seems to generate a small error on macOS. Probably introduced in > "worktree: check if a submodule uses worktrees" (1a248cf) Thanks for reporting, will send a fix on Tuesday.

Re: Corner case involving null sha1, alternates, cache misses, and submodule config API

2016-12-26 Thread Stefan Beller
On Sat, Dec 24, 2016 at 6:29 PM, Mike Hommey wrote: > Hi, > > As you might be aware, I'm working on a mercurial remote helper for git. > The way it stores metadata for mercurial manifests abuses "commit" > references in trees, which are normally used for submodules. > > Some

Warning: You tried to send an email with blocked content

2016-12-26 Thread Service Desk
The UCL E-Mail Virus Protection System has been triggered by a message you sent. One or more of the original e-mail attachments have been removed and replaced with this message. * The attachment may have contained a virus or malware * The attachment may have an extension of a type unacceptable

Re: [PATCH v2 00/21] Add configuration options for split-index

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 1:02 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:26PM +0100, Christian Couder wrote: >> Goal >> >> >> We want to make it possible to use the split-index feature >> automatically by just setting a new "core.splitIndex" configuration >>

Re: [PATCH v3 00/21] Add configuration options for split-index

2016-12-26 Thread Christian Couder
On Mon, Dec 26, 2016 at 11:22 AM, Christian Couder wrote: > > Highlevel view of the patches in the series > ~~~ > > Except for patch 1/21, there are 3 big steps, one for each new > configuration variable introduced. > > There

[PATCH v3 16/21] read-cache: unlink old sharedindex files

2016-12-26 Thread Christian Couder
Everytime split index is turned on, it creates a "sharedindex." file in the git directory. This change makes sure that shared index files that haven't been used for a long time are removed when a new shared index file is created. The new "splitIndex.sharedIndexExpire" config variable is

[PATCH v3 13/21] sha1_file: make check_and_freshen_file() non static

2016-12-26 Thread Christian Couder
This function will be used in a commit soon, so let's make it available globally. Signed-off-by: Christian Couder --- cache.h | 3 +++ sha1_file.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index e15b421b6f..f442f28189

[PATCH v3 06/21] t1700: add tests for core.splitIndex

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t1700-split-index.sh | 37 + 1 file changed, 37 insertions(+) diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index 292a0720fc..db8c39f446 100755 --- a/t/t1700-split-index.sh +++

[PATCH v3 07/21] Documentation/config: add information for core.splitIndex

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/config.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index d51182a060..221c5982c0 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@

[PATCH v3 18/21] read-cache: refactor read_index_from()

2016-12-26 Thread Christian Couder
It looks better and is simpler to review when we don't compute the same things many times in the function. It will also help make the following commit simpler. Signed-off-by: Christian Couder --- read-cache.c | 14 -- 1 file changed, 8 insertions(+), 6

[PATCH v3 08/21] Documentation/git-update-index: talk about core.splitIndex config var

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/git-update-index.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index 7386c93162..e091b2a409 100644 ---

[PATCH v3 20/21] Documentation/config: add splitIndex.sharedIndexExpire

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/config.txt | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index e0f5a77980..24e771d22e 100644 --- a/Documentation/config.txt +++

[PATCH v3 05/21] update-index: warn in case of split-index incoherency

2016-12-26 Thread Christian Couder
When users are using `git update-index --(no-)split-index`, they may expect the split-index feature to be used or not according to the option they just used, but this might not be the case if the new "core.splitIndex" config variable has been set. In this case let's warn about what will happen and

[PATCH v3 03/21] split-index: add {add,remove}_split_index() functions

2016-12-26 Thread Christian Couder
Also use the functions in cmd_update_index() in builtin/update-index.c. These functions will be used in a following commit to tweak our use of the split-index feature depending on the setting of a configuration variable. Signed-off-by: Christian Couder ---

[PATCH v3 15/21] config: add git_config_get_expiry() from gc.c

2016-12-26 Thread Christian Couder
This function will be used in a following commit to get the expiration time of the shared index files from the config, and it is generic enough to be put in "config.c". Signed-off-by: Christian Couder --- builtin/gc.c | 15 ++- cache.h | 3 +++

[PATCH v3 09/21] config: add git_config_get_max_percent_split_change()

2016-12-26 Thread Christian Couder
This new function will be used in a following commit to get the value of the "splitIndex.maxPercentChange" config variable. Signed-off-by: Christian Couder --- cache.h | 1 + config.c | 15 +++ 2 files changed, 16 insertions(+) diff --git a/cache.h

[PATCH v3 11/21] t1700: add tests for splitIndex.maxPercentChange

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t1700-split-index.sh | 72 ++ 1 file changed, 72 insertions(+) diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index 507a1dd1ad..f03addf654 100755 ---

[PATCH v3 14/21] read-cache: touch shared index files when used

2016-12-26 Thread Christian Couder
When a split-index file is created, let's update the mtime of the shared index file that the split-index file is referencing. In a following commit we will make shared index file expire depending on their mtime, so updating the mtime makes sure that the shared index file will not be deleted soon.

[PATCH v3 21/21] Documentation/git-update-index: explain splitIndex.*

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/config.txt | 6 +++--- Documentation/git-update-index.txt | 37 + 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Documentation/config.txt

[PATCH v3 17/21] t1700: test shared index file expiration

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t1700-split-index.sh | 44 1 file changed, 44 insertions(+) diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index f03addf654..f448fc13cd 100755 --- a/t/t1700-split-index.sh

[PATCH v3 10/21] read-cache: regenerate shared index if necessary

2016-12-26 Thread Christian Couder
When writing a new split-index and there is a big number of cache entries in the split-index compared to the shared index, it is a good idea to regenerate the shared index. By default when the ratio reaches 20%, we will push back all the entries from the split-index into a new shared index file

[PATCH v3 04/21] read-cache: add and then use tweak_split_index()

2016-12-26 Thread Christian Couder
This will make us use the split-index feature or not depending on the value of the "core.splitIndex" config variable. Signed-off-by: Christian Couder --- read-cache.c | 17 + 1 file changed, 17 insertions(+) diff --git a/read-cache.c b/read-cache.c

[PATCH v3 19/21] read-cache: use freshen_shared_index() in read_index_from()

2016-12-26 Thread Christian Couder
This way a share index file will not be garbage collected if we still read from an index it is based from. As we need to read the current index before creating a new one, the tests have to be adjusted, so that we don't expect an old shared index file to be deleted right away when we create a new

[PATCH v3 12/21] Documentation/config: add splitIndex.maxPercentChange

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/config.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index 221c5982c0..e0f5a77980 100644 --- a/Documentation/config.txt +++

[PATCH v3 01/21] config: mark an error message up for translation

2016-12-26 Thread Christian Couder
Signed-off-by: Christian Couder --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 83fdecb1bc..2eaf8ad77a 100644 --- a/config.c +++ b/config.c @@ -1701,8 +1701,8 @@ int git_config_get_untracked_cache(void)

[PATCH v3 00/21] Add configuration options for split-index

2016-12-26 Thread Christian Couder
Goal We want to make it possible to use the split-index feature automatically by just setting a new "core.splitIndex" configuration variable to true. This can be valuable as split-index can help significantly speed up `git rebase` especially along with the work to libify `git apply` that

[PATCH v3 02/21] config: add git_config_get_split_index()

2016-12-26 Thread Christian Couder
This new function will be used in a following commit to know if we want to use the split index feature or not. Signed-off-by: Christian Couder --- cache.h | 1 + config.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/cache.h b/cache.h index

Re: [PATCH v2 16/21] read-cache: unlink old sharedindex files

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 12:58 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:42PM +0100, Christian Couder wrote: >> +static int clean_shared_index_files(const char *current_hex) >> +{ >> + struct dirent *de; >> + DIR *dir = opendir(get_git_dir()); >> + >> +

Re: [PATCH v2 10/21] read-cache: regenerate shared index if necessary

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 12:48 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:36PM +0100, Christian Couder wrote: >> +static const int default_max_percent_split_change = 20; >> + >> +static int too_many_not_shared_entries(struct index_state *istate) >> +{ >> + int i,

Re: [PATCH v2 04/21] read-cache: add and then use tweak_split_index()

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 12:18 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:30PM +0100, Christian Couder wrote: >> +static void tweak_split_index(struct index_state *istate) >> +{ >> + switch (git_config_get_split_index()) { >> + case -1: /* unset: do nothing */

Re: [PATCH v2 02/21] config: add git_config_get_split_index()

2016-12-26 Thread Christian Couder
On Mon, Dec 19, 2016 at 12:14 PM, Duy Nguyen wrote: > On Sat, Dec 17, 2016 at 03:55:28PM +0100, Christian Couder wrote: >> diff --git a/config.c b/config.c >> index 2eaf8ad77a..c1343bbb3e 100644 >> --- a/config.c >> +++ b/config.c >> @@ -1709,6 +1709,16 @@ int