Re: [PATCH v2 00/38] Virtualization of the refs API

2016-09-07 Thread Michael Haggerty
On 09/07/2016 09:20 PM, Junio C Hamano wrote:
> Michael Haggerty  writes:
> 
>> This is v2 of the patch series to virtualize the references API
>> (though earlier patch series similar in spirit were submitted by
>> Ronnie Sahlberg and David Turner). Thanks to Junio, Eric, and Ramsay
>> for their comments about v1 [1].
>>
>> Nobody pointed out any fundamental problems with v1, but this version
>> includes the following improvements:
> 
> Curiously, many of these improvements were already in 'pu'.

I pushed some of these changes to GitHub a while ago and mentioned that
fact on the mailing list [1]; I assume you fetched from there. But I was
waiting for the dust to settle from the earlier patch series and the
2.10 release before sending them to the mailing list again.

>> * In "refs: add methods for reflog":
>>
>>   * Don't export `files_reflog_iterator_begin()` (suggested by
>> Ramsay).
> 
> This I can see was missing in what has been in 'pu'.

And according to your "What's cooking", you were waiting on this change
before proceeding.

FYI: I haven't done significant work on any next steps, which IMO could
go in many possible directions:

* Splitting loose and packed refs storage into two separate ref_store
subclasses that are joined together using some kind of
overlay_ref_store. This is not necessarily a blocker for the following
ideas, but the overlay_ref_store would make it easier to construct other
hybrid ref-stores, as for example the ubiquitous "most references are
stored in main repo; per-worktree refs are stored in worktree".

* Implementing reference caching as a ref_store that "writes through"
changes to a backing reference store. This is also not a blocker for
other ideas, but it would allow reference caching easily to be turned
on/off for other reference stores (or even disabled for packed/loose
reference storage during command invocations that know they won't have
to iterate over references more than once).

* A variant of loose reference storage that encodes the reference names
somehow before turning them into filenames (1) to make refnames
independent of filesystem path-name encoding issues, and (2) to
eliminate D/F conflicts, thereby allowing reflogs to be retained after a
reference is deleted.

* A reference backend based on LMDB (or any other key-value store).

* A reference backend based on Shawn Pearce's RefTree proposal or
something like it [2].

It's uncertain when I'll next have a chunk of time to work on any of these.

Michael

[1] http://public-inbox.org/git/575990fb.5000...@alum.mit.edu/
[2]
http://public-inbox.org/git/CAJo=hjvnapnaddcaawavu9c4rveqdos3ev9wtguhx4fd0v_...@mail.gmail.com/t



Re: [PATCH v2 00/38] Virtualization of the refs API

2016-09-07 Thread Junio C Hamano
Michael Haggerty  writes:

> This is v2 of the patch series to virtualize the references API
> (though earlier patch series similar in spirit were submitted by
> Ronnie Sahlberg and David Turner). Thanks to Junio, Eric, and Ramsay
> for their comments about v1 [1].
>
> Nobody pointed out any fundamental problems with v1, but this version
> includes the following improvements:

Curiously, many of these improvements were already in 'pu'.

> * In "rename_ref_available(): add docstring":
>
>   * Improve docstring as suggested by Junio.

I might have squashed that in myself; it is a long time ago so I
don't quite remember.

> * In "refs: create a base class "ref_store" for files_ref_store":
>
>   * Let main_ref_store and submodule_ref_stores be initialized
> implicitly rather than initializing them explicitly to NULL.
>
>   * Add docstrings for those two variables.
>
>   * Eliminate a temporary variable in `files_downcast()`.

This was already in what has been in 'pu'.

> * In "resolve_gitlink_ref(): avoid memory allocation in many cases":
>
>   * Instead of keeping track of `orig_len`, after stripping off any
> trailing slashes check whether `path[len - 1]` is NUL.

This was already in what has been in 'pu'.

> * In "refs: add methods for reflog":
>
>   * Don't export `files_reflog_iterator_begin()` (suggested by
> Ramsay).

This I can see was missing in what has been in 'pu'.