From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org
Subject: Re: Submodules and SHA-256/SHA-1 interoperability
Date: Fri, 19 Mar 2021 15:23:09 +0100 (CET) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.2103191521290.57@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <YE0Vki0HNOYhYIYh@camp.crustytoothpaste.net>
Hi brian,
On Sat, 13 Mar 2021, brian m. carlson wrote:
> On 2021-03-01 at 19:28:13, Johannes Schindelin wrote:
> > While my strong urge is to add "Remove support for submodules" (which BTW
> > would also plug so many attack vectors that have lead to many a
> > vulnerability in the past), I understand that this would be impractical:
> > the figurative barn door has been open for way too long to do that.
> >
> > But I'd like to put another idea into the fray: store the mapping in
> > `.gitmodules`. That is, each time `git submodule add <...>` is called, it
> > would update `.gitmodules` to list SHA-1 *and* SHA-256 for the given path.
> >
> > That would relieve us of the problem where we rely on a server's ability
> > to give us that mapping.
>
> This is true, but it ends up causing problems because we don't know
> where the .gitmodules file is for a given revision. If we're indexing a
> pack file, we lack the ability to know which .gitmodules file is
> associated with the blobs in a given revision, and we can't finish
> indexing that file until we have both hashes for every object.
>
> While we could change the way we do indexing, we'd end up having to
> crawl the history and that would be very slow.
Hrm, that's a valid point.
I just wish that we could make this more independent of servers. There
_might_ be a way to work around the flaw you pointed out, e.g. adding the
mappings from `.gitmodules` to the repository-local SHA-1 <-> SHA-256
mapping. But maybe somebody else can think of a better way?
Ciao,
Dscho
prev parent reply other threads:[~2021-03-19 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-14 21:50 Submodules and SHA-256/SHA-1 interoperability brian m. carlson
2021-03-01 19:28 ` Johannes Schindelin
2021-03-13 19:42 ` brian m. carlson
2021-03-19 14:23 ` Johannes Schindelin [this message]
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=nycvar.QRO.7.76.6.2103191521290.57@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.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).