Re: [PATCH 5/5] odb: make creation of on-disk structures pluggable

Junio C Hamano <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
Patrick Steinhardt <[email protected]> writes:

> Note that there is one exception though: the "objects" directory must
> exist in a repository regardless of which backend is in use. If it
> doesn't exist then the repository is not treated as a Git repository at
> all. Consequently, we create this directory regardless of the backend.

Very good thing to leave a note in the log message for.

Perhaps in Git 4.0 ;-)

> @@ -271,6 +289,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,
>  
>  	files->base.free = odb_source_files_free;
>  	files->base.close = odb_source_files_close;
> +	files->base.create_on_disk = odb_source_files_create_on_disk;
>  	files->base.prepare = odb_source_files_prepare;
>  	files->base.read_object_info = odb_source_files_read_object_info;
>  	files->base.read_object_stream = odb_source_files_read_object_stream;

If we are going to write a brand new object backing store that does
not use an on-disk filesystem (or a network filesystem, for that
matter) but still requires some sort of "initialization", for
example, an object database in the cloud that needs provisioning
before its first use, would this virtual function be the ideal place
to do so?

I wonder if we can give it a name better suited to its purpose by
moving away from the '_on_disk' suffix.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.