git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patryk Obara <patryk.obara@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	Johannes.Schindelin@gmx.de, sbeller@google.com,
	"brian m . carlson" <sandals@crustytoothpaste.net>,
	"Jonathan Tan" <jonathantanmy@google.com>
Subject: Re: [PATCH v2 1/1] setup: recognise extensions.objectFormat
Date: Tue, 30 Jan 2018 17:30:04 +0100	[thread overview]
Message-ID: <e3c203f8-7971-40ce-8d9e-2dfe35f51a8a@gmail.com> (raw)
In-Reply-To: <20180130013759.GA27694@sigill.intra.peff.net>

On 30/01/2018 02:38, Jeff King wrote:
> On Sun, Jan 28, 2018 at 01:36:17AM +0100, Patryk Obara wrote:
> 
>> This extension selects which hashing algorithm from vtable should be
>> used for reading and writing objects in the object store.  At the moment
>> supports only single value (sha-1).
>>
>> In case value of objectFormat is an unknown hashing algorithm, Git
>> command will fail with following message:
>>
>>    fatal: unknown repository extensions found:
>> 	  objectformat = <value>
>>
>> To indicate, that this specific objectFormat value is not recognised.
> 
> I don't have a strong opinion on this, but it does feel a little funny
> to add this extension now, before we quite know what the code that uses
> it is going to look like (or maybe we're farther along there than I
> realize).

Code using this is already in master - in the result of overwriting
data->hash_algo, every piece of code, that was modernised starts using
the selected hash algorithm (through the_hash_algo) instead of hardcoded
sha-1.

As far as I can tell status is following:

Once following topics will land:
- po/object-id (in pu)
- brian's object-id-part-11 (in review now)
- upcoming brian's object-id-part-12 (not sent to mailing list yet)
- few more object-id conversions and uses of the_hash_algo

we'll be in state, where just dropping new entry in hash_algos table
will enable experimental switching of object format.

With changes listed above "git hash-object -w -t blob" and
"git cat-file" work with NewHash (whatever it may be - brian is using 
blake2 in his experiments, I am using openssl sha3-256).

Right now I am looking at updating index structures and functions - 
after which git commit should work. In the transition plan it's 
described as "introducing index v3" (are there any new requirements, 
that constitute "v3" besides longer hash?).

> What do we gain by doing this now as opposed to later? By the design of
> the extension code, we should complain on older versions anyway. And by
> doing it now we carry a small risk that it might not give us the
> interface we want, and it will be slightly harder to paper over this
> failed direction.

Mostly convenience for developers, who want to work on transition. 
There's no need to re-compile only for changing default hashing 
algorithm (which is useful for testing and debugging). I could carry 
this patch around to every NewHash-related branch, that I work on but 
it's annoying me already ;)

As long as hash_algos table contains only sha-1, users effectively see
this extension as noop.

> It wasn't intended that anyone would specify preciousObjects with repo
> version 0. It's a dangerous misconfiguration (because versions which
> predate the extensions mechanism won't actually respect it at all!).
> 
> So we probably ought to complain loudly on having anything in
> extensions.* when the repositoryformat is less than 1.
 >
> I originally wrote it the other way out of an abundance of
> backward-compatibility. After all "extension.*" doesn't mean anything in
> format 0, and somebody _could_ have added such a config key for their
> own purposes. But that's a pretty weak argument, and if we are going to
> start marking some extensions as forbidden there, we might as well do
> them all.

What about users, who are using new version of Git, but have it 
misconfigured with preciousObjects and repo format 0? That's why I 
decided to make repo format check specific to objectFormat extension 
(initially I made it generic to all extensions).

At the same time... there's extension.partialclone in pu and it does not 
have check on repo format.

-- 
| ← Ceci n'est pas une pipe
Patryk Obara

  reply	other threads:[~2018-01-30 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <af22d7feb8a8448fa3953c66e69a8257460bff07.1516800711.git.patryk.obara@gmail.com>
2018-01-28  0:36 ` [PATCH v2 0/1] setup: recognise extensions.objectFormat Patryk Obara
2018-01-28  0:36   ` [PATCH v2 1/1] " Patryk Obara
2018-01-28 15:40     ` brian m. carlson
2018-01-30  1:38     ` Jeff King
2018-01-30 16:30       ` Patryk Obara [this message]
2018-01-30 16:41         ` Jeff King
2018-01-30 20:53           ` Junio C Hamano
2018-01-29 15:59   ` [PATCH v3 0/1] " Patryk Obara
2018-01-29 15:59     ` [PATCH v3 1/1] " Patryk Obara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3c203f8-7971-40ce-8d9e-2dfe35f51a8a@gmail.com \
    --to=patryk.obara@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).