Script to migrate all mcz packages to git?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Script to migrate all mcz packages to git?

Holger Freyther
Hi,

I think I have seen something but can't find it right now. I would like to move to git but preserve the history (and my commit messages and the commit date/time). Is there a script that goes through all versions of a package and copies them to git repository? Will it be able to preserve the original commit date?

thank you
        holger
Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Nicolas Passerini
There is this script from Peter Uhnak https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository

but it will not be able to preserve commit date. 

Preserving commit dates... I think it could only be possible in metadata-ful git repositories, which I would not recommend.

On Tue, Aug 2, 2016 at 12:10 PM, Holger Freyther <[hidden email]> wrote:
Hi,

I think I have seen something but can't find it right now. I would like to move to git but preserve the history (and my commit messages and the commit date/time). Is there a script that goes through all versions of a package and copies them to git repository? Will it be able to preserve the original commit date?

thank you
        holger

Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Peter Uhnak
On Tue, Aug 02, 2016 at 01:04:10PM +0200, Nicolas Passerini wrote:
> There is this script from Peter Uhnak
> https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository
>
> but it will not be able to preserve commit date.

At the time of the (post) writing it did preserve commit dates, but there was no metadata-less yet.

In any case, I don't see a reason why it shouldn't preserve commit dates with metadata-less — it goes mcz by mcz and recommits it with given date, no?

Peter

>
> Preserving commit dates... I think it could only be possible in
> metadata-ful git repositories, which I would not recommend.
>
> On Tue, Aug 2, 2016 at 12:10 PM, Holger Freyther <[hidden email]> wrote:
>
> > Hi,
> >
> > I think I have seen something but can't find it right now. I would like to
> > move to git but preserve the history (and my commit messages and the commit
> > date/time). Is there a script that goes through all versions of a package
> > and copies them to git repository? Will it be able to preserve the original
> > commit date?
> >
> > thank you
> >         holger
> >

Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Thierry Goubier
Le 02/08/2016 à 13:23, Peter Uhnak a écrit :
> On Tue, Aug 02, 2016 at 01:04:10PM +0200, Nicolas Passerini wrote:
>> There is this script from Peter Uhnak
>> https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository
>>
>> but it will not be able to preserve commit date.
>
> At the time of the (post) writing it did preserve commit dates, but there was no metadata-less yet.
>
> In any case, I don't see a reason why it shouldn't preserve commit dates with metadata-less — it goes mcz by mcz and recommits it with given date, no?

No it doesn't set the commit date. I'm not even sure git would allow you
to set commit dates in the past, but I may be wrong (this is probably
what git-cvs does).

I'd say that the procedure is to make a copy on a metadata-full
repository, to preserve all versions (for archeology), and then now or
later switch the repository to metadata-less mode.

GitFileTree has an api for carrying over a committer name in a mcz to an
author name into git, by preloading a map of mcz author -> git author.

Thierry

> Peter
>
>>
>> Preserving commit dates... I think it could only be possible in
>> metadata-ful git repositories, which I would not recommend.
>>
>> On Tue, Aug 2, 2016 at 12:10 PM, Holger Freyther <[hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I think I have seen something but can't find it right now. I would like to
>>> move to git but preserve the history (and my commit messages and the commit
>>> date/time). Is there a script that goes through all versions of a package
>>> and copies them to git repository? Will it be able to preserve the original
>>> commit date?
>>>
>>> thank you
>>>         holger
>>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Dale Henrichs-3
In reply to this post by Holger Freyther
Holger,

It looks like Frank Shearar tackled this problem a while ago[1]. His
solution is based on using gitocello[2], but it could possibly be
adapted for GitFileTree ... Thierry would be able to tell ...

Dale

[1] http://www.lshift.net/blog/2012/08/20/monticello-git/
[2] https://github.com/timfel/gitocello

On 08/02/2016 03:10 AM, Holger Freyther wrote:
> Hi,
>
> I think I have seen something but can't find it right now. I would like to move to git but preserve the history (and my commit messages and the commit date/time). Is there a script that goes through all versions of a package and copies them to git repository? Will it be able to preserve the original commit date?
>
> thank you
> holger


Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Peter Uhnak
In reply to this post by Thierry Goubier
On Tue, Aug 2, 2016 at 9:07 PM, Thierry Goubier <[hidden email]> wrote:
Le 02/08/2016 à 13:23, Peter Uhnak a écrit :
On Tue, Aug 02, 2016 at 01:04:10PM +0200, Nicolas Passerini wrote:
There is this script from Peter Uhnak
https://www.peteruhnak.com/blog/2016/03/02/moving-project-from-smalltalkhub-to-github/#Copying-repository

but it will not be able to preserve commit date.

At the time of the (post) writing it did preserve commit dates, but there was no metadata-less yet.

In any case, I don't see a reason why it shouldn't preserve commit dates with metadata-less — it goes mcz by mcz and recommits it with given date, no?

No it doesn't set the commit date. I'm not even sure git would allow you to set commit dates in the past, but I may be wrong (this is probably what git-cvs does).

git doesn't prohibit modification of history in any way, so you can do whatever you want.

In fact this is how gitfiletree DID behave when I was moving last year, but I don't know whether this particular change was removed, or never integrated (i.e. just my local change).

Peter
Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Nicolas Passerini
In reply to this post by Peter Uhnak

On Tue, Aug 2, 2016 at 1:23 PM, Peter Uhnak <[hidden email]> wrote:
At the time of the (post) writing it did preserve commit dates, but there was no metadata-less yet.

In any case, I don't see a reason why it shouldn't preserve commit dates with metadata-less — it goes mcz by mcz and recommits it with given date, no?

Yes, Peter is right, it can be done.
I intend to build a migration into the next version of Iceberg, I will pay attention on keeping date/authors.
Reply | Threaded
Open this post in threaded view
|

Re: Script to migrate all mcz packages to git?

Holger Freyther
In reply to this post by Peter Uhnak

> On 02 Aug 2016, at 13:23, Peter Uhnak <[hidden email]> wrote:
>
>>

Hi Peter,


> At the time of the (post) writing it did preserve commit dates, but there was no metadata-less yet.
>
> In any case, I don't see a reason why it shouldn't preserve commit dates with metadata-less — it goes mcz by mcz and recommits it with given date, no?


I have modified >>#basicStoreVersion: to pass the --date option to git and now date/time is preserved. I am copying multiple related packages into the same git repository and would like to "interleave" (based on date) the different packages.

In your script you first have:

  filesSorted := fileBlocks asSortedCollection: sortBlock.
  files := (filesSorted collect: [ :x | x first ]) asArray.

to select which files to actually copy (as Gofer allResolved has a lot more). but after the:

  goSource fetch. "downloads all mcz on your computer"


I would like to mix the different packages based on their date. Would you know which Gofer(?) API I can use to get a version info (?) so I can access the date?


holger