[PATCH v2 01/29] t1408: add a test of stale packed refs covered by loose refs

2017-06-23 Thread Michael Haggerty
From: Junio C Hamano It is OK for the packed-refs file to contain old reference definitions that might even refer to objects that have since been garbage-collected, as long as there is a corresponding loose reference definition that overrides it. Add a test that such

[PATCH v2 07/29] validate_packed_ref_cache(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 03/29] packed_ref_store: new struct

2017-06-23 Thread Michael Haggerty
Start extracting the packed-refs-related data structures into a new class, `packed_ref_store`. It doesn't yet implement `ref_store`, but it will. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 42 +- 1 file changed, 33

[PATCH v2 09/29] get_packed_refs(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index b2ef7b3bb9..bc5c0de84e

[PATCH v2 22/29] commit_packed_refs(): use a staging file separate from the lockfile

2017-06-23 Thread Michael Haggerty
We will want to be able to hold the lockfile for `packed-refs` even after we have activated the new values. So use a separate tempfile, `packed-refs.new`, as a place to stage the new contents of the `packed-refs` file. For now this is all done within `commit_packed_refs()`, but that will change

[PATCH v2 00/29] Create a reference backend for packed refs

2017-06-23 Thread Michael Haggerty
This is v2 of a patch series creating a `packed_ref_store` reference backend. Thanks to Stefan, Junio, and Peff for their comments about v1 [1]. Changes since v1: * Picked up some whitespace fixes that Junio applied when importing v1. * A new patch 01 adds a test (written by Junio) that a

[PATCH v2 05/29] packed_ref_store: move `packed_refs_lock` member here

2017-06-23 Thread Michael Haggerty
Move the `packed_refs_lock` member from `files_ref_store` to `packed_ref_store`, and rename it to `lock` since it's now more obvious what it is locking. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 31 --- 1 file changed, 16

[PATCH v2 04/29] packed_ref_store: move `packed_refs_path` here

2017-06-23 Thread Michael Haggerty
Move `packed_refs_path` from `files_ref_store` to `packed_ref_store`, and rename it to `path` since its meaning is clear from its new context. Inline `files_packed_refs_path()`. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 25 - 1

[PATCH v2 19/29] packed-backend: new module for handling packed references

2017-06-23 Thread Michael Haggerty
Now that the interface between `files_ref_store` and `packed_ref_store` is relatively narrow, move the latter into a new module, "refs/packed-backend.h" and "refs/packed-backend.c". It still doesn't quite implement the `ref_store` interface, but it will soon. This commit moves code around and

[PATCH v2 21/29] commit_packed_refs(): report errors rather than dying

2017-06-23 Thread Michael Haggerty
Report errors via a `struct strbuf *err` rather than by calling `die()`. To enable this goal, change `write_packed_entry()` to report errors via a return value and `errno` rather than dying. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 10 +++---

[PATCH v2 06/29] clear_packed_ref_cache(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 12/29] commit_packed_refs(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 02/29] add_packed_ref(): teach function to overwrite existing refs

2017-06-23 Thread Michael Haggerty
Teach `add_packed_ref()` to overwrite an existing entry if one already exists for the specified `refname`. This means that we can call it from `files_pack_refs()`, thereby reducing the amount that the latter function needs to know about the internals of packed-reference handling. Signed-off-by:

[PATCH v2 17/29] packed_ref_store: support iteration

2017-06-23 Thread Michael Haggerty
Add the infrastructure to iterate over a `packed_ref_store`. It's a lot of boilerplate, but it's all part of a campaign to make `packed_ref_store` implement `ref_store`. In the future, this iterator will work much differently. Signed-off-by: Michael Haggerty ---

[PATCH v2 16/29] packed_peel_ref(): new function, extracted from `files_peel_ref()`

2017-06-23 Thread Michael Haggerty
This will later become a method of `packed_ref_store`. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 14/29] get_packed_ref(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 13/29] rollback_packed_refs(): take a `packed_ref_store *` parameter

2017-06-23 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index

[PATCH v2 20/29] packed_ref_store: make class into a subclass of `ref_store`

2017-06-23 Thread Michael Haggerty
Add the infrastructure to make `packed_ref_store` implement `ref_store`, at least formally (few of the methods are actually implemented yet). Change the functions in its interface to take `ref_store *` arguments. Change `files_ref_store` to store a pointer to `ref_store *` and to call functions

Re: your mail

2017-06-23 Thread demerphq
On 22 June 2017 at 23:58, Ævar Arnfjörð Bjarmason wrote: > +You don't need to be subscribed to the list to send mail to it, and > +others on-list will generally CC you when replying (although some > +forget this). It's adviced to subscribe to the list if you want to be FWIW:

<    1   2