git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How is the ^{sha256} peel syntax supposed to work?

From
Stefan Beller <sbeller@google.com>
Date
Aug 29, 2018, 17:51 UTC
Message-ID
<CAGZ79kaGb_TL7SiR4CFGFzrfy2Lotioy76o6sUK4=vZK5qwqNA@mail.gmail.com>
In-Reply-To
<877ek9edsa.fsf@evledraar.gmail.com>

On Wed, Aug 29, 2018 at 2:13 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 35 quoted lines
>
>
> On Fri, Aug 24 2018, Jonathan Nieder wrote:
>
> > Hi,
> >
> > Ævar Arnfjörð Bjarmason wrote:
> >
> >>> git --output-format=sha1 log abac87a^{sha1}..f787cac^{sha256}
> >>
> >> How is this going to interact with other peel syntax? I.e. now we have
> >> <object>^{commit} <sha>^{tag} etc. It seems to me we'll need not ^{sha1}
> >> but ^{sha1:<current_type>}, e.g. ^{sha1:commit} or ^{sha1:tag}, with
> >> current ^{} being a synonym for ^{sha1:}.
> >>
> >> Or is this expected to be chained, as e.g. <object>^{tag}^{sha256} ?
> >
> > Great question.  The latter (well, <hexdigits>^{sha256}^{tag}, not the
> > other way around).
>
> Since nobody's chimed in with an answer, and I suspect many have an
> adversion to that big thread I thought I'd spin out just this small
> question into its own thread.
>
> brian m. carlson did some prep work for this in his just-submitted
> https://public-inbox.org/git/20180829005857.980820-2-sandals@crustytoothpaste.net/
>
> I was going to work on some of the peel code soon (digging up the type
> disambiguation patches I still need to re-submit), so could do this
> while I'm at it, i.e. implement ^{sha1}.
>
> But as noted above it's not clear how it should work. Jonathan's
> chaining suggestion (<hexdigits>^{sha256}^{tag} not
> <hexdigits>^{tag}^{sha256}) makes more sense than mine, but is that what
> we're going for, or ^{sha256:tag}?

The choice of hash seems position independent to me, so as a user I would expect both to work at first. Though when looking at more syntax of these expressions, e.g. b9dfa238d5c34~1^2^^, it is read left to right, i.e. you arrive at the destination by evaluating the next part of the expression and then jumping around based on each expression. And with that model, <hexdigits>^{sha256}^{tree} could mean to obtain the sha256 value of <hexvalue> and then derive the tree from that object, so it is unclear if the tree object would also come in sha256 or if we could just return the tree in sha1 notation (as it would be correctly - though confusingly - described that way. The sha256 conversion happened at an intermediate step.)

So with that said, I would expect the hash specifier at the end of the chain.

Would the position of the hash specifier make any difference for verifying signed tags/commits ? (subtle asking to verify the sha1 signature or the sha256 signature explicitly vs asking to verify an object that is given with <hexval> in sha1 or in sha256)

Thanks, Stefan

Previous: Ævar Arnfjörð BjarmasonNext: Jonathan Nieder
Message 18 of 33 in “Questions about the hash function transition”
  1. Ævar Arnfjörð BjarmasonAug 23, 2018
  2. Junio C HamanoAug 23, 2018
  3. Ævar Arnfjörð BjarmasonAug 23, 2018
  4. Junio C HamanoAug 23, 2018
  5. brian m. carlsonAug 24, 2018
  6. Jonathan NiederAug 24, 2018
  7. brian m. carlsonAug 24, 2018
  8. Jonathan NiederAug 24, 2018
  9. Jonathan NiederAug 24, 2018
  10. Johannes SchindelinAug 28, 2018
  11. Derrick StoleeAug 28, 2018
  12. Jonathan NiederAug 28, 2018
  13. Jonathan NiederAug 28, 2018
  14. Johannes SchindelinAug 29, 2018
  15. Derrick StoleeAug 29, 2018
  16. Derrick StoleeAug 29, 2018
  17. How is the ^{sha256} peel syntax supposed to work?Ævar Arnfjörð Bjarmason, Aug 29, 2018
  18. Stefan BellerAug 29, 2018
  19. Jonathan NiederAug 29, 2018
  20. Stefan BellerAug 29, 2018
  21. Ævar Arnfjörð BjarmasonAug 29, 2018
  22. Jonathan NiederAug 29, 2018
  23. Ævar Arnfjörð BjarmasonAug 29, 2018
  24. Jonathan NiederAug 29, 2018
  25. Jeff KingAug 29, 2018
  26. Junio C HamanoAug 29, 2018
  27. Jonathan NiederAug 29, 2018
  28. Jonathan NiederAug 29, 2018
  29. Jonathan NiederAug 24, 2018
  30. Ævar Arnfjörð BjarmasonAug 28, 2018
  31. Edward ThomsonAug 28, 2018
  32. Ævar Arnfjörð BjarmasonAug 28, 2018
  33. Junio C HamanoAug 28, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.