{"thread":{"id":"9066","subject":"Another question about importing SVN with fast-import","startedAt":"2007-07-16T21:11:25Z","lastAt":"2007-08-07T01:08:50Z","messageCount":11,"participants":["Julian Phillips","Shawn O. Pearce","David Frech","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47594","messageId":"Pine.LNX.4.64.0707162204480.14971@reaper.quantumfyre.co.uk","threadId":"9066","inReplyTo":null,"subject":"Another question about importing SVN with fast-import","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-16T21:11:25Z","receivedAt":"2007-07-16T21:11:25Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"First off, I would just like to say fast-import rocks.  It's well named \ntoo ...\n\nNow the question.  Shawn recently added C and R operations - almost as \nsoon as they were asked for too.  However, how do you copy a file from a \nparticular revision?  I have just hit a point where someone deleted a \ndirectory, and then copied one of the files from that directory back from \nan old revision (as two separate commits).  Since I'm not tracking any \nbranch contents in my front-end, and the copy operation only works from \nthe current branch head I seem to be stuck ... or have I missed something?\n\n-- \nJulian\n\n  ---\nWhat I want to find out is -- do parrots know much about Astro-Turf?\n"},{"id":"47609","messageId":"20070717033840.GK32566@spearce.org","threadId":"9066","inReplyTo":"Pine.LNX.4.64.0707162204480.14971@reaper.quantumfyre.co.uk","subject":"Re: Another question about importing SVN with fast-import","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-07-17T03:38:40Z","receivedAt":"2007-07-17T03:38:40Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> First off, I would just like to say fast-import rocks.  It's well named \n> too ...\n\nI'm glad you like it.  ;-)\n \n> Now the question.  Shawn recently added C and R operations - almost as \n> soon as they were asked for too.\n\nSometimes I'm responsive...\n\n> However, how do you copy a file from a \n> particular revision?\n\nand sometimes not so much.  You can't do that right now.  I've wanted\nto open up the data subcommand to allow another form that lets you\nspecify data from a branch and file path (thus selecting a blob\nfrom another revision) but I haven't gotten around to it.  I also\ndon't have time to do it during the earlier part of this week.\nMaybe I'll get to it later near the end of the week.\n\nIt shouldn't be too difficult now with the tree_content_get()\nfunction that I recently defined for the C/R commands.  The SHA-1\ncomes back in the tree_entry leaf, but that codepath is only valid\nfor the tip of a branch that fast-import knows about in memory.\nIf it doesn't then you probably need to fallback into raw tree\nparsing.  Ugh.\n\nThe way prior frontends have handled this is they assigned marks\nto every blob, and then had a translation table within the frontend\nof revision->mark, so that anytime it needed a given revision of a\nfile it knew what mark to send to fast-import.  This does require\nthat the frontend maintain basically everything...\n\n> I have just hit a point where someone deleted a \n> directory, and then copied one of the files from that directory back from \n> an old revision (as two separate commits).  Since I'm not tracking any \n> branch contents in my front-end, and the copy operation only works from \n> the current branch head I seem to be stuck ... or have I missed something?\n\nYea, I got nothing.  I can't think of any method to make that work\naside from using marks.  Or teaching fast-import how to do tree\nlookup, like I described above.\n\n-- \nShawn.\n"},{"id":"47818","messageId":"7154c5c60707190009r6d460debs71158d4db9a028d4@mail.gmail.com","threadId":"9066","inReplyTo":"Pine.LNX.4.64.0707162204480.14971@reaper.quantumfyre.co.uk","subject":"Re: Another question about importing SVN with fast-import","fromName":"David Frech","fromEmail":"david@nimblemachines.com","sentAt":"2007-07-19T07:09:41Z","receivedAt":"2007-07-19T07:09:41Z","isPatch":false,"sender":{"key":"david@nimblemachines.com","avatar":null},"body":"On 7/16/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> Now the question.  Shawn recently added C and R operations - almost as\n> soon as they were asked for too.  However, how do you copy a file from a\n> particular revision?  I have just hit a point where someone deleted a\n> directory, and then copied one of the files from that directory back from\n> an old revision (as two separate commits).  Since I'm not tracking any\n> branch contents in my front-end, and the copy operation only works from\n> the current branch head I seem to be stuck ... or have I missed something?\n\nI have to second Julian's question.\n\nThe only things I have left to implement (in my svn dump to\nfast-import translator) before I can call my code \"complete\"  are\nbranch copies (which will generate \"from\" lines in commits so\nfast-import can properly initialize the new branch) and a generic\n\"copy <path> from <rev>\" that Julian also needs.\n\nI mark my commits and keep track of the mapping from svn revs to git\ncommits, so when the svn dump asks for a <path> from a specific <svn\nrev> I can correlate that to a mark (ie, a git commit). But I can't\ntell fast-import to *do* anything with it.\n\nThis is kind of a request and a comment/question. The request is:\nthere is no way to do *reasonably* in the front end what fast-import\ncan do somewhat reasonably: namely, copy a <path> (file or directory!)\nfrom an arbitrary previously committed revision/mark to the current\nbranch.\n\nThe comment/question is: how different is this, really, from being\nable to  specify a \"from\" line in a commit? In both cases I'm asking\nfast-import to reach into its memory (or the repo) and pull out a\ntree, and to add (some or all of it) to my current branch. Isn't the\nkind of generic C command that Julian and I are asking for the same\nthing, only instead of taking the whole tree (from the specified\ncommit) it takes a single file or directory?\n\nI hope I haven't missed the point entirely.\n\nLastly, do we really need \"R\"? With this generic copy - and I think\nthere should be *only* a generic version, not a \"streamlined local\ncopy\" version and a \"reach into history arbitrarily\" version - we can,\nas an earlier poster pointed out, do R by doing a C and then a D. This\nis, in fact, how svn dump files represent file and directory renames.\n\nIt would be nice to keep the fast-import command set small and orthogonal.\n\nMy few cents.\n\nCheers,\n\n- David\n\n-- \nIf I have not seen farther, it is because I have stood in the\nfootsteps of giants.\n"},{"id":"47926","messageId":"20070720051142.GO32566@spearce.org","threadId":"9066","inReplyTo":"7154c5c60707190009r6d460debs71158d4db9a028d4@mail.gmail.com","subject":"Re: Another question about importing SVN with fast-import","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-07-20T05:11:42Z","receivedAt":"2007-07-20T05:11:42Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"David Frech <david@nimblemachines.com> wrote:\n> On 7/16/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> >Now the question.  Shawn recently added C and R operations - almost as\n> >soon as they were asked for too.  However, how do you copy a file from a\n> >particular revision?\n> \n> I have to second Julian's question.\n\nI'm getting to it.  Maybe this weekend.  Right now I have git-gui\nwork to finish, and that work is more important to me this week than\nfast-import is.  Not that fast-import isn't important to me either,\nits just the way things are this week.\n \n> This is kind of a request and a comment/question. The request is:\n> there is no way to do *reasonably* in the front end what fast-import\n> can do somewhat reasonably: namely, copy a <path> (file or directory!)\n> from an arbitrary previously committed revision/mark to the current\n> branch.\n\nI agree.\n \n> The comment/question is: how different is this, really, from being\n> able to  specify a \"from\" line in a commit? In both cases I'm asking\n> fast-import to reach into its memory (or the repo) and pull out a\n> tree, and to add (some or all of it) to my current branch. Isn't the\n> kind of generic C command that Julian and I are asking for the same\n> thing, only instead of taking the whole tree (from the specified\n> commit) it takes a single file or directory?\n\nIt is possible.  I'm just not sure what the syntax for it should be.\nSuggestions?  I really want to stay backwards compatible with the\ncurrent \"C\" command, so:\n\n\t'C' SP commit SP path SP path\n\nis out because its ambiguous with the current meaning where the\nsecond (destination) path can contain SP without being quoted by\nthe frontend.\n\n> Lastly, do we really need \"R\"? With this generic copy - and I think\n> there should be *only* a generic version, not a \"streamlined local\n> copy\" version and a \"reach into history arbitrarily\" version - we can,\n> as an earlier poster pointed out, do R by doing a C and then a D. This\n> is, in fact, how svn dump files represent file and directory renames.\n\nThe code for \"R\" is so short that I just don't see a need to remove it.\nIts also already out in the wild, as it has been in Junio's master for\na little while now.\n \n-- \nShawn.\n"},{"id":"47928","messageId":"Pine.LNX.4.64.0707200646400.18125@beast.quantumfyre.co.uk","threadId":"9066","inReplyTo":"20070720051142.GO32566@spearce.org","subject":"Re: Another question about importing SVN with fast-import","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-20T05:50:31Z","receivedAt":"2007-07-20T05:50:31Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Fri, 20 Jul 2007, Shawn O. Pearce wrote:\n\n> David Frech <david@nimblemachines.com> wrote:\n>> On 7/16/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n>>> Now the question.  Shawn recently added C and R operations - almost as\n>>> soon as they were asked for too.  However, how do you copy a file from a\n>>> particular revision?\n>>\n>> I have to second Julian's question.\n>\n> I'm getting to it.  Maybe this weekend.  Right now I have git-gui\n> work to finish, and that work is more important to me this week than\n> fast-import is.  Not that fast-import isn't important to me either,\n> its just the way things are this week.\n\nNo complaints from me - git-gui is one of the reasons I want to be able to \nuse fast-import ;)\n\n>> The comment/question is: how different is this, really, from being\n>> able to  specify a \"from\" line in a commit? In both cases I'm asking\n>> fast-import to reach into its memory (or the repo) and pull out a\n>> tree, and to add (some or all of it) to my current branch. Isn't the\n>> kind of generic C command that Julian and I are asking for the same\n>> thing, only instead of taking the whole tree (from the specified\n>> commit) it takes a single file or directory?\n>\n> It is possible.  I'm just not sure what the syntax for it should be.\n> Suggestions?  I really want to stay backwards compatible with the\n> current \"C\" command, so:\n>\n> \t'C' SP commit SP path SP path\n>\n> is out because its ambiguous with the current meaning where the\n> second (destination) path can contain SP without being quoted by\n> the frontend.\n\nYou could always make it part of the 'M' command?\n\n'M' sp mode sp 'copy' sp path_str lf (ref_str | hexsha1 | sha1exp_str | \nidnum) SP path_str;\n\nOr just make it a new command, O (for other) or E (for existing) maybe? :S\n\n-- \nJulian\n\n  ---\nIt is easier to change the specification to fit the program than vice versa.\n"},{"id":"47933","messageId":"7154c5c60707192354k7db677a6m4f8cbd474747ca92@mail.gmail.com","threadId":"9066","inReplyTo":"Pine.LNX.4.64.0707200646400.18125@beast.quantumfyre.co.uk","subject":"Re: Another question about importing SVN with fast-import","fromName":"David Frech","fromEmail":"david@nimblemachines.com","sentAt":"2007-07-20T06:54:30Z","receivedAt":"2007-07-20T06:54:30Z","isPatch":false,"sender":{"key":"david@nimblemachines.com","avatar":null},"body":"On 7/19/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> On Fri, 20 Jul 2007, Shawn O. Pearce wrote:\n>\n> > It is possible.  I'm just not sure what the syntax for it should be.\n> > Suggestions?  I really want to stay backwards compatible with the\n> > current \"C\" command, so:\n> >\n> >       'C' SP commit SP path SP path\n> >\n> > is out because its ambiguous with the current meaning where the\n> > second (destination) path can contain SP without being quoted by\n> > the frontend.\n>\n> You could always make it part of the 'M' command?\n>\n> 'M' sp mode sp 'copy' sp path_str lf (ref_str | hexsha1 | sha1exp_str |\n> idnum) SP path_str;\n>\n> Or just make it a new command, O (for other) or E (for existing) maybe? :S\n\nSince we'll be referring to past commits via marks (with start with\n\":\") how about this:\n\n'C' SP srcpath:mark SP dstpath\n\nIn the case of making it a new command I can't think of any really\ncompelling one letter names. ;-)\n\n- David\n\n>\n> --\n> Julian\n>\n>   ---\n> It is easier to change the specification to fit the program than vice versa.\n>\n\n-- \nIf I have not seen farther, it is because I have stood in the\nfootsteps of giants.\n"},{"id":"47936","messageId":"Pine.LNX.4.64.0707200759090.20056@beast.quantumfyre.co.uk","threadId":"9066","inReplyTo":"7154c5c60707192354k7db677a6m4f8cbd474747ca92@mail.gmail.com","subject":"Re: Another question about importing SVN with fast-import","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-07-20T07:01:01Z","receivedAt":"2007-07-20T07:01:01Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Thu, 19 Jul 2007, David Frech wrote:\n\n> On 7/19/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n>>  On Fri, 20 Jul 2007, Shawn O. Pearce wrote:\n>> \n>> >  It is possible.  I'm just not sure what the syntax for it should be.\n>> >  Suggestions?  I really want to stay backwards compatible with the\n>> >  current \"C\" command, so:\n>> > \n>> >        'C' SP commit SP path SP path\n>> > \n>> >  is out because its ambiguous with the current meaning where the\n>> >  second (destination) path can contain SP without being quoted by\n>> >  the frontend.\n>>\n>>  You could always make it part of the 'M' command?\n>>\n>>  'M' sp mode sp 'copy' sp path_str lf (ref_str | hexsha1 | sha1exp_str |\n>>  idnum) SP path_str;\n>>\n>>  Or just make it a new command, O (for other) or E (for existing) maybe? :S\n>\n> Since we'll be referring to past commits via marks (with start with\n> \":\") how about this:\n>\n> 'C' SP srcpath:mark SP dstpath\n\nWhy only via marks?  That may be what you happen to want, but no other \ncommand restricts you to _only_ using marks ...\n\n>\n> In the case of making it a new command I can't think of any really\n> compelling one letter names. ;-)\n>\n> - David\n>\n>>\n>>  --\n>>  Julian\n>>\n>>    ---\n>>  It is easier to change the specification to fit the program than vice\n>>  versa.\n>> \n>\n>\n\n-- \nJulian\n\n  ---\nWhat say you, Mr. American Ambassador?\n\nFuck Canada!\n"},{"id":"47938","messageId":"7154c5c60707200016x45f4493ep3635be87afdc3e2c@mail.gmail.com","threadId":"9066","inReplyTo":"Pine.LNX.4.64.0707200759090.20056@beast.quantumfyre.co.uk","subject":"Re: Another question about importing SVN with fast-import","fromName":"David Frech","fromEmail":"david@nimblemachines.com","sentAt":"2007-07-20T07:16:13Z","receivedAt":"2007-07-20T07:16:13Z","isPatch":false,"sender":{"key":"david@nimblemachines.com","avatar":null},"body":"On 7/20/07, Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> On Thu, 19 Jul 2007, David Frech wrote:\n> > Since we'll be referring to past commits via marks (with start with\n> > \":\") how about this:\n> >\n> > 'C' SP srcpath:mark SP dstpath\n>\n> Why only via marks?  That may be what you happen to want, but no other\n> command restricts you to _only_ using marks ...\n\nI was using the royal \"we\". ;-)\n\nYes, you're right of course. My bad.\n\n- David\n\n> --\n> Julian\n>\n>   ---\n> What say you, Mr. American Ambassador?\n>\n> Fuck Canada!\n>\n\n\n-- \nIf I have not seen farther, it is because I have stood in the\nfootsteps of giants.\n"},{"id":"48328","messageId":"20070723180636.GA20174@efreet.light.src","threadId":"9066","inReplyTo":"20070720051142.GO32566@spearce.org","subject":"Re: Another question about importing SVN with fast-import","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-07-23T18:06:36Z","receivedAt":"2007-07-23T18:06:36Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Fri, Jul 20, 2007 at 01:11:42 -0400, Shawn O. Pearce wrote:\n> It is possible.  I'm just not sure what the syntax for it should be.\n> Suggestions?  I really want to stay backwards compatible with the\n> current \"C\" command, so:\n> \n> \t'C' SP commit SP path SP path\n> \n> is out because its ambiguous with the current meaning where the\n> second (destination) path can contain SP without being quoted by\n> the frontend.\n\nI'd suggest one of two variants:\n 1) 'M' SP <mode> SP <dataref> SP <path> LF\n    where <dataref> would be extended to understand the\n    {tag-id|commit-id|tree-id}:path notation git-ref-parse understands plus\n    mark:path where mark points to commit.\n 2) 'C' SP <dataref> SP <path> LF\n    where again <dataref> can be {tag-id|commit-id|tree-id|mark}:path -- or\n    just path which implies current head.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"50015","messageId":"Pine.LNX.4.64.0708061408470.18641@reaper.quantumfyre.co.uk","threadId":"9066","inReplyTo":"20070717033840.GK32566@spearce.org","subject":"Re: Another question about importing SVN with fast-import","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-08-06T13:13:57Z","receivedAt":"2007-08-06T13:13:57Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Mon, 16 Jul 2007, Shawn O. Pearce wrote:\n\n> Julian Phillips <julian@quantumfyre.co.uk> wrote:\n>> However, how do you copy a file from a\n>> particular revision?\n>\n> and sometimes not so much.  You can't do that right now.  I've wanted\n> to open up the data subcommand to allow another form that lets you\n> specify data from a branch and file path (thus selecting a blob\n> from another revision) but I haven't gotten around to it.  I also\n> don't have time to do it during the earlier part of this week.\n> Maybe I'll get to it later near the end of the week.\n\nI was wondering if this was still a vague todo item, or if it was being \nworked on?  It really is the biggest thing blocking my import at the \nmoment and I'm willing to have a bash at it myself, but I didn't want to \nstart messing around inside the fast-import code if someone else was \nalready there ...\n\n>\n> It shouldn't be too difficult now with the tree_content_get()\n> function that I recently defined for the C/R commands.  The SHA-1\n> comes back in the tree_entry leaf, but that codepath is only valid\n> for the tip of a branch that fast-import knows about in memory.\n> If it doesn't then you probably need to fallback into raw tree\n> parsing.  Ugh.\n>\n> The way prior frontends have handled this is they assigned marks\n> to every blob, and then had a translation table within the frontend\n> of revision->mark, so that anytime it needed a given revision of a\n> file it knew what mark to send to fast-import.  This does require\n> that the frontend maintain basically everything...\n\nNot sure how that would apply to trees ... and I would rather minimise the \namount of state retained in the frontend.\n\n-- \nJulian\n\n  ---\nDisco is to music what Etch-A-Sketch is to art.\n"},{"id":"50063","messageId":"20070807010850.GM9527@spearce.org","threadId":"9066","inReplyTo":"Pine.LNX.4.64.0708061408470.18641@reaper.quantumfyre.co.uk","subject":"Re: Another question about importing SVN with fast-import","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-08-07T01:08:50Z","receivedAt":"2007-08-07T01:08:50Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> On Mon, 16 Jul 2007, Shawn O. Pearce wrote:\n> \n> >Julian Phillips <julian@quantumfyre.co.uk> wrote:\n> >>However, how do you copy a file from a\n> >>particular revision?\n> >\n> >and sometimes not so much.  You can't do that right now.  I've wanted\n> >to open up the data subcommand to allow another form that lets you\n> >specify data from a branch and file path (thus selecting a blob\n> >from another revision) but I haven't gotten around to it.  I also\n> >don't have time to do it during the earlier part of this week.\n> >Maybe I'll get to it later near the end of the week.\n> \n> I was wondering if this was still a vague todo item, or if it was being \n> worked on?  It really is the biggest thing blocking my import at the \n> moment and I'm willing to have a bash at it myself, but I didn't want to \n> start messing around inside the fast-import code if someone else was \n> already there ...\n\nNo, its not vague.  I'm still working on it.  Actually its on\nmy to-do list for tonight, and if I don't finish it tonight then\nThursday.\n \n-- \nShawn.\n"}]}