git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem getting older version
@ 2005-10-19  8:00 Nico -telmich- Schottelius
  2005-10-19  8:26 ` Junio C Hamano
  2005-10-20  1:42 ` Petr Baudis
  0 siblings, 2 replies; 4+ messages in thread
From: Nico -telmich- Schottelius @ 2005-10-19  8:00 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem getting older version
  2005-10-19  8:00 Problem getting older version Nico -telmich- Schottelius
@ 2005-10-19  8:26 ` Junio C Hamano
  2005-10-20  1:42 ` Petr Baudis
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2005-10-19  8:26 UTC (permalink / raw)
  To: Nico -telmich- Schottelius; +Cc: git

Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:

> The following situation:
>
> - The last commit was a merge, mhich broke some files
> - We want three files from the commit before

With only git-core tool, with the tip of the master branch,
would be:

    $ git pull somewhere ;# this caused the mismerge
    $ git checkout HEAD^ foo.c bar.c baz.c

This assumes that HEAD is a merge and HEAD^ (= HEAD^1) is the tip
of your branch before that merge (HEAD^2 would be what you
pulled from "somewhere").

The latest "git checkout", when given extra paths parameters,
does not switch branches.  Instead it pulls out named files from
the given version into your index, and checks them out. 

> Now I was told to do the following:

These 5 steps look correct; after that, you probably would want
to run git-update-index on those three paths.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem getting older version
  2005-10-19  8:00 Problem getting older version Nico -telmich- Schottelius
  2005-10-19  8:26 ` Junio C Hamano
@ 2005-10-20  1:42 ` Petr Baudis
  2005-10-24  5:23   ` Nico -telmich- Schottelius
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Baudis @ 2005-10-20  1:42 UTC (permalink / raw)
  To: Nico -telmich- Schottelius; +Cc: git

  Hello,

Dear diary, on Wed, Oct 19, 2005 at 10:00:46AM CEST, I got a letter
where Nico -telmich- Schottelius <nico-linux-git@schottelius.org> told me that...
> The following situation:
> 
> - The last commit was a merge, mhich broke some files
> - We want three files from the commit before
..snip..
> 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

  thanks for the suggestion. I've revamped cg-restore to support this
kind of syntax, so now if you do

	cg-restore -r ID [-f] FILENAME

it should do what you want.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem getting older version
  2005-10-20  1:42 ` Petr Baudis
@ 2005-10-24  5:23   ` Nico -telmich- Schottelius
  0 siblings, 0 replies; 4+ messages in thread
From: Nico -telmich- Schottelius @ 2005-10-24  5:23 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

Thanks Petr!

Didn't have the time (and network connection, writing offline currently) to
test latest cogito/git for the other errors, but will do that on monday.

Nico

Petr Baudis [Thu, Oct 20, 2005 at 03:42:30AM +0200]:
>   Hello,
> 
> Dear diary, on Wed, Oct 19, 2005 at 10:00:46AM CEST, I got a letter
> where Nico -telmich- Schottelius <nico-linux-git@schottelius.org> told me that...
> > The following situation:
> > 
> > - The last commit was a merge, mhich broke some files
> > - We want three files from the commit before
> ..snip..
> > 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
> 
>   thanks for the suggestion. I've revamped cg-restore to support this
> kind of syntax, so now if you do
> 
> 	cg-restore -r ID [-f] FILENAME
> 
> it should do what you want.
> 
> -- 
> 				Petr "Pasky" Baudis
> Stuff: http://pasky.or.cz/
> VI has two modes: the one in which it beeps and the one in which
> it doesn't.
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Latest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)
Open Source nutures open minds and free, creative developers.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-24  5:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-19  8:00 Problem getting older version Nico -telmich- Schottelius
2005-10-19  8:26 ` Junio C Hamano
2005-10-20  1:42 ` Petr Baudis
2005-10-24  5:23   ` Nico -telmich- Schottelius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).