git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sam Vilain <sam@vilain.net>
Cc: Joey Hess <id@joeyh.name>, GIT Mailing List <git@vger.kernel.org>
Subject: Re: weaning distributions off tarballs: extended verification of git tags
Date: Mon, 02 Mar 2015 12:08:39 -0800	[thread overview]
Message-ID: <xmqqwq2z9n7c.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54F4BC18.5060702@vilain.net> (Sam Vilain's message of "Mon, 02 Mar 2015 11:38:00 -0800")

Sam Vilain <sam@vilain.net> writes:

>> As to the implementation, checksumming the collection of raw objects is
>> certainly superior to tar. Colin had suggested sorting the objects by
>> checksum, but I don't think that is necessary. Just stream the commit
>> object, then its tree object, followed by the content of each object
>> listed in the tree, recursing into subtrees as necessary. That will be a
>> stable stream for a given commit, or tree.
>
> I would really just do it exactly the same way that git does: checksum
> the objects including their headers with the new hashes.

I tend to agree that it is a good idea.  I also suspect that would
make the implementation simpler by allowing it to share more code,
but I didn't look into it too deeply.

> I have a
> hazy recollection of what it would take to replace SHA-1 in git with
> something else; it should be possible (though tricky) to do it lazily,
> where a tree entry has bits (eg, some of the currently unused file
> mode bits) to denotes which hash algorithm is in use for the entry.
> However I don't think that got past idea stage...

I think one reason why it didn't was because it would not work well.
That "bit that tells this is a new object or old" would mean that a
single tree can have many different object names, depending on which
of its component entries are using that bit and which aren't.  There
goes the "we know two trees with the same object name are identical
without recursing into them" optimization out the window.

Also it would make it impossible to do what you suggest to Joey to
do, i.e. "exactly the same way that git does", once you start saying
that a tree object can be encoded in more than one different ways,
wouldn't it?

  reply	other threads:[~2015-03-02 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 14:48 weaning distributions off tarballs: extended verification of git tags Colin Walters
2015-02-28 19:14 ` brian m. carlson
2015-02-28 20:34 ` Morten Welinder
2015-03-02 17:09   ` Colin Walters
2015-03-02 18:12     ` Joey Hess
2015-03-02 19:38       ` Sam Vilain
2015-03-02 20:08         ` Junio C Hamano [this message]
2015-03-02 20:52           ` Sam Vilain
2015-03-02 23:20       ` Duy Nguyen
2015-03-02 23:44         ` Junio C Hamano
2015-03-03  0:42           ` Duy Nguyen
2015-03-05 12:36           ` Michael Haggerty
2015-07-08  4:00 ` Colin Walters

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqwq2z9n7c.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=id@joeyh.name \
    --cc=sam@vilain.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).