On Thu, Oct 15, 2020 at 09:39:01PM -0700, 'skobo002 University of Minnesota' via Git for human beings wrote:
> I'm looking to see if there's a feature in any version of git to be able to > ask the server to list all blob ids for a particular commit. So far, from > what I've seen it doesn't look like this is possible. I know git has `git > ls-remote` which can list the commits IDs of remote references like HEAD, > or tags, or branches. But what I'd like to do is: > > - list all remote commit ids > - list all blobs/trees that a commit points to > > My questions are: > 1. is this possible currently? if so, how? I doubt it is possible: the "wire protocol" for Git was designed to facilitate (minimal) transfer of _history_ data between the two repositories (in both directions), and since they key concept when operating on histories is commit - remember that a commit's name (its "hash") is cryptographically derived from its contents which includes the hashes of the tree object it references, and blobs and tree object that object references - and so on, all the way down to the "leaf" blobs), - the protocol is about one side of the transfer telling "I have this history and want that history" and another side calculating what's required to send to fill the gaps in the asker's repository. Still, the only definitive answer can be obtained from the docs on the protocol; you might want start with the files in [1], and protocol-v2.txt in particular. > 2. if not, is this something that would be desirable to be implemented in > git? I have no idea but to me the facility, as specified, does not appear to be too useful: suppose you have a way in a protocol to ask what blobs a specific tree objects has - what use is this for? I mean, the facility is too narrow to consider it as a way to query a remote repository for generic information - basically to do _that_ it would have sense to implement complete FTP-like protocol for "listing" the remote repository through all "dimensions" of the data it contains. But then again, suppose you have such facility (it looks like a protocol actually orthoronal to what Git currently has but let's not digress), what real-world problem would it solve? An ability to download a particular SHA-1 named blob? But what use that would be? Aren't you using Git in a way it wasn't supposed to be used? ;-) Git is indeed a content-addressable filesystem in its core, but it wasn't concieved as a remotely-accessible content-addressable filesystem, and if you want one may be just look for a ready-made implementation of it? > If it's a desirable feature, I would be happy to work on it, but I want to > get a thumbs up first. That's not the right place to ask for a thumbs-up: you've posted to a list intended to help mere mortals with their day-to-day Git usage ;-) The development of Git happens elsewhere, please refer to [2]. 1. https://github.com/git/git/blob/master/Documentation/technical/ 2. https://gist.github.com/tfnico/4441562#writing-an-email-to-the-developers-list -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/20201025122538.vekdte2rwhvz46uk%40carbon.