{"thread":{"id":"12009","subject":"fetching a single commit from remote repo","startedAt":"2008-02-10T15:00:08Z","lastAt":"2008-02-15T23:07:26Z","messageCount":5,"participants":["Nikita V. Youshchenko","Johannes Schindelin","Jakub Narebski","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"68225","messageId":"1530970.y9vPlhFxz8@yoush.homelinux.org","threadId":"12009","inReplyTo":null,"subject":"fetching a single commit from remote repo","fromName":"Nikita V. Youshchenko","fromEmail":"yoush@debian.org","sentAt":"2008-02-10T15:00:08Z","receivedAt":"2008-02-10T15:00:08Z","isPatch":false,"sender":{"key":"yoush@debian.org","avatar":null},"body":"Hello.\n\nI'm looking for a way to fetch a single snapshot, without history, from\nremote git repository.\n\nI've found how to do it with a head (clone --depth 1, or fetch --depth 1).\n\nIs it possible to do the same with non-head and non-tagged commit, if only\nsha1 name of the commit is known?\nLooks like fetch and fetch-pack only take ref names :(\n"},{"id":"68228","messageId":"alpine.LSU.1.00.0802101644540.11591@racer.site","threadId":"12009","inReplyTo":"1530970.y9vPlhFxz8@yoush.homelinux.org","subject":"Re: fetching a single commit from remote repo","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-10T16:45:57Z","receivedAt":"2008-02-10T16:45:57Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 10 Feb 2008, Nikita V. Youshchenko wrote:\n\n> I'm looking for a way to fetch a single snapshot, without history, from\n> remote git repository.\n> \n> I've found how to do it with a head (clone --depth 1, or fetch --depth 1).\n> \n> Is it possible to do the same with non-head and non-tagged commit, if only\n> sha1 name of the commit is known?\n> Looks like fetch and fetch-pack only take ref names :(\n\nYes, for security reasons.  If you pushed some code you were not allowed \nto push, you have to have a way to undo the error by force-rewinding.\n\nCiao,\nDscho\n"},{"id":"68231","messageId":"m3sl00g3lc.fsf@localhost.localdomain","threadId":"12009","inReplyTo":"1530970.y9vPlhFxz8@yoush.homelinux.org","subject":"Re: fetching a single commit from remote repo","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-02-10T16:48:26Z","receivedAt":"2008-02-10T16:48:26Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Nikita V. Youshchenko\" <yoush@debian.org> writes:\n\n> I'm looking for a way to fetch a single snapshot, without history, from\n> remote git repository.\n> \n> I've found how to do it with a head (clone --depth 1, or fetch --depth 1).\n\nYou can also try \"git archive --remote=<repo>\" if it is enabled,\nor if project has gitweb, then use 'snapshot' feature (if enabled).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"68239","messageId":"200802102017.03879@blacky.localdomain","threadId":"12009","inReplyTo":"alpine.LSU.1.00.0802101644540.11591@racer.site","subject":"Re: fetching a single commit from remote repo","fromName":"Nikita V. Youshchenko","fromEmail":"yoush@debian.org","sentAt":"2008-02-10T17:17:03Z","receivedAt":"2008-02-10T17:17:03Z","isPatch":false,"sender":{"key":"yoush@debian.org","avatar":null},"body":"> Hi,\n>\n> On Sun, 10 Feb 2008, Nikita V. Youshchenko wrote:\n> > I'm looking for a way to fetch a single snapshot, without history,\n> > from remote git repository.\n> >\n> > I've found how to do it with a head (clone --depth 1, or fetch --depth\n> > 1).\n> >\n> > Is it possible to do the same with non-head and non-tagged commit, if\n> > only sha1 name of the commit is known?\n> > Looks like fetch and fetch-pack only take ref names :(\n>\n> Yes, for security reasons.\n\nI can't understand what security issues this may cause ...\n\nIf one has enough access to a repository to clone it, he already has a way \nto download each and every object from there.\n\nAbility to fetch the tree corresponding to particular commit won't add any \nnew permissions to him, will it?\n\nI'm looking for a way to get a copy of a particular previous state of the \nproject tree, without having to download entire tree. Something similar \nchecking out particular svn revision.\nThis is going to be wrapped into a script, which is intended to be executed \nby people without any knowledge of any VC system at all. Commit id could \nbe a parameter for such a script.\n\nNikita\n"},{"id":"68851","messageId":"20080215230726.GB13178@efreet.light.src","threadId":"12009","inReplyTo":"200802102017.03879@blacky.localdomain","subject":"Re: fetching a single commit from remote repo","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2008-02-15T23:07:26Z","receivedAt":"2008-02-15T23:07:26Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Sun, Feb 10, 2008 at 20:17:03 +0300, Nikita V. Youshchenko wrote:\n> > Hi,\n> >\n> > On Sun, 10 Feb 2008, Nikita V. Youshchenko wrote:\n> > > I'm looking for a way to fetch a single snapshot, without history,\n> > > from remote git repository.\n> > >\n> > > I've found how to do it with a head (clone --depth 1, or fetch --depth\n> > > 1).\n> > >\n> > > Is it possible to do the same with non-head and non-tagged commit, if\n> > > only sha1 name of the commit is known?\n> > > Looks like fetch and fetch-pack only take ref names :(\n> >\n> > Yes, for security reasons.\n> \n> I can't understand what security issues this may cause ...\n> \n> If one has enough access to a repository to clone it, he already has a way \n> to download each and every object from there.\n\nNo, that's not true. That is, it is only true for dumb (http, ftp) protocols.\nThe native git protocol (ssh is used as wrapper for that protocol anyway)\nwill only give you the objects that are accessible from the references listed\nand no others.\n\n> Ability to fetch the tree corresponding to particular commit won't add any \n> new permissions to him, will it?\n\nIt, indeed, may. Though, the git upload-pack could instead limit to only\nproviding objects, that can be reached from a ref -- than it would not add\nany permissions.\n\n> I'm looking for a way to get a copy of a particular previous state of the \n> project tree, without having to download entire tree. Something similar \n> checking out particular svn revision.\n> This is going to be wrapped into a script, which is intended to be executed \n> by people without any knowledge of any VC system at all. Commit id could \n> be a parameter for such a script.\n\nWould a cgi calling git-archive on the server do instead? It even seems to be\nalready part of gitweb -- the snapshot link for a commit should give you\na .tar.gz of that tree. If the people don't know anything about VC, they\nprobably won't need the metadata anyway.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}