{"thread":{"id":"2145","subject":"Problem getting older version","startedAt":"2005-10-19T08:00:46Z","lastAt":"2005-10-24T05:23:35Z","messageCount":4,"participants":["Nico -telmich- Schottelius","Junio C Hamano","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"10261","messageId":"20051019080046.GI22986@schottelius.org","threadId":"2145","inReplyTo":null,"subject":"Problem getting older version","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2005-10-19T08:00:46Z","receivedAt":"2005-10-19T08:00:46Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Hello!\n\nThe following situation:\n\n- The last commit was a merge, mhich broke some files\n- We want three files from the commit before\n\nNow I was told to do the following:\n\n1. get the sha1hash from the commit before (cg-log did that)\n2. get the sha1hash from the file in that tree:\n[9:27] srsyg01:walderlift% git-ls-tree 35ff687efc1b19b4db918e5af859894a9dc916e4 Code/lw1/Client/MainForm.xfm \n100644 blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a    Code/lw1/Client/MainForm.xfm\n\n3. cat the file with git-cat-file\n[9:36] srsyg01:walderlift% git-cat-file blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a | less\n\n4. Now overwrite it\n[9:38] srsyg01:walderlift% git-cat-file blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a > Code/lw1/Client/MainForm.xfm \n\n5. Goto 2 and repeat two times\n\nIs this really the standard way to recover a file? As a developer / end user I would expect that:\n\ncg-recover <filename> <commit id> and -f for overwriting the file if it exists\n\nDid I overlook something or is it currently really this complicated? And it is\nvery error prone, if I have to overwrite the files using '>'-redirection (perhaps I mistype the\nfilename).\n\nNico\n\n-- \nLatest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)\nOpen Source nutures open minds and free, creative developers.\n"},{"id":"10265","messageId":"7vach5ewu4.fsf@assigned-by-dhcp.cox.net","threadId":"2145","inReplyTo":"20051019080046.GI22986@schottelius.org","subject":"Re: Problem getting older version","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-19T08:26:43Z","receivedAt":"2005-10-19T08:26:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:\n\n> The following situation:\n>\n> - The last commit was a merge, mhich broke some files\n> - We want three files from the commit before\n\nWith only git-core tool, with the tip of the master branch,\nwould be:\n\n    $ git pull somewhere ;# this caused the mismerge\n    $ git checkout HEAD^ foo.c bar.c baz.c\n\nThis assumes that HEAD is a merge and HEAD^ (= HEAD^1) is the tip\nof your branch before that merge (HEAD^2 would be what you\npulled from \"somewhere\").\n\nThe latest \"git checkout\", when given extra paths parameters,\ndoes not switch branches.  Instead it pulls out named files from\nthe given version into your index, and checks them out. \n\n> Now I was told to do the following:\n\nThese 5 steps look correct; after that, you probably would want\nto run git-update-index on those three paths.\n"},{"id":"10328","messageId":"20051020014230.GV30889@pasky.or.cz","threadId":"2145","inReplyTo":"20051019080046.GI22986@schottelius.org","subject":"Re: Problem getting older version","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-10-20T01:42:30Z","receivedAt":"2005-10-20T01:42:30Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hello,\n\nDear diary, on Wed, Oct 19, 2005 at 10:00:46AM CEST, I got a letter\nwhere Nico -telmich- Schottelius <nico-linux-git@schottelius.org> told me that...\n> The following situation:\n> \n> - The last commit was a merge, mhich broke some files\n> - We want three files from the commit before\n..snip..\n> Is this really the standard way to recover a file? As a developer / end user I would expect that:\n> \n> cg-recover <filename> <commit id> and -f for overwriting the file if it exists\n\n  thanks for the suggestion. I've revamped cg-restore to support this\nkind of syntax, so now if you do\n\n\tcg-restore -r ID [-f] FILENAME\n\nit should do what you want.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"10521","messageId":"20051024052335.GB1830@schottelius.org","threadId":"2145","inReplyTo":"20051020014230.GV30889@pasky.or.cz","subject":"Re: Problem getting older version","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2005-10-24T05:23:35Z","receivedAt":"2005-10-24T05:23:35Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Thanks Petr!\n\nDidn't have the time (and network connection, writing offline currently) to\ntest latest cogito/git for the other errors, but will do that on monday.\n\nNico\n\nPetr Baudis [Thu, Oct 20, 2005 at 03:42:30AM +0200]:\n>   Hello,\n> \n> Dear diary, on Wed, Oct 19, 2005 at 10:00:46AM CEST, I got a letter\n> where Nico -telmich- Schottelius <nico-linux-git@schottelius.org> told me that...\n> > The following situation:\n> > \n> > - The last commit was a merge, mhich broke some files\n> > - We want three files from the commit before\n> ..snip..\n> > Is this really the standard way to recover a file? As a developer / end user I would expect that:\n> > \n> > cg-recover <filename> <commit id> and -f for overwriting the file if it exists\n> \n>   thanks for the suggestion. I've revamped cg-restore to support this\n> kind of syntax, so now if you do\n> \n> \tcg-restore -r ID [-f] FILENAME\n> \n> it should do what you want.\n> \n> -- \n> \t\t\t\tPetr \"Pasky\" Baudis\n> Stuff: http://pasky.or.cz/\n> VI has two modes: the one in which it beeps and the one in which\n> it doesn't.\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nLatest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)\nOpen Source nutures open minds and free, creative developers.\n"}]}