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

Re: Verifiable git archives?

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jan 19, 2014, 00:35 UTC
Message-ID
<52DB1DB4.7080806@alum.mit.edu>
In-Reply-To
<xmqqsiswapav.fsf@gitster.dls.corp.google.com>
On 01/09/2014 09:11 PM, Junio C Hamano wrote:
Show 19 quoted lines
> Andy Lutomirski <luto@amacapital.net> writes:
> 
>> It's possible, in principle, to shove enough metadata into the output
>> of 'git archive' to allow anyone to verify (without cloning the repo)
>> to verify that the archive is a correct copy of a given commit.  Would
>> this be considered a useful feature?
>>
>> Presumably there would be a 'git untar' command that would report
>> failure if it fails to verify the archive contents.
>>
>> This could be as simple as including copies of the commit object and
>> all relevant tree objects and checking all of the hashes when
>> untarring.
> 
> You only need the object name of the top-level tree.  After "untar"
> the archive into an empty directory, make it a new repository and
> "git add . && git write-tree"---the result should match the
> top-level tree the archive was supposed to contain.
> [...]

This wouldn't work if any files were excluded from the archive using gitattribute "export-ignore" (or "export-subst", which you already mentioned in a follow-up email).

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Andy LutomirskiNext: Junio C Hamano
Message 7 of 9 in “Verifiable git archives?”
  1. Andy LutomirskiJan 9, 2014
  2. Stefan BellerJan 9, 2014
  3. Junio C HamanoJan 9, 2014
  4. Andy LutomirskiJan 9, 2014
  5. Junio C HamanoJan 9, 2014
  6. Andy LutomirskiJan 9, 2014
  7. Michael HaggertyJan 19, 2014
  8. Junio C HamanoJan 21, 2014
  9. Andy LutomirskiJan 25, 2014

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.