{"thread":{"id":"4314","subject":"Remote git-cat-file?","startedAt":"2006-05-27T22:26:15Z","lastAt":"2006-05-28T18:34:43Z","messageCount":7,"participants":["Elrond","Linus Torvalds","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"20814","messageId":"loom.20060528T002420-957@post.gmane.org","threadId":"4314","inReplyTo":null,"subject":"Remote git-cat-file?","fromName":"Elrond","fromEmail":"elrond+kernel.org@samba-tng.org","sentAt":"2006-05-27T22:26:15Z","receivedAt":"2006-05-27T22:26:15Z","isPatch":false,"sender":{"key":"elrond+kernel.org@samba-tng.org","avatar":null},"body":"Hi,\n\nIs it possible via the git: protocol to do a git-cat-file?\n\nTo download just one object by its ID?\n\nThanks for your help.\n\n\n    Elrond\n"},{"id":"20815","messageId":"Pine.LNX.4.64.0605271727110.5623@g5.osdl.org","threadId":"4314","inReplyTo":"loom.20060528T002420-957@post.gmane.org","subject":"Re: Remote git-cat-file?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-28T00:29:26Z","receivedAt":"2006-05-28T00:29:26Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 27 May 2006, Elrond wrote:\n> \n> Is it possible via the git: protocol to do a git-cat-file?\n> \n> To download just one object by its ID?\n\nNope. \n\nWell, depending on just how much you know about the object, you can fake \nit. For example, if you already know it's a commit, and you know the \nparents, then yes, you can download it by basically saying that you want \nthat particular object and you already have the parents.\n\nBut in the general case, the answer is no. Set up a gitweb thing, and look \nup the objects that way. Or just pull the repo, and look at it locally.\n\nJust out of interest, why would you ever want to just look at a single \nobject?\n\n\t\tLinus\n"},{"id":"20816","messageId":"Pine.LNX.4.64.0605271729440.5623@g5.osdl.org","threadId":"4314","inReplyTo":"Pine.LNX.4.64.0605271727110.5623@g5.osdl.org","subject":"Re: Remote git-cat-file?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-28T00:32:00Z","receivedAt":"2006-05-28T00:32:00Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 27 May 2006, Linus Torvalds wrote:\n> \n> Well, depending on just how much you know about the object, you can fake \n> it. For example, if you already know it's a commit, and you know the \n> parents, then yes, you can download it by basically saying that you want \n> that particular object and you already have the parents.\n\nThe other (similar) case is for tag objects. When you do \"git ls-remote\" \non the remote repo, it will tell you both the tag object SHA and the \nobject SHA of the thing it points to, so you can then do a git protocol \nexchange where you do a \n\n\tfor_each_tag\n\t\t\"want <tagsha1>\"\n\n\tfor_each_tag\n\t\t\"have <objectitpointstosha1>\"\n\nand you'll get just the tag object back.\n\n\t\tLinus\n"},{"id":"20821","messageId":"loom.20060528T124835-757@post.gmane.org","threadId":"4314","inReplyTo":"Pine.LNX.4.64.0605271727110.5623@g5.osdl.org","subject":"Re: Remote git-cat-file?","fromName":"Elrond","fromEmail":"elrond+kernel.org@samba-tng.org","sentAt":"2006-05-28T10:57:43Z","receivedAt":"2006-05-28T10:57:43Z","isPatch":false,"sender":{"key":"elrond+kernel.org@samba-tng.org","avatar":null},"body":"Linus Torvalds <torvalds <at> osdl.org> writes:\n[...]\n> But in the general case, the answer is no. Set up a gitweb thing, and look \n> up the objects that way. Or just pull the repo, and look at it locally.\n\nI ended up doing that (clone whole remote repo).\n\n\n> Just out of interest, why would you ever want to just look at a single \n> object?\n\nWell...\nI screwed up my local clone of a repo. git-fsck told me what objects I needed.\nSo I finally ended up downloading the whole repo again to extract 16 objects. ;)\n\n\nThe other possible use for remote git-cat-file:\nIt might be useful in shallow repos to selectively load objects \"on demand\".\n(In fact, I screwed my repo by trying to make it shallow.)\n\n\n    Elrond\n"},{"id":"20822","messageId":"e5c3c5$i47$1@sea.gmane.org","threadId":"4314","inReplyTo":"loom.20060528T124835-757@post.gmane.org","subject":"Re: Remote git-cat-file?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-28T12:00:21Z","receivedAt":"2006-05-28T12:00:21Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Elrond wrote:\n\n> Linus Torvalds <torvalds <at> osdl.org> writes:\n>> \n>> Just out of interest, why would you ever want to just look at a single \n>> object?\n[...]\n>\n> The other possible use for remote git-cat-file:\n> It might be useful in shallow repos to selectively load objects \"on demand\".\n> (In fact, I screwed my repo by trying to make it shallow.)\n\nIt would be nice I think to be able to have remote alternatives, loading\n(downloading and saving) objects \"on demand\" (\"lazy alternatives\"). Not necessary\nonly with \"shallow repo\"/\"shallow clone\".\n\n-- \nJakub Narebski\nWarsaw, Poland\n"},{"id":"20825","messageId":"7vu07acanv.fsf@assigned-by-dhcp.cox.net","threadId":"4314","inReplyTo":"e5c3c5$i47$1@sea.gmane.org","subject":"Re: Remote git-cat-file?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-28T17:38:12Z","receivedAt":"2006-05-28T17:38:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> It would be nice I think to be able to have remote alternatives,...\n\nYup, I think I've mentioned that one as one of \"the mostly\nunimplementable but would be very nice to have crazy wishlist\nitems\" some time ago.  What people would want is not a \"shallow\"\nclone, but a \"lazy\" clone, and in the ideal world that would\nobviously be a nice thing to have.\n"},{"id":"20829","messageId":"e5cqg5$om2$1@sea.gmane.org","threadId":"4314","inReplyTo":"7vu07acanv.fsf@assigned-by-dhcp.cox.net","subject":"Re: Remote git-cat-file?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-28T18:34:43Z","receivedAt":"2006-05-28T18:34:43Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n>> It would be nice I think to be able to have remote alternatives,...\n> \n> Yup, I think I've mentioned that one as one of \"the mostly\n> unimplementable but would be very nice to have crazy wishlist\n> items\" some time ago.  What people would want is not a \"shallow\"\n> clone, but a \"lazy\" clone, and in the ideal world that would\n> obviously be a nice thing to have.\n\nI think that it should be only \"commit-lazy\", i.e. downloading whole trees,\nsubtrees, and objects pointed by tags, only not following the parent links\nof commits; perhaps also other links to commits (branches, tags, tag\nobjects).\n\n-- \nJakub Narebski\nWarsaw, Poland\n"}]}