How to convert git to pijul repositories?

How do I convert an existing git repo to a pijul repo? Strangely, I didn’t find a description in the documentation or the FAQ, and a web search comes up empty. There’s a discourse topic https://discourse.pijul.org/t/adventures-in-converting-git-pijul/518, but the repo mentioned there https://nest.pijul.com/rohan/git-pijul doesn’t seem to exist any more.

-erik

1 Like

Yes, since this is such an important feature, I decided to devote more energy to it in the 1.0 release. This is now included in Pijul: if you compile Pijul with --features git (i.e. cargo install pijul --version "~1.0-alpha" --features git), you’ll get a pijul git command, which imports a Git repository, and remembers a mapping between commits and patches so that you can even keep working in Git, and import your commits incrementally.

(There are probably some caveats to this last thing).

Note that we’ll change the repository format in a few days, before release the beta version, and this will break existing repositories. The new backend is at least five times faster, and also allows for less memory copies, so I’m expecting a big performance improvement.

3 Likes

I tried to convert the hummingbot git repo into pijul, but I am getting an error and the process aborted.

The repo is GitHub - hummingbot/hummingbot: Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain

I made a local git clone. Then I created an empty pijul repo. I went into my new pijul repo and started the conversion.

git clone https://github.com/hummingbot/hummingbot.git
mkdir hummingbot-pijul
cd hummingbot-pijul
pijul git ../hummingbot

The conversion started, but after a few commits had been imported, the process aborted with this error message:

INFO Loading Git history...
INFO applying FTYKB4QDD5HHJV3YVYL7JPHVBSTK2ON4RVFGEEJH5PTBQE2QSDWAC to "e649bcb15c6dccad59a559fe188a1b2d928fffcf"
INFO Importing commit e649bcb15c6dccad59a559fe188a1b2d928fffcf: Merge branch 'master' into mf-03-docs-polish
Error: Block error: Position { change: ChangeId(SWAA7P6OQDY2C), pos: ChangePosition(L64(619)) }

I’m not sure what that means, or what to try next.

I am running pijul 1.0.0-beta.1

1 Like

This is a bug, I’m working on it. Thanks.

Fixed, thanks a lot. Core bugs like this are getting rare, so finding one is great.

If you want to try it out now, you can pull from the Nest. I’ll publish a new version right now anyway.

1 Like

Thank you for working on this so quickly!

I think I managed to install pijul from the nest, but when I tried to convert the hummingbot git repo, it says it is importing a commit, and then it stops. The current directory is empty.

pijul clone https://nest.pijul.com/pijul/pijul
cd pijul
cargo build
cd pijul
cargo install --path . --features git

cd
mkdir hummingbot-pijul
cd hummingbot-pijul
pijul git ../hummingbot-git

The entire output is:

INFO Loading Git history...
INFO applying FTYKB4QDD5HHJV3YVYL7JPHVBSTK2ON4RVFGEEJH5PTBQE2QSDWAC to "e649bcb15c6dccad59a559fe188a1b2d928fffcf"
INFO Importing commit e649bcb15c6dccad59a559fe188a1b2d928fffcf: Merge branch 'master' into mf-03-docs-polish

Afterward, I am in an empty directory.

If I do a pijul init command before the pijul git command, then I have a .pijul directory in the current directory, and the only output from the pijul git command is:

    INFO Loading Git history...

Then I am back on the command line with a prompt again.

I’m not sure how to convert the hummingbot git repo successfully (or did I not install the updated pijul correctly?).

This is one of the shortcomings of this approach to converting Git to Pijul, the working copy is modified, and HEAD is set to whatever commit was being imported when it stopped.

So, to fix that you have to do git pull from the original repo, or git reset --hard LAST_COMMIT if you know what HEAD should be.

There is a project to improve that part in Pijul, but it isn’t there yet.

You are thinking of the pijul git command like I do (and most people would), that the external git folder would be brought into the current folder. But (at least right now) it made a pijul repo in the external git folder.

See my issue at the Nest: pijul/pijul - Discussion #672 - the git command modifies the git folder
No one has answered the question of how this is supposed to be used to add a git folder to an existing repo.