git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	git <git@vger.kernel.org>, "Junio C Hamano" <gitster@pobox.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Edward Thomson" <ethomson@edwardthomson.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	demerphq <demerphq@gmail.com>,
	"Brandon Williams" <bmwill@google.com>,
	"Derrick Stolee" <stolee@gmail.com>
Subject: Re: How is the ^{sha256} peel syntax supposed to work?
Date: Wed, 29 Aug 2018 11:34:40 -0700	[thread overview]
Message-ID: <CAGZ79kZsAFNE0GgUHociSDejwB+HsPVscZ4jcq__sFew7g85Bw@mail.gmail.com> (raw)
In-Reply-To: <20180829175950.GB7547@aiede.svl.corp.google.com>

On Wed, Aug 29, 2018 at 10:59 AM Jonathan Nieder <jrnieder@gmail.com> wrote:
>
> Stefan Beller wrote:
>
> >                  And with that model, <hexdigits>^{sha256}^{tree}
> > could mean to obtain the sha256 value of <hexvalue> and then derive
> > the tree from that object,
>
> What does "the sha256 value of <hexvalue>" mean?

s/hexvalue/hexdigits/
..

And with that model, <hexdigits>^{sha256}^{tree}
could mean to obtain the object using sha256 descriptors
(for trees/blobs/commits/tags) of <hexdigits> (as defined by
the step of the transition plan, it could mean <hexdigits>
to be interpreted as SHA1 or SHA256 or DWIM).

>
> For example, in a repository with two objects:
>
>  1. an object with sha1-name abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd
>     and sha256-name ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01
>
>  2. an object with sha1-name ef01ef01ef01ef01ef01ef01ef01ef01ef01ef01
>     and sha256-name abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd...
>

It would be super cool to have hash values to match vice versa,
but for the sake of the example, let's go with that.

> what objects would you expect the following to refer to?

That generally depends on the step of the transition plan
in that specific Git repository.

I thought these format specifiers would only describe how to
output the object names correctly for now, so it could be
possible to have:

$ git show abcdabcd^{sha1}
commit abcdabcd...
....

$ git show abcdabcd^{sha256}
commit ef01ef01e...
....

in one step and

$ git show abcdabcd^{sha1}
commit ef01ef01e...
....

$ git show abcdabcd^{sha256}
commit abcdabcd...
....

in another step, and in yet another step it could mean

$ git show abcdabcd^{sha1}
commit abcdabcd[...]^{sha1}
...

But my question was more hinting to the point that we should not
overload the syntax to mean much more than either output formatting
or hash selection.

The third meaning could be used for verifying objects as we could
use this syntax to mean

  "please verify the signature of the object (as given by ^{hash}"

or it could mean

  "please verify the signature of the object as given and ensure that
    it was signed in this ^{hash} and not in a weaker hash world".

And I would think all the verification should not be folded into this
notation for now, but we only want to ask for the output to be
one or the other hash, or we could ask for an object that is
<hexdigits> in the specified hash, but these two modes depend
on the step in the transition plan.

Stefan

  reply	other threads:[~2018-08-29 18:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 14:02 Questions about the hash function transition Ævar Arnfjörð Bjarmason
2018-08-23 14:27 ` Junio C Hamano
2018-08-23 15:20   ` Ævar Arnfjörð Bjarmason
2018-08-23 16:13     ` Junio C Hamano
2018-08-24  1:40 ` brian m. carlson
2018-08-24  1:54   ` Jonathan Nieder
2018-08-24  4:47     ` brian m. carlson
2018-08-24  4:52       ` Jonathan Nieder
2018-08-24  1:47 ` Jonathan Nieder
2018-08-28 12:04   ` Johannes Schindelin
2018-08-28 12:49     ` Derrick Stolee
2018-08-28 17:12       ` Jonathan Nieder
2018-08-28 17:11     ` Jonathan Nieder
2018-08-29 13:09       ` Johannes Schindelin
2018-08-29 13:27         ` Derrick Stolee
2018-08-29 14:43           ` Derrick Stolee
2018-08-29  9:13   ` How is the ^{sha256} peel syntax supposed to work? Ævar Arnfjörð Bjarmason
2018-08-29 17:51     ` Stefan Beller
2018-08-29 17:59       ` Jonathan Nieder
2018-08-29 18:34         ` Stefan Beller [this message]
2018-08-29 18:41         ` Ævar Arnfjörð Bjarmason
2018-08-29 19:12           ` Jonathan Nieder
2018-08-29 19:37             ` Ævar Arnfjörð Bjarmason
2018-08-29 20:46               ` Jonathan Nieder
2018-08-29 23:45                 ` Jeff King
2018-08-29 20:53             ` Junio C Hamano
2018-08-29 21:01               ` Jonathan Nieder
2018-08-29 17:56     ` Jonathan Nieder
2018-08-24  2:51 ` Questions about the hash function transition Jonathan Nieder
2018-08-28 13:50 ` Ævar Arnfjörð Bjarmason
2018-08-28 14:15   ` Edward Thomson
2018-08-28 15:02     ` Ævar Arnfjörð Bjarmason
2018-08-28 15:45     ` Junio C Hamano

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=CAGZ79kZsAFNE0GgUHociSDejwB+HsPVscZ4jcq__sFew7g85Bw@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=bmwill@google.com \
    --cc=demerphq@gmail.com \
    --cc=ethomson@edwardthomson.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=stolee@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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).