{"thread":{"id":"23041","subject":"Retrieve a specific file from some revision.","startedAt":"2010-03-16T18:55:38Z","lastAt":"2010-03-16T22:48:14Z","messageCount":3,"participants":["Harry Putnam","Martin Langhoff","Ben Finney"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136973","messageId":"87vdcwxfit.fsf@newsguy.com","threadId":"23041","inReplyTo":null,"subject":"Retrieve a specific file from some revision.","fromName":"Harry Putnam","fromEmail":"reader@newsguy.com","sentAt":"2010-03-16T18:55:38Z","receivedAt":"2010-03-16T18:55:38Z","isPatch":false,"sender":{"key":"reader@newsguy.com","avatar":null},"body":"First, let me just make sure this group is the general\nquestion/discussion group for the versioning tool `bazaar' on the web\nat:  http://bazaar.canonical.com/en/\n\nI asked this question on a mercurial group too.  Probably should have\njust crossposted so as not to have two different messgae-ids involved.\nI have done that with this post on bazarre-ng and git groups.\n\nI'm not just jerking around but want to know how this would be done.\nJust reading docu doesn't usually really help me until wade into\nsomething but this time I want to choose a versioning tool that I can\nreadily do things I've learned to rely on.\n\nReprint:\n-------        ---------       ---=---       ---------      -------- \n\nI've never used any versioning tool but cvs.  Something I do often\nwith cvs is retrieve a previous state of a single file..\n\nSay I wanted to use the hosts file as it was at revision 1.23.\nNot just a diff, but the actual file.\n(I would)\n  cd cvsrepo\n    cvs update -p -r1.23 <HOST>/etc/hosts > ~/hosts_HOST_r1.23\n\n  Would create the file as it was at rev. 1.23 for host HOST.\n\nHow would I do that in bazaar/git? (which ever newsgroup this is on)\n\n\n \n"},{"id":"136975","messageId":"46a038f91003161459t58c8df59q2b7fa18c1fccba88@mail.gmail.com","threadId":"23041","inReplyTo":"87vdcwxfit.fsf@newsguy.com","subject":"Re: Retrieve a specific file from some revision.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2010-03-16T21:59:36Z","receivedAt":"2010-03-16T21:59:36Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Tue, Mar 16, 2010 at 2:55 PM, Harry Putnam <reader@newsguy.com> wrote:\n> How would I do that in bazaar/git?\n\nThe easiests, most convenient is:\n\n   git show <revision>:path/to/file.c\n\ngit show can do various other things -- like show you a commit.\n\nYou should really follow a tutorial for git (and/or bazaar) to get\n\"the basics\". Any good tutorial will cover git show (but may not touch\nthis specific point) and a few others.\n\nIt is safe to say that bazaar, git and hg have a good command for\nsomething clear and basic like this. Asking these questions probably\nwon't help you decide what you want to decide ;-) --\n\n\n\nm\n-- \n martin.langhoff@gmail.com\n martin@laptop.org -- School Server Architect\n - ask interesting questions\n - don't get distracted with shiny stuff  - working code first\n - http://wiki.laptop.org/go/User:Martinlanghoff\n"},{"id":"136979","messageId":"87eijjx4r5.fsf@benfinney.id.au","threadId":"23041","inReplyTo":"87vdcwxfit.fsf@newsguy.com","subject":"Re: Retrieve a specific file from some revision.","fromName":"Ben Finney","fromEmail":"ben+bazaar@benfinney.id.au","sentAt":"2010-03-16T22:48:14Z","receivedAt":"2010-03-16T22:48:14Z","isPatch":false,"sender":{"key":"ben+bazaar@benfinney.id.au","avatar":null},"body":"Harry Putnam <reader@newsguy.com> writes:\n\n> I've never used any versioning tool but cvs.  Something I do often\n> with cvs is retrieve a previous state of a single file..\n>\n> Say I wanted to use the hosts file as it was at revision 1.23.\n\nI'll assume, from the Bazaar perspective, that this means “revno 123 of\nthe branch”. Bazaar tracks snapshot revisions of the working tree as a\nwhole, unlike CVS's per-file tracking.\n\n> Not just a diff, but the actual file.\n> (I would)\n>   cd cvsrepo\n>     cvs update -p -r1.23 <HOST>/etc/hosts > ~/hosts_HOST_r1.23\n>\n>   Would create the file as it was at rev. 1.23 for host HOST.\n>\n> How would I do that in bazaar/git? (which ever newsgroup this is on)\n\nTo get the file at revno 123 in the working tree for the branch (the\nmost normal place for it to appear):\n\n    $ cd bzrbranch/\n    $ bzr revert --revision 123 HOST/etc/hosts\n\nYou could then copy the file to wherever you actually want to use it.\n\nAlternatively, if you really do want something that emits the file\ncontents to stdout rather than recreating the file:\n\n    $ cd bzrbranch/\n    $ bzr cat --revision 123 HOST/etc/hosts > ~/hosts_HOST_r123\n\nThe ‘--revision 123’ option is the verbose spelling of ‘-r 123’.\n\n-- \n \\              “Whatever you do will be insignificant, but it is very |\n  `\\                    important that you do it.” —Mohandas K. Gandhi |\n_o__)                                                                  |\nBen Finney\n"}]}