[PATCH 05/26] object-store: close all packs upon clearing the object store

2018-02-12 Thread Stefan Beller
Signed-off-by: Stefan Beller --- builtin/am.c | 2 +- builtin/clone.c| 2 +- builtin/fetch.c| 2 +- builtin/merge.c| 2 +- builtin/receive-pack.c | 2 +- object.c | 6 ++ packfile.c | 4 ++-- packfile.h | 2 +- 8 files ch

[PATCH 03/26] object-store: free alt_odb_list

2018-02-12 Thread Stefan Beller
Free the memory and reset alt_odb_{list, tail} to NULL. Signed-off-by: Stefan Beller --- object.c | 17 + 1 file changed, 17 insertions(+) diff --git a/object.c b/object.c index 9b5b65e189..d778f09717 100644 --- a/object.c +++ b/object.c @@ -446,7 +446,24 @@ void clear_commit_ma

[PATCH 02/26] object-store: move alt_odb_list and alt_odb_tail to object store

2018-02-12 Thread Stefan Beller
In a process with multiple repositories open, alternates should be associated to a single repository and not shared globally. Move alt_odb_list and alt_odb_tail into the_repository and adjust callers to reflect this. Now that the alternative object data base is per repository, we're leaking its me

[PATCH 01/26] repository: introduce raw object store field

2018-02-12 Thread Stefan Beller
The raw object store field will contain any objects needed for access to objects in a given repository. This patch introduces the raw object store and populates it with the `objectdir`, which used to be part of the repository struct. As the struct gains members, we'll also populate the function t

[PATCH 00/26] Moving global state into the repository object (part 1)

2018-02-12 Thread Stefan Beller
This is a real take on the first part of the recent RFC[1]. Jonathan Tan suggested[2] that "sha1_loose_object_info to handle arbitrary repositories" might be a good breaking point for a first part at that RFC at patch 38. This series is smaller and contains only 26 patches as the patches in the b

[PATCH 07/26] pack: move approximate object count to object store

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder The approximate_object_count() function maintains a rough count of objects in a repository to estimate how long object name abbreviates should be. Object names are scoped to a repository and the appropriate length may differ by repository, so the object count should not be

[PATCH 21/26] sha1_file: allow sha1_file_name to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 3 +-- sha1_file.c| 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/object-store.h b/object-store.h index 0a4561f476..b4756444bb 100644 --- a/object-store.h +++ b/object-store.h @@ -67,8 +

[PATCH 14/26] sha1_file: allow prepare_alt_odb to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
Signed-off-by: Stefan Beller --- object-store.h | 3 +-- sha1_file.c| 21 +++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/object-store.h b/object-store.h index d96a16edd1..add1d4e27c 100644 --- a/object-store.h +++ b/object-store.h @@ -61,7 +61,6 @@ str

[PATCH 08/26] sha1_file: add raw_object_store argument to alt_odb_usable

2018-02-12 Thread Stefan Beller
Add a raw_object_store to alt_odb_usable to be more specific about which repository to act on. The choice of the repository is delegated to its only caller link_alt_odb_entry. Signed-off-by: Stefan Beller --- sha1_file.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH 11/26] sha1_file: add repository argument to link_alt_odb_entries

2018-02-12 Thread Stefan Beller
See previous patch for explanation. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 4fdfdd945a..b090f403d8 100644 --- a/sha1_file.c +++ b/sha1_fil

[PATCH 10/26] sha1_file: add repository argument to read_info_alternates

2018-02-12 Thread Stefan Beller
See previous patch for explanation. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 7dc5f690e2..4fdfdd945a 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -3

[PATCH 19/26] sha1_file: add repository argument to map_sha1_file

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Add a repository argument to allow map_sha1_file callers to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a m

[PATCH 09/26] sha1_file: add repository argument to link_alt_odb_entry

2018-02-12 Thread Stefan Beller
Add a repository argument to allow the link_alt_odb_entry caller to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. Since the implementation does not yet work with other

[PATCH 15/26] sha1_file: add repository argument to sha1_file_name

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Add a repository argument to allow sha1_file_name callers to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a

[PATCH 20/26] sha1_file: add repository argument to sha1_loose_object_info

2018-02-12 Thread Stefan Beller
Add a repository argument to allow the sha1_loose_object_info caller to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catc

[PATCH 25/26] sha1_file: allow map_sha1_file to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 3 +-- sha1_file.c| 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/object-store.h b/object-store.h index b4756444bb..f164c4e5c9 100644 --- a/object-store.h +++ b/object-store.h @@ -68,8

[PATCH 18/26] sha1_file: add repository argument to map_sha1_file_1

2018-02-12 Thread Stefan Beller
Add a repository argument to allow the map_sha1_file_1 caller to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch calle

[PATCH 26/26] sha1_file: allow sha1_loose_object_info to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 6237d59a59..c3f35914ce 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1148,10 +1148,

[PATCH 12/26] sha1_file: add repository argument to prepare_alt_odb

2018-02-12 Thread Stefan Beller
See previous patch for explanation. While at it, move the declaration to object-store.h, where it should be easier to find. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- builtin/fsck.c | 2 +- cache.h| 1 - object-store.h | 3 +++ packfile.c | 2 +- sha1_file.

[PATCH 13/26] sha1_file: allow link_alt_odb_entries to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
Actually this also allows read_info_alternates and link_alt_odb_entry to handle arbitrary repositories, but link_alt_odb_entries is the most interesting function in this set of functions, hence the commit subject. These functions span a strongly connected component in the function graph, i.e. the

[PATCH 22/26] sha1_file: allow stat_sha1_file to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index fddada5756..21ddbff846 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -874,19 +874,18

[PATCH 23/26] sha1_file: allow open_sha1_file to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 21ddbff846..50202f0959 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -898,22 +898,21

[PATCH 17/26] sha1_file: add repository argument to open_sha1_file

2018-02-12 Thread Stefan Beller
Add a repository argument to allow the open_sha1_file caller to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch caller

[PATCH 24/26] sha1_file: allow map_sha1_file_1 to handle arbitrary repositories

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 50202f0959..86b0ca7089 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -928,10 +928,8 @@ s

[PATCH 16/26] sha1_file: add repository argument to stat_sha1_file

2018-02-12 Thread Stefan Beller
Add a repository argument to allow the stat_sha1_file caller to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch caller

[PATCH 04/26] object-store: move packed_git and packed_git_mru to object store

2018-02-12 Thread Stefan Beller
In a process with multiple repositories open, packfile accessors should be associated to a single repository and not shared globally. Move packed_git and packed_git_mru into the_repository and adjust callers to reflect this. Patch generated by 1. Moving the struct packed_git declaration to objec

[PATCH 06/26] pack: move prepare_packed_git_run_once to object store

2018-02-12 Thread Stefan Beller
From: Jonathan Nieder Each repository's object store can be initialized independently, so they must not share a run_once variable. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 8 +++- packfile.c | 7 +++ 2 files changed, 10 insertions(+), 5 dele

Re: [PATCH 00/26] Moving global state into the repository object (part 1)

2018-02-12 Thread Stefan Beller
On Mon, Feb 12, 2018 at 5:22 PM, Stefan Beller wrote: > I developed this series [...] on top of current master. also available at https://github.com/stefanbeller/git/tree/object-store-part1

[PATCH] color.h: document and modernize header

2018-02-12 Thread Stefan Beller
Add documentation explaining the functions in color.h. While at it, migrate the function `color_set` into grep.c, where the only callers are. Signed-off-by: Stefan Beller --- * fixed commit message * followed Jeffs/Erics advice and rewrote want_color()s doc once again. color.c | 7 ---

Re: [PATCH 2/2] t5556: replace test_i18ngrep with a simple grep

2018-02-12 Thread Ramsay Jones
On 12/02/18 20:18, Junio C Hamano wrote: > Ramsay Jones writes: > >> Attempting to grep the output of test_i18ngrep will not work under a >> poison build, since the output is (almost) guaranteed not to have the >> string you are looking for. In this case, the output of test_i18ngrep >> is furth

[PATCH v2] docs/interpret-trailers: fix agreement error

2018-02-12 Thread brian m. carlson
In the description of git interpret-trailers, we describe "a group…of lines" that have certain characteristics. Ensure both options describing this group use a singular verb for parallelism. Signed-off-by: brian m. carlson --- Documentation/git-interpret-trailers.txt | 2 +- 1 file changed, 1 i

Re: [PATCH] color.h: document and modernize header

2018-02-12 Thread Eric Sunshine
On Mon, Feb 12, 2018 at 8:41 PM, Stefan Beller wrote: > Add documentation explaining the functions in color.h. > While at it, migrate the function `color_set` into grep.c, > where the only callers are. > > Signed-off-by: Stefan Beller > --- > diff --git a/color.h b/color.h > @@ -76,22 +76,46 @@ i

Re: [PATCH 5/8] rebase: introduce the --recreate-merges option

2018-02-12 Thread Jacob Keller
On Mon, Feb 12, 2018 at 12:39 PM, Johannes Schindelin wrote: > Hi Sergey, > > On Mon, 12 Feb 2018, Sergey Organov wrote: >> > Have a look at https://github.com/git/git/pull/447, especially the >> > latest commit in there which is an early version of the deprecation I >> > intend to bring about. >>

Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook

2018-02-12 Thread Eric Sunshine
On Mon, Feb 12, 2018 at 3:01 PM, Lars Schneider wrote: >> On 12 Feb 2018, at 04:15, Eric Sunshine wrote: >> Fix this by changing to the new worktree's directory before running >> the hook, and adjust the tests to verify that the hook is indeed run >> within the correct directory. > > Looks good b

Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook

2018-02-12 Thread Eric Sunshine
On Mon, Feb 12, 2018 at 11:42 PM, Eric Sunshine wrote: > So, either approach works: removing GIT_DIR or using "worktree add"'s > existing GIT_DIR and GIT_WORK_TREE. I favor the latter since it is > consistent with how "worktree add" invokes other command already and, > especially, because it also

Re: [PATCH 5/8] rebase: introduce the --recreate-merges option

2018-02-12 Thread Sergey Organov
Hi Johannes, Johannes Schindelin writes: > Hi Sergey, > > On Mon, 12 Feb 2018, Sergey Organov wrote: > >> Johannes Schindelin writes: >> > >> > On Fri, 9 Feb 2018, Sergey Organov wrote: >> > >> >> Johannes Schindelin writes: >> >> >> >> [...] >> >> >> >> > With this patch, the goodness of the

Re: [PATCH 5/8] rebase: introduce the --recreate-merges option

2018-02-12 Thread Sergey Organov
Hi Johannes, Johannes Schindelin writes: > Hi Sergey, > > On Mon, 12 Feb 2018, Sergey Organov wrote: > >> Thanks for explanations, and could you please answer this one: >> >> [...] >> >> >> I also have trouble making sense of "Recreate merge commits instead of >> >> flattening the history by re

Re: [PATCH 5/8] rebase: introduce the --recreate-merges option

2018-02-12 Thread Sergey Organov
Hi Jake, Jacob Keller writes: > On Mon, Feb 12, 2018 at 12:39 PM, Johannes Schindelin > wrote: >> Hi Sergey, >> >> On Mon, 12 Feb 2018, Sergey Organov wrote: >>> > Have a look at https://github.com/git/git/pull/447, especially the >>> > latest commit in there which is an early version of the de

Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook

2018-02-12 Thread Johannes Sixt
Am 12.02.2018 um 04:15 schrieb Eric Sunshine: --- a/t/t2025-worktree-add.sh +++ b/t/t2025-worktree-add.sh @@ -454,20 +454,29 @@ post_checkout_hook () { test_when_finished "rm -f .git/hooks/post-checkout" && mkdir -p .git/hooks && write_script .git/hooks/post-checkout <<-\E

Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook

2018-02-12 Thread Eric Sunshine
On Tue, Feb 13, 2018 at 2:27 AM, Johannes Sixt wrote: > Am 12.02.2018 um 04:15 schrieb Eric Sunshine: >> + echo $_z40 $(git rev-parse HEAD) 1 && >> + echo $(pwd)/gumby > > $(pwd) is here and in the other tests correct. $PWD would be wrong on > Windows. Thanks for being

Re: [PATCH 2/2] t5556: replace test_i18ngrep with a simple grep

2018-02-12 Thread Junio C Hamano
Ramsay Jones writes: > I must admit that I didn't think about the effect of the useless > "| sort" on the exit status! What I saw was: a process that > received no input, sorted nothing and produced no output - pretty > much the definition of useless! ;-) I am not sure what you mean by "receive

<    1   2