git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Problem getting older version

From
NSNico -telmich- Schottelius <nico-linux-git@schottelius.org>
Date
Oct 19, 2005, 08:00 UTC
Message-ID
<20051019080046.GI22986@schottelius.org>
Hello!
The following situation:
- The last commit was a merge, mhich broke some files
- We want three files from the commit before
Now I was told to do the following:
1. get the sha1hash from the commit before (cg-log did that)
2. get the sha1hash from the file in that tree:
[9:27] srsyg01:walderlift% git-ls-tree 35ff687efc1b19b4db918e5af859894a9dc916e4 Code/lw1/Client/MainForm.xfm 
100644 blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a    Code/lw1/Client/MainForm.xfm
3. cat the file with git-cat-file
[9:36] srsyg01:walderlift% git-cat-file blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a | less
4. Now overwrite it
[9:38] srsyg01:walderlift% git-cat-file blob 605958b1435f6bdbd5cc502ae3a4c1a281d01f0a > Code/lw1/Client/MainForm.xfm 
5. Goto 2 and repeat two times
Is this really the standard way to recover a file? As a developer / end user I would expect that:
cg-recover <filename> <commit id> and -f for overwriting the file if it exists

Did I overlook something or is it currently really this complicated? And it is very error prone, if I have to overwrite the files using '>'-redirection (perhaps I mistype the filename).

Nico
-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.
Next: Junio C Hamano
Message 1 of 4 in “Problem getting older version”
  1. Nico -telmich- SchotteliusOct 19, 2005
  2. Junio C HamanoOct 19, 2005
  3. Petr BaudisOct 20, 2005
  4. Nico -telmich- SchotteliusOct 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.