[PATCH 04/10] packed_delete_refs(): implement method

2017-08-29 Thread Michael Haggerty
Implement `packed_delete_refs()` using a reference transaction. This means that `files_delete_refs()` can use `refs_delete_refs()` instead of `repack_without_refs()` to delete any packed references, decreasing the coupling between the classes. Signed-off-by: Michael Haggerty <mhag...@alum.mit.

[PATCH 06/10] files_initial_transaction_commit(): use a transaction for packed refs

2017-08-29 Thread Michael Haggerty
Used a `packed_ref_store` transaction in the implementation of `files_initial_transaction_commit()` rather than using internal features of the packed ref store. This further decouples `files_ref_store` from `packed_ref_store`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs

[PATCH 05/10] files_pack_refs(): use a reference transaction to write packed refs

2017-08-29 Thread Michael Haggerty
Now that the packed reference store supports transactions, we can use a transaction to write the packed versions of references that we want to pack. This decreases the coupling between `files_ref_store` and `packed_ref_store`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs

[PATCH 07/10] t1404: demonstrate two problems with reference transactions

2017-08-29 Thread Michael Haggerty
. * If the `packed-refs` file is locked so long that `update-ref` fails to lock it, then the reference can be left permanently in the incorrect state described in the previous point. In a moment, both problems will be fixed. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- The first of t

[PATCH 00/10] Implement transactions for the packed ref store

2017-08-29 Thread Michael Haggerty
. This patch series is also available as branch `packed-ref-transactions` in my fork on GitHub [1]. A draft of the patch series to change `packed_ref_store` to use mmap and get rid of its `ref_cache` is available as branch `mmap-packed-refs` from the same source. Michael [1] https://github.com

Re: [PATCH 1/2] refs/files-backend: duplicate strings added to affected_refnames

2017-08-28 Thread Michael Haggerty
ymref_update()` but it's not too bad: * Do the initial check using `string_list_has_string()` rather than calling `string_list_insert()` already. * After `new_update` has been created, call `string_list_insert()`, passing it `new_update->refname` as the string. If this is done in place of your first commit, then your second commit could be left unchanged. Michael

Re: [PATCH 02/12] load_subtree(): remove unnecessary conditional

2017-08-28 Thread Michael Haggerty
of the branch that I pushed to GitHub but haven't yet submitted to the list. How would you like to proceed? Do you want me to submit a patch (adding the assertion) that applies on top of this branch? Michael

Re: [PATCH 02/12] load_subtree(): remove unnecessary conditional

2017-08-27 Thread Michael Haggerty
On Sat, Aug 26, 2017 at 6:38 PM, Junio C Hamano <gits...@pobox.com> wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> At this point in the code, len is *always* <= 20. > > This is the kind of log message that makes me unconfortable, as it > lacks &

[PATCH 12/12] load_subtree(): declare some variables to be `size_t`

2017-08-26 Thread Michael Haggerty
* `prefix_len` * `path_len` * `i` It's good hygiene. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes.c b/notes.c index d5409b55e3..7f5bfa19c7 100644 --- a/notes.c +++ b/notes.c @@ -406,7

[PATCH 05/12] load_subtree(): separate logic for internal vs. terminal entries

2017-08-26 Thread Michael Haggerty
. The logic separation also simplifies upcoming changes. This prevents us from leaking memory for a leaf_node in the case of wrong-sized paths. There are still memory leaks in this code; they will be fixed in upcoming commits. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.

[PATCH 09/12] load_subtree(): combine some common code

2017-08-26 Thread Michael Haggerty
Write the length into `object_oid` (before copying) rather than `l->key_oid` (after copying). Then combine some code from the two `if` blocks. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) d

[PATCH 10/12] get_oid_hex_segment(): don't pad the rest of `oid`

2017-08-26 Thread Michael Haggerty
Remove the feature of `get_oid_hex_segment()` that it pads the rest of the `oid` argument with zeros. Instead, do this at the caller who needs it. This makes the functionality of this function more coherent and removes the need for its `oid_len` argument. Signed-off-by: Michael Haggerty <m

[PATCH 07/12] load_subtree(): only consider blobs to be potential notes

2017-08-26 Thread Michael Haggerty
The old code converted any entry whose path constituted a full SHA-1 as a leaf node, without regard for the type of the entry. But only blobs can be notes. So treat entries whose paths *look like* notes paths but that are not blobs as non-notes. Signed-off-by: Michael Haggerty <m

[PATCH 02/12] load_subtree(): remove unnecessary conditional

2017-08-26 Thread Michael Haggerty
At this point in the code, len is *always* <= 20. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/notes.c b/notes.c index 00630a9396..f7ce64ff48 100644 --- a/note

[PATCH 11/12] hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`

2017-08-26 Thread Michael Haggerty
()`. * Remove a loop variable: just count `len` down instead. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/notes.c b/notes.c index ce9ba36179..d5409b55e3 100644 --- a/n

[PATCH 08/12] get_oid_hex_segment(): return 0 on success

2017-08-26 Thread Michael Haggerty
Nobody cares about the return value of get_oid_hex_segment() except to check whether it failed. So just return 0 on success. And while we're updating its docstring, update it for some argument renaming that happened a while ago. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- n

[PATCH 03/12] load_subtree(): reduce the scope of some local variables

2017-08-26 Thread Michael Haggerty
Declare the variables inside the loop, to make it more obvious that their values are not carried across loop iterations. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notes.c b/notes.c

[PATCH 00/12] Clean up notes-related code around `load_subtree()`

2017-08-26 Thread Michael Haggerty
branch is also available from my Git fork [1] as branch `load-subtree-cleanup`. Michael [1] https://github.com/mhagger/git Michael Haggerty (12): notes: make GET_NIBBLE macro more robust load_subtree(): remove unnecessary conditional load_subtree(): reduce the scope of some local variables

[PATCH 01/12] notes: make GET_NIBBLE macro more robust

2017-08-26 Thread Michael Haggerty
Put parentheses around sha1. Otherwise it could fail for something like GET_NIBBLE(n, (unsigned char *)data); Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes.c b/notes.c index f090c88363..0063

[PATCH 04/12] load_subtree(): fix incorrect comment

2017-08-26 Thread Michael Haggerty
converted to "de/ad/beef", and indeed the test added in commit 851c2b3 verifies that this case works correctly. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- notes.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/notes.c

[PATCH 06/12] load_subtree(): check earlier whether an internal node is a tree entry

2017-08-26 Thread Michael Haggerty
If an entry is not a tree entry, then it cannot possibly be an internal node. But the old code checked this condition only after allocating a leaf_node object and therefore leaked that memory. Instead, check before even entering this branch of the code. Signed-off-by: Michael Haggerty <m

Re: [PATCH v4 00/16] Fix git-gc losing objects in multi worktree

2017-08-25 Thread Michael J Gruber
verything". I gues my suggestion would be: --all as it is now (refs/* plus HEAD) --head alternative way to say HEAD (as it is now for show-ref) --heads HEAD for all linked worktrees (incompatible change for show-ref) And all of them should work the same for the rev-list/log family as well as for-each-ref/show-ref. I thinking that changing show-ref (porcelain, not quite as commonly used) should do the least harm compared to all other options. Michael

Re: [RFC PATCH 0/7] Implement ref namespaces as a ref storage backend

2017-08-24 Thread Michael Haggerty
the namespace layer. I guess it is also clear that symrefs on disk have to contain the full reference names of their targets, but when they are read via a namespace-view, the caller should see the short name as the target. [...] Michael

Re: [PATCH] Retry acquiring reference locks for 100ms

2017-08-24 Thread Michael Haggerty
On Wed, Aug 23, 2017 at 11:55 PM, Junio C Hamano <gits...@pobox.com> wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> The philosophy of reference locking has been, "if another process is >> changing a reference, then whatever I'm trying to do to it w

[PATCH v3 0/4] Keep merge during kills

2017-08-23 Thread Michael J Gruber
Compared to the 3-item v2: 1/4 == 1/3 2/4 is new as per Junio's suggestion: clarify the call-chain leading up to prepare_to_commit() 3/4 == 2/3 with amended subject 4/4 is 3/3 rebased, squash-if removed Michael J Gruber (4): Documentation/git-merge: explain --continue merge: clarify call

[PATCH v3 4/4] merge: save merge state earlier

2017-08-23 Thread Michael J Gruber
crafted after the in t7502. The test requires EXECKEEPSPID (thus does not run under MINGW). Save the merge state earlier (in the non-squash case) so that it does not get lost. This makes the test pass. Reported-by: hIpPy <hippy2...@gmail.com> Signed-off-by: Michael J Gruber <g...@

[PATCH v3 2/4] merge: clarify call chain

2017-08-23 Thread Michael J Gruber
the tree, which also avoids setting automerge_was_ok (just as in the proper ret==1 case), so that finish_automerge() is not called. To ensure that no code change breaks that assumption, safe-guard prepare_to_commit() by a BUG() statement. Suggested-by: junio Signed-off-by: Michael J Gruber &l

[PATCH v3 3/4] merge: split write_merge_state in two

2017-08-23 Thread Michael J Gruber
are interrupted: we write heads-mode-msg now when we used to write heads-msg-mode. Signed-off-by: Michael J Gruber <g...@grubix.eu> --- builtin/merge.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index dafec80fa9..db33

[PATCH v3 1/4] Documentation/git-merge: explain --continue

2017-08-23 Thread Michael J Gruber
Currently, 'git merge --continue' is mentioned but not explained. Explain it. Signed-off-by: Michael J Gruber <g...@grubix.eu> --- Documentation/git-merge.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt

Re: [PATCH v2 3/3] merge: save merge state earlier

2017-08-22 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 22.08.2017 02:38: > Michael J Gruber <g...@grubix.eu> writes: > >> static void prepare_to_commit(struct commit_list *remoteheads) >> { >> struct strbuf msg = STRBUF_INIT; >> @@ -767,6 +768,8 @@ static void

Re: [PATCH v2 1/3] Documentation/git-merge: explain --continue

2017-08-22 Thread Michael J Gruber
Martin Ågren venit, vidit, dixit 21.08.2017 18:43: > On 21 August 2017 at 14:53, Michael J Gruber <g...@grubix.eu> wrote: >> Currently, 'git merge --continue' is mentioned but not explained. >> >> Explain it. >> >> Signed-off-by: Michael J Gruber <g.

[PATCH v2 2/3] merge: split write_merge_state in two

2017-08-21 Thread Michael J Gruber
write_merge_state() writes out the merge heads, mode, and msg. But we may want to write out heads, mode without the msg. So, split out heads (+mode) into a separate function write_merge_heads() that is called by write_merge_state(). No funtional change so far. Signed-off-by: Michael J Gruber &l

[PATCH v2 0/3] Keep merge during kills

2017-08-21 Thread Michael J Gruber
of people that I'd like to make angry - at least not without a good reason. Michael J Gruber (3): Documentation/git-merge: explain --continue merge: split write_merge_state in two merge: save merge state earlier Documentation/git-merge.txt | 5 - builtin/merge.c | 14

[PATCH v2 3/3] merge: save merge state earlier

2017-08-21 Thread Michael J Gruber
(in the non-squash case) so that it does not get lost. Reported-by: hIpPy <hippy2...@gmail.com> Signed-off-by: Michael J Gruber <g...@grubix.eu> --- builtin/merge.c | 3 +++ t/t7600-merge.sh | 15 +++ 2 files changed, 18 insertions(+) diff --git a/builtin/merge.c b/builtin/m

[PATCH v2 1/3] Documentation/git-merge: explain --continue

2017-08-21 Thread Michael J Gruber
Currently, 'git merge --continue' is mentioned but not explained. Explain it. Signed-off-by: Michael J Gruber <g...@grubix.eu> --- Documentation/git-merge.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt

[PATCH] Retry acquiring reference locks for 100ms

2017-08-21 Thread Michael Haggerty
ckTimeout`, to allow this setting to be tweaked. Note: the function `get_files_ref_lock_timeout_ms()` cannot be private to the files backend because it is also used by `write_pseudoref()` and `delete_pseudoref()`, which are defined in `refs.c` so that they can be used by other reference backends. Si

[PATCH] merge: save merge state earlier

2017-08-21 Thread Michael J Gruber
(in the non-squash case) so that it does not get lost. Reported-by: hIpPy <hippy2...@gmail.com> Signed-off-by: Michael J Gruber <g...@grubix.eu> --- builtin/merge.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c inde

Re: Git makes a merge commit but as a normal (non-merge) commit

2017-08-21 Thread Michael J Gruber
ead) before launching the editor. In any case, the following patch solves the problem and passes the existing tests. But I'll wait for more comments (and think about a test meanwhile). Michael

[PATCH 2/2] Documentation/git-for-each-ref: clarify peeling of tags for --format

2017-08-18 Thread Michael J Gruber
to be classical english. Try and straighten that explanation out a bit. Signed-off-by: Michael J Gruber <g...@grubix.eu> --- Documentation/git-for-each-ref.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-fo

[PATCH 1/2] Documentation: use proper wording for ref format strings

2017-08-18 Thread Michael J Gruber
to an object but not vice versa, so the object cannot possible know %(refname), for example. Thus, this is wrong independent of refs being objects (one day, maybe) or not. Change the wording to make this clearer (and distinguish it from formats for the log family). Signed-off-by: Michael J Gruber

Re: reftable [v6]: new ref storage format

2017-08-18 Thread Michael Haggerty
On Wed, Aug 16, 2017 at 12:47 AM, Shawn Pearce <spea...@spearce.org> wrote: > On Mon, Aug 14, 2017 at 5:13 AM, Michael Haggerty <mhag...@alum.mit.edu> > wrote: >> On 08/07/2017 03:47 AM, Shawn Pearce wrote: >>> 6th iteration of the reftable storage form

Re: Weirdness with git change detection

2017-08-18 Thread Michael J Gruber
at a specific "point in time" (attributes, config) for specific foo, but that wouldn't catch the case above, even if we iterated over all commits which affect files that the filter (currently) applies to. Keep in mind that filters are a killer feature, so if you shoot yourself in the foot: it could have come worse ;) Michael

[PATCH] files-backend: cheapen refname_available check when locking refs

2017-08-17 Thread Michael Haggerty
bove also claims that the performance cost "will be regained later". The idea was that once the packed-refs were finished being split out into a separate ref-store, we could limit the `refs_verify_refname_available()` call to the packed references again. That is what we do now. Signed-off-b

Re: reftable [v7]: new ref storage format

2017-08-17 Thread Michael Haggerty
updates overwrote their effects, and either * reflogs were turned off for those updates, or * the corresponding reflogs have been compacted into a separate file, or * the corresponding reflog entries for those updates have been expired. Michael

Re: reftable [v6]: new ref storage format

2017-08-14 Thread Michael Haggerty
On 08/07/2017 03:47 AM, Shawn Pearce wrote: > 6th iteration of the reftable storage format. Thanks! > Changes from v5: > - extensions.refStorage = reftable is used to select this format. > > - Log records can be explicitly deleted (for refs/stash). > - Log records may use

Re: [PATCH] Drop some dashes from built-in invocations in scripts

2017-08-07 Thread Michael Forney
On 8/7/17, Junio C Hamano wrote: > Just to avoid possible confusion, the above is not to say "once it > is decided, you are not allowed to bring fresh arguments to the > discussion". As Peff said [*2*] in that old discussion thread, the > circumstances may have changed over 9

Re: [PATCH] Drop some dashes from built-in invocations in scripts

2017-08-05 Thread Michael Forney
On 8/5/17, Junio C Hamano <gits...@pobox.com> wrote: > Michael Forney <mfor...@mforney.org> writes: >> On 8/5/17, Junio C Hamano <gits...@pobox.com> wrote: >>> Have you made sure that all of these scripts, before calling >>> 'git-foo' in the curren

Re: [PATCH] Drop some dashes from built-in invocations in scripts

2017-08-05 Thread Michael Forney
On 8/5/17, Junio C Hamano wrote: > Have you made sure that all of these scripts, before calling > 'git-foo' in the current code, update their PATH so that these found > in the bog standard place (i.e. GIT_EXEC_PATH)? > > The reason I ask is because we can rest assured these

[PATCH] Drop some dashes from built-in invocations in scripts

2017-08-05 Thread Michael Forney
This way, they still work even if the built-in symlinks aren't installed. Signed-off-by: Michael Forney <mfor...@mforney.org> --- It looks like there was an effort to do this a number of years ago (through `make remove-dashes`). These are just a few I noticed were still left in the .sh s

Re: reftable [v4]: new ref storage format

2017-08-03 Thread Michael Haggerty
objects with this prefix: child_addr+ : varint } ``` On Thu, Aug 3, 2017 at 3:26 PM, Shawn Pearce <spea...@spearce.org> wrote: > On Thu, Aug 3, 2017 at 11:38 AM, Michael Haggerty <mhag...@alum.mit.edu> > wrote: >> On Tue, Aug 1, 2017 at 7:38 PM, Shawn Pearce <spea...@spea

Re: reftable [v4]: new ref storage format

2017-08-03 Thread Michael Haggerty
On Tue, Aug 1, 2017 at 7:38 PM, Shawn Pearce <spea...@spearce.org> wrote: > On Tue, Aug 1, 2017 at 6:51 PM, Michael Haggerty <mhag...@alum.mit.edu> wrote: >> On Tue, Aug 1, 2017 at 4:27 PM, Shawn Pearce <spea...@spearce.org> wrote: >>> On Mon, Jul 31, 2017

Re: reftable [v4]: new ref storage format

2017-08-01 Thread Michael Haggerty
On Tue, Aug 1, 2017 at 4:27 PM, Shawn Pearce <spea...@spearce.org> wrote: > On Mon, Jul 31, 2017 at 11:41 PM, Michael Haggerty <mhag...@alum.mit.edu> > wrote: >> On Sun, Jul 30, 2017 at 8:51 PM, Shawn Pearce <spea...@spearce.org> wrote: >>> 4th i

Re: reftable [v4]: new ref storage format

2017-08-01 Thread Michael Haggerty
On Tue, Aug 1, 2017 at 1:23 PM, Shawn Pearce <spea...@spearce.org> wrote: > On Mon, Jul 31, 2017 at 11:41 PM, Michael Haggerty <mhag...@alum.mit.edu> > wrote: >> On Sun, Jul 30, 2017 at 8:51 PM, Shawn Pearce <spea...@spearce.org> wrote: >>> 4th i

Re: reftable [v4]: new ref storage format

2017-08-01 Thread Michael Haggerty
dditional `log_type` # constants. message : varstr } } obj_record = { # The "next" two bytes of the SHA-1 being described: bytes : uchar[2] # The number of of child_addrs: count : varint # File offsets of the chunks containing references that point at # objects with this prefix: child_addr+ : varint } ``` Michael

Re: reftable [v3]: new ref storage format

2017-07-28 Thread Michael Haggerty
associated reflog entries are "compacted out" of the numerical sequence and the remaining indices are renumbered contiguously. But it's ok with me to make it 64 bits. Usually those extra bytes would be appear as and so should prefix- and zlib-compress well. Michael

Re: [PATCH] packed_ref_store: handle a packed-refs file that is a symlink

2017-07-28 Thread Michael Haggerty
algorithm, which would block step A of pack-refs from beginning. I have the feeling that there might be other, more improbably races lurking here, too. The eternal problems with races in the files backend is a main reason that I'm enthusiastic about the reftable proposal. Michael

Re: reftable [v3]: new ref storage format

2017-07-27 Thread Michael Haggerty
require a small amendment to my `update_index` suggestion above, namely that reflog-only and ref-only reftables might have overlapping `update_index` ranges, but the end result should be that the files together cover the whole range of `update_index`es for refs and also for reflogs. Michael

Re: [PATCH] packed_ref_store: handle a packed-refs file that is a symlink

2017-07-27 Thread Michael Haggerty
Stefan, Jonathan: you're both right, the new test needs the SYMLINKS prerequisite. Junio, would you mind adding that flag? Thanks, Michael

Fwd: Should "head" also work for "HEAD" on case-insensitive FS?

2017-07-26 Thread Michael Haggerty
Dang, I just noticed that I hit "reply" rather than "reply-to-all" on the below email (stupid GMail default). Junio, your response to this email accordingly went only to me. Michael -- Forwarded message -- From: Michael Haggerty <mhag...@alum.mit.edu> Da

Re: [PATCH 21/28] commit_packed_refs(): use a staging file separate from the lockfile

2017-07-26 Thread Michael Haggerty
in working on it. Michael [1] https://public-inbox.org/git/d0da02a8b6f0272fa70ae3b1dc80fee6c6ee8d18.150803.git.mhag...@alum.mit.edu/ On Mon, Jul 24, 2017 at 2:43 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jeff King <p...@peff.net> writes: > >> On Mon, Jul 24,

[PATCH] packed_ref_store: handle a packed-refs file that is a symlink

2017-07-26 Thread Michael Haggerty
s use case and prevent a regression like this from recurring. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- Sorry for the slow response; I've been traveling and very busy. I didn't even know that a symlinked `packed-refs` file is a thing. The attached patch should fix the pro

Re: reftable: new ref storage format

2017-07-17 Thread Michael Haggerty
On Sun, Jul 16, 2017 at 12:43 PM, Shawn Pearce <spea...@spearce.org> wrote: > On Sun, Jul 16, 2017 at 10:33 AM, Michael Haggerty <mhag...@alum.mit.edu> > wrote: >> * Do you propose to store *all* references (i.e., including the >> references that we call pseudorefs,

Re: reftable: new ref storage format

2017-07-16 Thread Michael Haggerty
tables in any detail, though I must say that my first reaction is surprise that you want to store reflogs (which are mostly immutable, rarely read, and can be an order of magnitude bigger) in the same files as references. Michael On Wed, Jul 12, 2017 at 5:17 PM, Shawn Pearce <spea...@spearce.org>

Re: [PATCH] t5534: fix misleading grep invocation

2017-07-06 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 05.07.2017 18:26: > Johannes Schindelin writes: > >> It seems to be a little-known feature of `grep` (and it certainly came >> as a surprise to this here developer who believed to know the Unix tools >> pretty well) that multiple

[PATCH v3 28/30] repack_without_refs(): don't lock or unlock the packed refs

2017-07-01 Thread Michael Haggerty
that will eventually make it possible to fix some longstanding races. The only semantic change here is that `repack_without_refs()` used to forget to release the lock in the `if (!removed)` exit path. That omission is now fixed. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs

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

2017-07-01 Thread Michael Haggerty
shortly. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/packed-backend.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/refs/packed-backend.c b/refs/packed-backend.c index 18ce47fcb7..71f92ed6f0 100644 --- a/refs/

[PATCH v3 23/30] packed_refs_lock(): function renamed from lock_packed_refs()

2017-07-01 Thread Michael Haggerty
Rename `lock_packed_refs()` to `packed_refs_lock()` for consistency with how other methods are named. Also, it's about to get some companions. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 4 ++-- refs/packed-backend.c | 10 +- refs/packed-bac

[PATCH v3 24/30] packed_refs_lock(): report errors via a `struct strbuf *err`

2017-07-01 Thread Michael Haggerty
That way the callers don't have to come up with error messages themselves. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 6 ++ refs/packed-backend.c | 17 +++-- refs/packed-backend.h | 6 +++--- 3 files changed, 16 insertions(

[PATCH v3 27/30] commit_packed_refs(): remove call to `packed_refs_unlock()`

2017-07-01 Thread Michael Haggerty
Instead, change the callers of `commit_packed_refs()` to call `packed_refs_unlock()`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 2 ++ refs/packed-backend.c | 18 -- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git

[PATCH v3 25/30] packed_refs_unlock(), packed_refs_is_locked(): new functions

2017-07-01 Thread Michael Haggerty
Add two new public functions, `packed_refs_unlock()` and `packed_refs_is_locked()`, with which callers can manage and query the `packed-refs` lock externally. Call `packed_refs_unlock()` from `commit_packed_refs()` and `rollback_packed_refs()`. Signed-off-by: Michael Haggerty <m

[PATCH v3 30/30] read_packed_refs(): die if `packed-refs` contains bogus data

2017-07-01 Thread Michael Haggerty
The old code ignored any lines that it didn't understand, including unterminated lines. This is dangerous. Instead, `die()` if the `packed-refs` file contains any unterminated lines or lines that we don't know how to handle. This fixes the tests added in the last commit. Signed-off-by: Michael

[PATCH v3 21/30] commit_packed_refs(): report errors rather than dying

2017-07-01 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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 10 +++--- refs/

[PATCH v3 29/30] t3210: add some tests of bogus packed-refs file contents

2017-07-01 Thread Michael Haggerty
If `packed-refs` contains indecipherable lines, we should emit an error and quit rather than just skipping the lines. Unfortunately, we currently do the latter. Add some failing tests demonstrating the problem. This will be fixed in the next commit. Signed-off-by: Michael Haggerty <m

[PATCH v3 26/30] clear_packed_ref_cache(): don't protest if the lock is held

2017-07-01 Thread Michael Haggerty
The existing callers already check that the lock isn't held just before calling `clear_packed_ref_cache()`, and in the near future we want to be able to call this function when the lock is held. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/packed-backend.c | 2 --

[PATCH v3 18/30] packed_read_raw_ref(): new function, replacing `resolve_packed_ref()`

2017-07-01 Thread Michael Haggerty
Add a new function, `packed_read_raw_ref()`, which is nearly a `read_raw_ref_fn`. Use it in place of `resolve_packed_ref()`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 36 +--- 1 file changed, 17 insertions(+), 19 del

[PATCH v3 20/30] packed_ref_store: make class into a subclass of `ref_store`

2017-07-01 Thread Michael Haggerty
be implemented (e.g., those having to do with symrefs or reflogs). Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 16 ++-- refs/packed-backend.c | 231 +- refs/packed-backend.h | 23 ++--- refs/refs-internal.h

[PATCH v3 13/30] rollback_packed_refs(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 5d15

[PATCH v3 19/30] packed-backend: new module for handling packed references

2017-07-01 Thread Michael Haggerty
it moves code around and adjusts its visibility, but doesn't change anything. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- Makefile | 1 + refs.c| 18 ++ refs/files-backend.c | 640 +- r

[PATCH v3 17/30] packed_ref_store: support iteration

2017-07-01 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 <mhag...@alum.mit.edu> --- refs

[PATCH v3 11/30] lock_packed_refs(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c

[PATCH v3 07/30] validate_packed_ref_cache(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 2b0d

[PATCH v3 15/30] repack_without_refs(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 2b9d

[PATCH v3 02/30] add_packed_ref(): teach function to overwrite existing refs

2017-07-01 Thread Michael Haggerty
-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 40 ++-- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index b040bb3b0a..87cecde231 100644 --- a/refs/files-backend.c +++ b/refs

[PATCH v3 14/30] get_packed_ref(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 a08d

[PATCH v3 06/30] clear_packed_ref_cache(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 de82

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

2017-07-01 Thread Michael Haggerty
This will later become a method of `packed_ref_store`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 c206

[PATCH v3 05/30] packed_ref_store: move `packed_refs_lock` member here

2017-07-01 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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 31 --- 1 file chang

[PATCH v3 12/30] commit_packed_refs(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 0d8f

[PATCH v3 03/30] packed_ref_store: new struct

2017-07-01 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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 42 +- 1 file chang

[PATCH v3 08/30] get_packed_ref_cache(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c

[PATCH v3 04/30] packed_ref_store: move `packed_refs_path` here

2017-07-01 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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 25 --

[PATCH v3 09/30] get_packed_refs(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..bc5c

[PATCH v3 10/30] add_packed_ref(): take a `packed_ref_store *` parameter

2017-07-01 Thread Michael Haggerty
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 bc5c0de84e..4943

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

2017-07-01 Thread Michael Haggerty
a test that such references don't cause problems. Signed-off-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- t/t1408-packed-refs.sh | 42 ++ 1 file changed, 42 insertions(+) create mode 100755 t/t1408-packed-refs.

[PATCH v3 00/30] Create a reference backend for packed refs

2017-07-01 Thread Michael Haggerty
corruption in packed-refs files, distinguish between unterminated lines and other corruption. * Fixed a typo in a commit message. This patch series can also be obtained from my GitHub fork [2] as branch packed-ref-store. Michael [1] v1: http://public-inbox.org/git/cover.1497534157.git.mhag

Re: [PATCH v2 29/29] read_packed_refs(): die if `packed-refs` contains bogus data

2017-07-01 Thread Michael Haggerty
On 06/23/2017 09:58 PM, Jeff King wrote: > On Fri, Jun 23, 2017 at 09:01:47AM +0200, Michael Haggerty wrote: > >> The old code ignored any lines that it didn't understand. This is >> dangerous. Instead, `die()` if the `packed-refs` file contains any >> lines that we

Re: [PATCH v2 28/29] repack_without_refs(): don't lock or unlock the packed refs

2017-07-01 Thread Michael Haggerty
On 06/23/2017 09:56 PM, Jeff King wrote: > On Fri, Jun 23, 2017 at 09:01:46AM +0200, Michael Haggerty wrote: > >> Change `repack_without_refs()` to expect the packed-refs lock to be >> held already, and not to release the lock before returning. Change the >> callers to d

Re: Solaris 11.3 SPARC grep problem with t1450-fsck.sh

2017-06-28 Thread Michael Kebe
2017-06-27 18:25 GMT+02:00 Junio C Hamano <gits...@pobox.com>: > Ah, wait, that particular grep may have GNUism. If you changed it > to > > egrep "$tree \((refs/heads/master|HEAD)@{[0-9]*}:" out > > does it make it pass for you? Yes, this is working. Greetings Michael

Solaris 11.3 SPARC grep problem with t1450-fsck.sh

2017-06-27 Thread Michael Kebe
t ok 17 - ISO-2022-JP should be shown in UTF-8 now But that's another topic, which I will open once this is fixed. Greetings Michael

Re: Compile Error v2.13.2 on Solaris SPARC

2017-06-27 Thread Michael Kebe
5986870d4 What do you think? 2017-06-27 7:41 GMT+02:00 Michael Kebe <michael.k...@gmail.com>: > 2017-06-26 22:27 GMT+02:00 Ævar Arnfjörð Bjarmason <ava...@gmail.com>: >> Could you (or anyone else for that matter) please test it with: >> >> git

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