Re: Git clone error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 1 Aug 2007, Denis Bueno wrote:

> On 08/01/2007 11:17, "Johannes Schindelin" <Johannes.Schindelin@xxxxxx>
> wrote:
> > But this is what I would do if I had the problem: I would try to create
> > a state which is as close to the corrupt revision as possible,
> > use a graft to replace the initial commit with that revision, and
> > rewrite the branch. I'd probably start by doing something like this:
> > 
> > $ git symbolic-ref HEAD refs/heads/recreate-first && rm .git/index
> > $ git ls-tree -r --name-only <initial-commit> |
> > grep -v "^condor/condor-uninstall.sh$" |
> > xargs git checkout <initial-commit>
> > $ git checkout <second-commit> condor/condor-uninstall.sh
> > [possibly some minor hacking on the latter file to make it work]
> > $ git commit -c <initial-commit>
> 
> Wow.  `commit' and `checkout' are the only two commands that I have ever
> heard of in that sequence.
> 
> How difficult would it be to create a new git repo which is exactly the same
> minus the initial condor-uninstall.sh commit?  That is, just to pretend the
> initial import of condor-uninstall.sh never existed, and use the second
> commit of the old repo the first commit of the new, and preserve the rest of
> the history of the entire repo?

That would be even easier.  Just graft "nothingness" as parent of the 
second commit:

	$ git rev-parse <second-commit> >> .git/info/grafts

But of course, you should use filter-branch nevertheless, since you would 
have to do the same hack in _every_ repository.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux