public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* Prepend the history of one git tree to another
@ 2006-02-20  9:09 Thomas Glanzmann
  2006-02-20 10:14 ` Andreas Ericsson
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Glanzmann @ 2006-02-20  9:09 UTC (permalink / raw)
  To: GIT

Hello,
I have two trees: blastwave and blastwave.old. blastwave.old is the
BitKeeper -> CVS -> GIT Tree of the project and blastwave is the newer
one that I started when I stoped using bitkeeper. What I want is to 
append the history of blastwave to blastwave.old. The problem is that I
need to create new commit objects for every commit I want to append to
the old history. Is there a script which does that for me? Or do I have
to write this script myself?

        Thomas

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

* Re: Prepend the history of one git tree to another
  2006-02-20  9:09 Prepend the history of one git tree to another Thomas Glanzmann
@ 2006-02-20 10:14 ` Andreas Ericsson
  2006-02-20 10:43   ` Thomas Glanzmann
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Ericsson @ 2006-02-20 10:14 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: GIT

Thomas Glanzmann wrote:
> Hello,
> I have two trees: blastwave and blastwave.old. blastwave.old is the
> BitKeeper -> CVS -> GIT Tree of the project and blastwave is the newer
> one that I started when I stoped using bitkeeper. What I want is to 
> append the history of blastwave to blastwave.old. The problem is that I
> need to create new commit objects for every commit I want to append to
> the old history. Is there a script which does that for me? Or do I have
> to write this script myself?
> 

Something like this might do the trick, depending on how linear your 
ancestry graph is:

$ cd blastwave
$ first=$(git rev-list HEAD | tail -n 1)
$ git format-patch -k --stdout $first..HEAD > ../blw.mbox
$ cd ../blastwave.old
$ git am -k -3 ../blw.mbox

YMMV though, so set an anchor tag at the HEAD of blastwave.old so you 
can return to it if things go awry. If the history is very non-linear I 
think you'll have to do the same for each and every branch, although 
you'd have to use "git merge-base" to figure out how long to go.

-- 
Andreas Ericsson                   andreas.ericsson@op5•se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

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

* Re: Prepend the history of one git tree to another
  2006-02-20 10:14 ` Andreas Ericsson
@ 2006-02-20 10:43   ` Thomas Glanzmann
  2006-02-20 10:57     ` Ryan Anderson
  2006-02-20 12:51     ` Johannes Schindelin
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Glanzmann @ 2006-02-20 10:43 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: GIT

Hello Andreas,

> Something like this might do the trick, depending on how linear your 
> ancestry graph is:

> $ cd blastwave
> $ first=$(git rev-list HEAD | tail -n 1)
> $ git format-patch -k --stdout $first..HEAD > ../blw.mbox
> $ cd ../blastwave.old
> $ git am -k -3 ../blw.mbox

My graph is very linear. However. I have binaries checked into my tree.
I am not sure if format-patch can handle this.

        Thomas

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

* Re: Prepend the history of one git tree to another
  2006-02-20 10:43   ` Thomas Glanzmann
@ 2006-02-20 10:57     ` Ryan Anderson
  2006-02-20 12:20       ` Thomas Glanzmann
  2006-02-20 12:51     ` Johannes Schindelin
  1 sibling, 1 reply; 6+ messages in thread
From: Ryan Anderson @ 2006-02-20 10:57 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: Andreas Ericsson, GIT

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

Thomas Glanzmann wrote:

>Hello Andreas,
>
>  
>
>>Something like this might do the trick, depending on how linear your 
>>ancestry graph is:
>>    
>>
>
>  
>
>>$ cd blastwave
>>$ first=$(git rev-list HEAD | tail -n 1)
>>$ git format-patch -k --stdout $first..HEAD > ../blw.mbox
>>$ cd ../blastwave.old
>>$ git am -k -3 ../blw.mbox
>>    
>>
>
>My graph is very linear. However. I have binaries checked into my tree.
>I am not sure if format-patch can handle this.
>  
>
I wrote a program called "graft-ripple", that takes a commit, and
rewrites the current branch's history to reflect as if it started at
that commit.

It doesn't ever actually work with diffs or anything, it just reads
commits and trees and recreates them.

It's in the list archives, but I appear to have deleted it when I was
cleaning up my archives.

http://www.gelato.unsw.edu.au/archives/git/0511/12965.html

Hope this helps!

-- 

Ryan Anderson
  sometimes Pug Majere


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

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

* Re: Prepend the history of one git tree to another
  2006-02-20 10:57     ` Ryan Anderson
@ 2006-02-20 12:20       ` Thomas Glanzmann
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Glanzmann @ 2006-02-20 12:20 UTC (permalink / raw)
  To: Ryan Anderson; +Cc: GIT

Hello,

> I wrote a program called "graft-ripple", that takes a commit, and
> rewrites the current branch's history to reflect as if it started at
> that commit. It doesn't ever actually work with diffs or anything, it
> just reads commits and trees and recreates them.

> http://www.gelato.unsw.edu.au/archives/git/0511/12965.html

that is *exactly* what I was looking for. Thanks.

> Hope this helps!

Well it does!

Thanks,
        Thomas

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

* Re: Prepend the history of one git tree to another
  2006-02-20 10:43   ` Thomas Glanzmann
  2006-02-20 10:57     ` Ryan Anderson
@ 2006-02-20 12:51     ` Johannes Schindelin
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2006-02-20 12:51 UTC (permalink / raw)
  To: Thomas Glanzmann; +Cc: Andreas Ericsson, GIT

Hi,

On Mon, 20 Feb 2006, Thomas Glanzmann wrote:

> Hello Andreas,
> 
> > Something like this might do the trick, depending on how linear your 
> > ancestry graph is:
> 
> > $ cd blastwave
> > $ first=$(git rev-list HEAD | tail -n 1)
> > $ git format-patch -k --stdout $first..HEAD > ../blw.mbox
> > $ cd ../blastwave.old
> > $ git am -k -3 ../blw.mbox
> 
> My graph is very linear. However. I have binaries checked into my tree.
> I am not sure if format-patch can handle this.

Do you need the history at all times? If not, you could just make a graft 
file. If you need it always, you could even check in a version of the 
graft file (but remember to copy it to .git/info/grafts, too).

Hth,
Dscho

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

end of thread, other threads:[~2006-02-20 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20  9:09 Prepend the history of one git tree to another Thomas Glanzmann
2006-02-20 10:14 ` Andreas Ericsson
2006-02-20 10:43   ` Thomas Glanzmann
2006-02-20 10:57     ` Ryan Anderson
2006-02-20 12:20       ` Thomas Glanzmann
2006-02-20 12:51     ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox